Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Can't compile sys-libs/glibc with gcc-lto
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
Goverp
Advocate
Advocate


Joined: 07 Mar 2007
Posts: 2242

PostPosted: Thu Apr 10, 2025 1:20 pm    Post subject: Can't compile sys-libs/glibc with gcc-lto Reply with quote

As per subject, I can't compile syslibs-glibc-2.40-r8 using gcc set up for LTO. The ebuild bombs out during the configuration tests, complaining that the compiler is too old.
Looking at it, the test uses __GNUC__ variables that appear to be checking against 6.6, and of course my gcc is much newer: sys-devel/gcc-14.2.1_p20241221
Any thoughts on why it's screwing up?

Of course, I'm bypassing it by removing the LTO-ness. It compiled happily,
_________________
Greybeard
Back to top
View user's profile Send private message
sam_
Developer
Developer


Joined: 14 Aug 2020
Posts: 2290

PostPosted: Thu Apr 10, 2025 2:15 pm    Post subject: Reply with quote

The ebuild tries to filter out LTO, as glibc doesn't support being built with it yet. It does that successfully for me and others.

It isn't for you -- can you show the build.log, emerge --info, and config.log to figure out why?
Back to top
View user's profile Send private message
Goverp
Advocate
Advocate


Joined: 07 Mar 2007
Posts: 2242

PostPosted: Fri Apr 11, 2025 12:56 pm    Post subject: Reply with quote

Sam, I've put the requested files on wgetpaste.
https://paste.gentoo.zip/QDJcsvPg

Sorry, I gave it all three files as arguments; assumed I'd get three files on paste.gentoo.zip, but it ran them all together.

Hope that helps. If not, I'm not too bothered as I can just remove the packages.env file entry that tried to turn LTO on.
_________________
Greybeard
Back to top
View user's profile Send private message
sam_
Developer
Developer


Joined: 14 Aug 2020
Posts: 2290

PostPosted: Fri Apr 11, 2025 2:04 pm    Post subject: Reply with quote

Thanks!

Here's the problem:
Quote:

configure:5741: checking if gcc -m32 -mfpmath=sse -mstackrealign -march=bdver4 -mtune=znver3 -mno-fma4 -mno-lwp -mno-tbm -mno-xop -O2 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing -fuse-ld=mold -Wl,--as-needed -fuse-ld=bfd is sufficient to build libc
configure:5762: clang-cpp -m32 -mfpmath=sse -mstackrealign -march=bdver4 -mtune=znver3 -mno-fma4 -mno-lwp -mno-tbm -mno-xop -O2 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing conftest.c
warning: unknown warning option '-Werror=lto-type-mismatch'; did you mean '-Werror=selector-type-mismatch'? [-Wunknown-warning-option]
conftest.c:20:2: error: insufficient compiler
20 | #error insufficient compiler
| ^


Note that it uses 'clang-cpp', and Clang doesn't know -Werror=lto-type-mismatch. You seem to have CPP set to clang-cpp but the other toolchain components used here are GCC. Could you try unsetting that?
Back to top
View user's profile Send private message
Goverp
Advocate
Advocate


Joined: 07 Mar 2007
Posts: 2242

PostPosted: Sat Apr 12, 2025 10:40 am    Post subject: Reply with quote

sam_ wrote:
...
Note that it uses 'clang-cpp', and Clang doesn't know -Werror=lto-type-mismatch. You seem to have CPP set to clang-cpp but the other toolchain components used here are GCC. Could you try unsetting that?

Many thanks, I doubt I'd have spotted that in amongst all the noise. My bad, it's set in make.conf, and not reset in my gcc /etc/portage/env overrides. I'm amazed it hasn't broken more things!
_________________
Greybeard
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum