diff options
author | Sergei Trofimovich <slyfox@gentoo.org> | 2018-06-26 08:54:33 +0100 |
---|---|---|
committer | Sergei Trofimovich <slyfox@gentoo.org> | 2018-06-26 10:48:14 +0100 |
commit | 3ff56613857700dd0dfe2937539ae13fc3212eb4 (patch) | |
tree | 74c9ab2b8695044f6b43b6ca8003f274923bfca6 /sys-libs/glibc/glibc-9999.ebuild | |
parent | net-misc/iperf: Old. (diff) | |
download | gentoo-3ff56613857700dd0dfe2937539ae13fc3212eb4.tar.gz gentoo-3ff56613857700dd0dfe2937539ae13fc3212eb4.tar.bz2 gentoo-3ff56613857700dd0dfe2937539ae13fc3212eb4.zip |
sys-libs/glibc: pass user's CFLAGS over CC/XX, not CPPFLAGS
Breakage example (before this change):
# CFLAGS="-O2 -march=core2 -mno-sse4.2" emerge -v1 =glibc-2.27-r4
Here user's CFLAGS were able to override (this bug) glibc's
CFLAGS additions like:
sysdeps/i386/i686/multiarch/Makefile:CFLAGS-strspn-c.c += -msse4
'strspn' was built as 'gcc -msse4 -mno-sse4.2' and failed:
smmintrin.h:631:1: error: inlining failed in call to always_inline
‘_mm_cmpistri’: target specific option mismatch
This happens because we passed user's CFLAGS via CPPFLAGS:
Makerules:COMPILE.c = $(CC) -c $(CFLAGS) $(CPPFLAGS)
To avoid this kind of overrides this change injects user's CFLAGS
into CC/CXX. Above example will use 'gcc -mno-sse4.2 -msse4' order.
Reported-by: Philipp Psurek
Bug: https://bugs.gentoo.org/657760
Closes: https://bugs.gentoo.org/659030
Package-Manager: Portage-2.3.40, Repoman-2.3.9
Diffstat (limited to 'sys-libs/glibc/glibc-9999.ebuild')
-rw-r--r-- | sys-libs/glibc/glibc-9999.ebuild | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/sys-libs/glibc/glibc-9999.ebuild b/sys-libs/glibc/glibc-9999.ebuild index 11e503dd7aad..9417381e1648 100644 --- a/sys-libs/glibc/glibc-9999.ebuild +++ b/sys-libs/glibc/glibc-9999.ebuild @@ -793,20 +793,20 @@ glibc_do_configure() { einfo " $(printf '%15s' ${v}:) ${!v}" done + # CFLAGS can contain ABI-specific flags like -mfpu=neon, see bug #657760 + # To build .S (assembly) files with the same ABI-specific flags + # upstream currently recommends adding CFLAGS to CC/CXX: + # https://sourceware.org/PR23273 + # Note: Passing CFLAGS via CPPFLAGS overrides glibc's arch-specific CFLAGS + # and breaks multiarch support. See 659030#c3 for an example. # The glibc configure script doesn't properly use LDFLAGS all the time. - export CC="$(tc-getCC ${CTARGET}) ${LDFLAGS}" + export CC="$(tc-getCC ${CTARGET}) ${CFLAGS} ${LDFLAGS}" einfo " $(printf '%15s' 'Manual CC:') ${CC}" # Some of the tests are written in C++, so we need to force our multlib abis in, bug 623548 - export CXX="$(tc-getCXX ${CTARGET}) $(get_abi_CFLAGS)" + export CXX="$(tc-getCXX ${CTARGET}) $(get_abi_CFLAGS) ${CFLAGS}" einfo " $(printf '%15s' 'Manual CXX:') ${CXX}" - # CFLAGS can contain ABI-specific flags like -mfpu=neon, see bug #657760 - # To build .S (assembly) files with the same ABI-specific flags - # upstream currently recommends adding CFLAGS to CPPFLAGS: https://sourceware.org/PR23273 - export CPPFLAGS="${CPPFLAGS} ${CFLAGS}" - einfo " $(printf '%15s' 'Manual CPPFLAGS:') ${CPPFLAGS}" - echo local myconf=() |