Summary: | sys-libs/glibc-2.30-r2 USE=custom-cflags appends make.conf CFLAGS to environment CFLAGS | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Klaus Kusche <klaus.kusche> |
Component: | Current packages | Assignee: | Gentoo Toolchain Maintainers <toolchain> |
Status: | RESOLVED INVALID | ||
Severity: | normal | ||
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: |
emerge --info
emerge --info glibc (with -custom-cflags, hence not really relevant) |
Description
Klaus Kusche
2019-11-16 10:48:28 UTC
I don't think glibc does anything special here. CFLAGS should be one variable (well, maybe there is CXXFLAGS as well). It's up to portage to pass final CFLAGS on. Please post your: 1. emerge --info 2. emerge --info sys-libs/glibc 3. relevant /etc/portage/env/ entries 4. relevant /etc/portage/package.env/ files (In reply to Sergei Trofimovich from comment #1) > I don't think glibc does anything special here. CFLAGS should be one > variable (well, maybe there is CXXFLAGS as well). It's up to portage to pass > final CFLAGS on. Please post your: > 1. emerge --info > 2. emerge --info sys-libs/glibc > 3. relevant /etc/portage/env/ entries > 4. relevant /etc/portage/package.env/ files Both emerge --info attached (too long for a comment). emerge-info-glibc is for a build with USE=-custom-cflags, because building with USE=custom-cflags fails. Relevant line in /etc/portage/package.env: sys-libs/glibc debuginfo.conf Contents of /etc/portage/env/debuginfo.conf (I have removed -fno-lto and -fno-use-linker-plugin, because they don't work for glibc, and because they should not be needed at all if only these CFLAGS are used and not those in make.conf): # -flto removed, -ggdb added CFLAGS="-march=native -mtune=native -msahf -O3 -fomit-frame-pointer -fsched-pressure -fgcse-after-reload -flive-range-shrinkage -fweb -ftracer -fivopts -ftree-loop-im -frename-registers -fstdarg-opt -ggdb -maccumulate-outgoing-args -pipe" CXXFLAGS="-march=native -mtune=native -msahf -O3 -fomit-frame-pointer -fsched-pressure -fgcse-after-reload -flive-range-shrinkage -fweb -ftracer -fivopts -ftree-loop-im -frename-registers -fstdarg-opt -ggdb -maccumulate-outgoing-args -pipe" FEATURES="${FEATURES} nostrip" Created attachment 596350 [details]
emerge --info
Created attachment 596352 [details]
emerge --info glibc (with -custom-cflags, hence not really relevant)
In /etc/portage/env/debuginfo.conf you override CFLAGS, CXXFLAGS but not LDFLAGS. Is it on purpose? I don't think it will yield result you seek. If after fixing LDFLAGS you still have a problem please attach the build.log. It should show any misconfiguration in a more clear way. (In reply to Sergei Trofimovich from comment #5) > In /etc/portage/env/debuginfo.conf you override CFLAGS, CXXFLAGS but not > LDFLAGS. Is it on purpose? I don't think it will yield result you seek. No, it's not on purpose, the missing LDFLAGS are a mistake on my side. But it is irrelevant for this bug, because the configure test which fails due to -flto only checks the assembler source generated for a .c file. It does not invoke the linker and does not use LDFLAGS. I will test again and upload the logs. (In reply to Sergei Trofimovich from comment #5) > If after fixing LDFLAGS you still have a problem please attach the > build.log. It should show any misconfiguration in a more clear way. Surprise, with LDFLAGS fixed, the problem is gone: The configure test succeeds, and the whole build succeeds. I double-checked the configure log and tried different flags: My assumption that the flags I see in the configure log are "env CFLAGS" + "make.conf CFLAGS" was wrong. The flags are actually "env CFLAGS" + "env LDFLAGS". I did not expect at all that configure includes the LDFLAGS in its CC variable for a "compile-to-asm-source" test without linking... |