Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 902075 - Building dev-lang/python with GCC 12 and "-g" fails with "error: inlining failed in call to 'always_inline'"
Summary: Building dev-lang/python with GCC 12 and "-g" fails with "error: inlining fai...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: PPC64 Linux
: Normal normal (vote)
Assignee: Python Gentoo Team
URL: https://github.com/python/cpython/iss...
Whiteboard:
Keywords:
Depends on:
Blocks: gcc-12
  Show dependency tree
 
Reported: 2023-03-18 18:16 UTC by Chris Kerr
Modified: 2023-09-28 11:49 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Log of failed build with GCC 12 (python-3-11-fail-gcc-12.log,290.17 KB, text/x-log)
2023-03-18 18:16 UTC, Chris Kerr
Details
Output of `emerge --info` with GCC 12 selected (emerge-info-gcc-12.txt,6.66 KB, text/plain)
2023-03-18 18:17 UTC, Chris Kerr
Details
Log of successful build with GCC 11 (python-3-11-success-gcc-11.log.gz,177.13 KB, application/gzip)
2023-03-18 18:19 UTC, Chris Kerr
Details
Output of `emerge --info` with GCC 11 selected (emerge-info-gcc-11.txt,6.66 KB, text/plain)
2023-03-18 18:19 UTC, Chris Kerr
Details
Log of failed build of dev-lang/perl (dev-lang:perl-5.36.0-r2:20230323-182757.log,155.46 KB, text/x-log)
2023-03-23 18:36 UTC, Chris Kerr
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Kerr 2023-03-18 18:16:42 UTC
Created attachment 858235 [details]
Log of failed build with GCC 12

If I try to build dev-lang/python (3.9, 3.10 or 3.11) with GCC 12, I get a compilation error "error: inlining failed in call to 'always_inline'" in mpdecimal.c.

If I switch back to GCC 11 (with `eselect gcc set 1`) then the build succeeds.
Comment 1 Chris Kerr 2023-03-18 18:17:39 UTC
Created attachment 858237 [details]
Output of `emerge --info` with GCC 12 selected
Comment 2 Chris Kerr 2023-03-18 18:19:27 UTC
Created attachment 858239 [details]
Log of successful build with GCC 11
Comment 3 Chris Kerr 2023-03-18 18:19:49 UTC
Created attachment 858241 [details]
Output of `emerge --info` with GCC 11 selected
Comment 4 Chris Kerr 2023-03-18 18:25:47 UTC
I found a possibly relevant upstream bug at https://github.com/python/cpython/issues/94847
Comment 5 Chris Kerr 2023-03-18 20:11:50 UTC
Following up on the upstream issue, the build succeeds if I remove the debug flags ('-g' etc.) from CFLAGS.
Comment 6 Chris Kerr 2023-03-18 20:31:40 UTC
(In reply to Chris Kerr from comment #5)
> Following up on the upstream issue, the build succeeds if I remove the debug
> flags ('-g' etc.) from CFLAGS.

Interestingly, that is not what was mentioned in the upstream issue. The '--with-pydebug' flag is for changing the preprocessor declarations to enable assertions etc, not for changing the compiler flags to generate debug information, at least according to the documentation.

The upstream issue also says that the problem has been fixed in 3.11, but this is not the case, at least for me.
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-03-19 05:05:51 UTC
That commit should've landed in several of the 3.11 releases so I guess it's just similar and not the same exact issue.

Interestingly, we also had bug 895080.
Comment 8 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2023-03-19 17:00:24 UTC
Is this specific to PPC64?  I've tried building with `-g` on amd64 and it seems to have built fine.
Comment 9 Chris Kerr 2023-03-19 19:53:42 UTC
(In reply to Michał Górny from comment #8)
> Is this specific to PPC64?  I've tried building with `-g` on amd64 and it
> seems to have built fine.

It could be. I don't have an amd64 gentoo machine to test on.
Comment 10 Chris Kerr 2023-03-23 18:36:11 UTC
Created attachment 858757 [details]
Log of failed build of dev-lang/perl

It seems that this is not Python-specific - I got a similar "inlining failed in call to 'always_inline'" error when building dev-lang/perl with `-g` and GCC 12.

The configure script output says that it detects that "always_inline" is supported, but then using it in the code fails.