1 |
commit: 525bc6c0fef5bc316812df10a93dceafdfe25e16 |
2 |
Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Nov 17 10:41:08 2019 +0000 |
4 |
Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Nov 17 10:42:00 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=525bc6c0 |
7 |
|
8 |
sys-libs/glibc: mangle bad -march= only for ABI=x86 |
9 |
|
10 |
Normally setup_target_flags() attempts to guard against |
11 |
too conservative (or missing) -march= value by chacking |
12 |
if sync primitives can be compiled. If it can't be compiled |
13 |
glibc assumes -march= value to be too low. |
14 |
|
15 |
Unfortunately, test always runs against 32-bit ABI without |
16 |
checking if current ABI is actually 32-bit. This causes |
17 |
the test mis-fire on USE=-multilib ARCH=amd64 systems. |
18 |
|
19 |
Sweep workaround under ABI=x86 case. |
20 |
|
21 |
Reported-by: Klaus Kusche |
22 |
Closes: https://bugs.gentoo.org/700232 |
23 |
Package-Manager: Portage-2.3.79, Repoman-2.3.18 |
24 |
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org> |
25 |
|
26 |
sys-libs/glibc/glibc-2.30-r2.ebuild | 5 ++--- |
27 |
sys-libs/glibc/glibc-9999.ebuild | 5 ++--- |
28 |
2 files changed, 4 insertions(+), 6 deletions(-) |
29 |
|
30 |
diff --git a/sys-libs/glibc/glibc-2.30-r2.ebuild b/sys-libs/glibc/glibc-2.30-r2.ebuild |
31 |
index 910396913f2..21a2145abdd 100644 |
32 |
--- a/sys-libs/glibc/glibc-2.30-r2.ebuild |
33 |
+++ b/sys-libs/glibc/glibc-2.30-r2.ebuild |
34 |
@@ -256,9 +256,8 @@ setup_target_flags() { |
35 |
;; |
36 |
amd64) |
37 |
# -march needed for #185404 #199334 |
38 |
- # Note: This test only matters when the x86 ABI is enabled, so we could |
39 |
- # optimize a bit and elide it. |
40 |
# TODO: See cross-compile issues listed above for x86. |
41 |
+ [[ ${ABI} == x86 ]] && |
42 |
if ! do_compile_test "${CFLAGS_x86}" 'void f(int i, void *p) {if (__sync_fetch_and_add(&i, 1)) f(i, p);}\nint main(){return 0;}\n'; then |
43 |
local t=${CTARGET_OPT:-${CTARGET}} |
44 |
t=${t%%-*} |
45 |
@@ -269,7 +268,7 @@ setup_target_flags() { |
46 |
# ugly, ugly, ugly. ugly. |
47 |
CFLAGS_x86=$(CFLAGS=${CFLAGS_x86} filter-flags '-march=*'; echo "${CFLAGS}") |
48 |
export CFLAGS_x86="${CFLAGS_x86} -march=${t}" |
49 |
- einfo "Auto adding -march=${t} to CFLAGS_x86 #185404" |
50 |
+ einfo "Auto adding -march=${t} to CFLAGS_x86 #185404 (ABI=${ABI})" |
51 |
fi |
52 |
;; |
53 |
mips) |
54 |
|
55 |
diff --git a/sys-libs/glibc/glibc-9999.ebuild b/sys-libs/glibc/glibc-9999.ebuild |
56 |
index f1b57d70806..4ddf0a27321 100644 |
57 |
--- a/sys-libs/glibc/glibc-9999.ebuild |
58 |
+++ b/sys-libs/glibc/glibc-9999.ebuild |
59 |
@@ -257,9 +257,8 @@ setup_target_flags() { |
60 |
;; |
61 |
amd64) |
62 |
# -march needed for #185404 #199334 |
63 |
- # Note: This test only matters when the x86 ABI is enabled, so we could |
64 |
- # optimize a bit and elide it. |
65 |
# TODO: See cross-compile issues listed above for x86. |
66 |
+ [[ ${ABI} == x86 ]] && |
67 |
if ! do_compile_test "${CFLAGS_x86}" 'void f(int i, void *p) {if (__sync_fetch_and_add(&i, 1)) f(i, p);}\nint main(){return 0;}\n'; then |
68 |
local t=${CTARGET_OPT:-${CTARGET}} |
69 |
t=${t%%-*} |
70 |
@@ -270,7 +269,7 @@ setup_target_flags() { |
71 |
# ugly, ugly, ugly. ugly. |
72 |
CFLAGS_x86=$(CFLAGS=${CFLAGS_x86} filter-flags '-march=*'; echo "${CFLAGS}") |
73 |
export CFLAGS_x86="${CFLAGS_x86} -march=${t}" |
74 |
- einfo "Auto adding -march=${t} to CFLAGS_x86 #185404" |
75 |
+ einfo "Auto adding -march=${t} to CFLAGS_x86 #185404 (ABI=${ABI})" |
76 |
fi |
77 |
;; |
78 |
mips) |