Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 912036

Summary: dev-lang/python-3.12.0_rc1_p1[lto,pgo]: ICE with clang 17 due to ffat-lto-objects
Product: Gentoo Linux Reporter: Violet Purcell <vimproved>
Component: Current packagesAssignee: Python Gentoo Team <python>
Status: RESOLVED FIXED    
Severity: normal CC: parona
Priority: Normal Keywords: PullRequest
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://github.com/gentoo/gentoo/pull/32247
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 912821    
Attachments: build.log

Description Violet Purcell 2023-08-10 17:33:10 UTC
Created attachment 867581 [details]
build.log

clang 17 added support for -ffat-lto-objects, which the ebuild appends if it detects LTO. However, it seems that -ffat-lto-objects causes an ICE with pgo in this circumstance. Since ffat-lto-objects isn't necessary for python to compile with clang, it would probably be best to just condition append -ffat-lto-objects to !tc-is-clang.

Steps to reproduce:
- Use LLVM profile
- Install sys-devel/clang-17.0.0_rc2
- Set the pgo and lto USE flags for dev-lang/python
- emerge -av dev-lang/python:3.12
Comment 1 immolo 2023-08-10 17:58:40 UTC
I ran into a similar thing testing python-3.12 with GCC (Wasn't bug worthy like this error).

Since sys-devel/autoconf-archive-2023.02.20 the --ffat workaround in gentoo is no longer required for users that run -flto but don't set USE=lto so can be dropped. I've only tested this with 3.12 and have no issues running it for a short amount of time, so can only recommend doing this moving forward rather than backporting.

I was going to upstream the fix but after speaking with Sam it was made clear most distros will still require the workaround so removing the append line from the ebuild is the best way forward imo.
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-08-11 04:05:45 UTC
Please report the ICE to LLVM as well and link it here.
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-08-27 10:12:07 UTC
ping, 17 is imminent
Comment 4 Violet Purcell 2023-09-04 14:13:56 UTC
(In reply to Sam James from comment #3)
> ping, 17 is imminent

This was fixed by rc3 at least for me. Could others test?
Comment 5 Alfred Wingate 2023-10-02 03:01:24 UTC
rc3 with lto and pgo builds fine with clang-17 for me.

Safe to close by now?
Comment 6 Violet Purcell 2023-10-24 01:53:59 UTC
Yep, it was fixed a while ago. Closing.