summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorSergei Trofimovich <slyfox@gentoo.org>2019-02-03 23:37:02 +0000
committerSergei Trofimovich <slyfox@gentoo.org>2019-02-03 23:39:40 +0000
commit5e28abe80540409b3aede4e8a87acf7c74565b03 (patch)
tree5d99421946c33c6b7e91eb789187028a0e4f2061 /eclass
parenttoolchain.eclass: drop IUSE_DEF array (diff)
downloadgentoo-5e28abe80540409b3aede4e8a87acf7c74565b03.tar.gz
gentoo-5e28abe80540409b3aede4e8a87acf7c74565b03.tar.bz2
gentoo-5e28abe80540409b3aede4e8a87acf7c74565b03.zip
toolchain.eclass: never pass --enable-libsanitizer to ./configure
gcc treats --enable-libsanitizer as an override on top of autodetection. It it never what we want. Happens to break at least mips cross-compilers and likely many more minor targets. Bug: https://gcc.gnu.org/PR85663 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Diffstat (limited to 'eclass')
-rw-r--r--eclass/toolchain.eclass19
1 files changed, 18 insertions, 1 deletions
diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index ea1e1f3c5b65..7e4f8774f3c1 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -1299,7 +1299,8 @@ toolchain_src_configure() {
fi
if tc_version_is_at_least 4.8 && in_iuse sanitize ; then
- confgcc+=( $(use_enable sanitize libsanitizer) )
+ # See Note [implicitly enabled flags]
+ confgcc+=( $(usex sanitize '' --disable-libsanitizer) )
fi
if tc_version_is_at_least 6.0 && in_iuse pie ; then
@@ -2494,3 +2495,19 @@ toolchain_death_notice() {
popd >/dev/null
fi
}
+
+# Note [implicitly enabled flags]
+# -------------------------------
+# Usually configure-based packages handle explicit feature requests
+# like
+# ./configure --enable-foo
+# as explicit request to check for suppor of 'foo' and bail out at
+# configure time.
+#
+# GCC does not follow this pattern an instead overrides autodetection
+# of the feature and enables it unconditionally.
+# See https://gcc.gnu.org/PR85663
+#
+# Thus safer way to enable/disable the feature is to rely on implicit
+# enabled-by-default state:
+# econf $(usex foo '' --disable-foo)