sys-libs/glibc: pass user's CFLAGS over CC/XX, not CPPFLAGS
authorSergei Trofimovich <slyfox@gentoo.org>
Tue, 26 Jun 2018 07:54:33 +0000 (08:54 +0100)
committerSergei Trofimovich <slyfox@gentoo.org>
Tue, 26 Jun 2018 09:48:14 +0000 (10:48 +0100)
commit3ff56613857700dd0dfe2937539ae13fc3212eb4
tree74c9ab2b8695044f6b43b6ca8003f274923bfca6
parent4c40e28ec5bd29e622deb61d84fc568dfe420376
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
sys-libs/glibc/glibc-2.27-r5.ebuild [new file with mode: 0644]
sys-libs/glibc/glibc-9999.ebuild