diff options
author | Sergei Trofimovich <slyfox@gentoo.org> | 2019-05-19 10:15:02 +0100 |
---|---|---|
committer | Sergei Trofimovich <slyfox@gentoo.org> | 2019-05-19 10:15:02 +0100 |
commit | 9ecb3b089082f39a15c4c1a315ed91b388a80ade (patch) | |
tree | bc7836e55bcc5dcaabf538b6aca17818bad72801 | |
parent | sys-libs/glibc: drop obsolete -fno-strict-aliasing, bug #686018 (diff) | |
download | gentoo-9ecb3b089082f39a15c4c1a315ed91b388a80ade.tar.gz gentoo-9ecb3b089082f39a15c4c1a315ed91b388a80ade.tar.bz2 gentoo-9ecb3b089082f39a15c4c1a315ed91b388a80ade.zip |
sys-libs/glibc: add USE=custom-cflags, bug #686018
Allow users to pass in more (or less) aggressive CFLAGS for
USE=custom-cflags case (disabled by default).
Reported-and-tested-by:Jan Fikar
Bug: https://bugs.gentoo.org/686018
Package-Manager: Portage-2.3.66, Repoman-2.3.12
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
-rw-r--r-- | sys-libs/glibc/glibc-9999.ebuild | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/sys-libs/glibc/glibc-9999.ebuild b/sys-libs/glibc/glibc-9999.ebuild index e39fd36b2f08..6d310a66d32c 100644 --- a/sys-libs/glibc/glibc-9999.ebuild +++ b/sys-libs/glibc/glibc-9999.ebuild @@ -35,7 +35,7 @@ PATCH_VER=11 SRC_URI+=" https://dev.gentoo.org/~slyfox/distfiles/${P}-patches-${PATCH_VER}.tar.xz" SRC_URI+=" multilib? ( https://dev.gentoo.org/~dilfridge/distfiles/gcc-multilib-bootstrap-${GCC_BOOTSTRAP_VER}.tar.xz )" -IUSE="audit caps cet compile-locales doc gd headers-only +multiarch multilib nscd profile selinux +ssp +static-libs suid systemtap test vanilla" +IUSE="audit caps cet compile-locales custom-cflags doc gd headers-only +multiarch multilib nscd profile selinux +ssp +static-libs suid systemtap test vanilla" # Minimum kernel version that glibc requires MIN_KERN_VER="3.2.0" @@ -345,11 +345,18 @@ setup_flags() { ASFLAGS_BASE=${ASFLAGS_BASE-${ASFLAGS}} ASFLAGS=${ASFLAGS_BASE} - # Over-zealous CFLAGS can often cause problems. What may work for one - # person may not work for another. To avoid a large influx of bugs - # relating to failed builds, we strip most CFLAGS out to ensure as few - # problems as possible. - strip-flags + # Allow users to explicitly avoid flag sanitization via + # USE=custom-cflags. + if ! use custom-cflags; then + # Over-zealous CFLAGS can often cause problems. What may work for one + # person may not work for another. To avoid a large influx of bugs + # relating to failed builds, we strip most CFLAGS out to ensure as few + # problems as possible. + strip-flags + # Lock glibc at -O2; we want to be conservative here. + filter-flags '-O?' + append-flags -O2 + fi strip-unsupported-flags filter-flags -m32 -m64 '-mabi=*' @@ -371,9 +378,9 @@ setup_flags() { CBUILD_OPT=${CTARGET_OPT} fi - # Lock glibc at -O2; we want to be conservative here. - filter-flags '-O?' - append-flags -O2 + # glibc's headers disallow -O0 and fail at build time: + # include/libc-symbols.h:75:3: #error "glibc cannot be compiled without optimization" + replace-flags -O0 -O1 filter-flags '-fstack-protector*' } |