1 |
commit: 5e28abe80540409b3aede4e8a87acf7c74565b03 |
2 |
Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Feb 3 23:37:02 2019 +0000 |
4 |
Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Feb 3 23:39:40 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5e28abe8 |
7 |
|
8 |
toolchain.eclass: never pass --enable-libsanitizer to ./configure |
9 |
|
10 |
gcc treats --enable-libsanitizer as an override on top of |
11 |
autodetection. It it never what we want. Happens to break |
12 |
at least mips cross-compilers and likely many more minor |
13 |
targets. |
14 |
|
15 |
Bug: https://gcc.gnu.org/PR85663 |
16 |
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org> |
17 |
|
18 |
eclass/toolchain.eclass | 19 ++++++++++++++++++- |
19 |
1 file changed, 18 insertions(+), 1 deletion(-) |
20 |
|
21 |
diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass |
22 |
index ea1e1f3c5b6..7e4f8774f3c 100644 |
23 |
--- a/eclass/toolchain.eclass |
24 |
+++ b/eclass/toolchain.eclass |
25 |
@@ -1299,7 +1299,8 @@ toolchain_src_configure() { |
26 |
fi |
27 |
|
28 |
if tc_version_is_at_least 4.8 && in_iuse sanitize ; then |
29 |
- confgcc+=( $(use_enable sanitize libsanitizer) ) |
30 |
+ # See Note [implicitly enabled flags] |
31 |
+ confgcc+=( $(usex sanitize '' --disable-libsanitizer) ) |
32 |
fi |
33 |
|
34 |
if tc_version_is_at_least 6.0 && in_iuse pie ; then |
35 |
@@ -2494,3 +2495,19 @@ toolchain_death_notice() { |
36 |
popd >/dev/null |
37 |
fi |
38 |
} |
39 |
+ |
40 |
+# Note [implicitly enabled flags] |
41 |
+# ------------------------------- |
42 |
+# Usually configure-based packages handle explicit feature requests |
43 |
+# like |
44 |
+# ./configure --enable-foo |
45 |
+# as explicit request to check for suppor of 'foo' and bail out at |
46 |
+# configure time. |
47 |
+# |
48 |
+# GCC does not follow this pattern an instead overrides autodetection |
49 |
+# of the feature and enables it unconditionally. |
50 |
+# See https://gcc.gnu.org/PR85663 |
51 |
+# |
52 |
+# Thus safer way to enable/disable the feature is to rely on implicit |
53 |
+# enabled-by-default state: |
54 |
+# econf $(usex foo '' --disable-foo) |