summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Trofimovich <slyfox@gentoo.org>2019-11-17 10:41:08 +0000
committerSergei Trofimovich <slyfox@gentoo.org>2019-11-17 10:42:00 +0000
commit525bc6c0fef5bc316812df10a93dceafdfe25e16 (patch)
tree27a3ec5af3c11fe7ec5d267e5f51400f3c819dbd /sys-libs
parentmedia-libs/mlt: Conditionalise python_fix_shebang (diff)
downloadgentoo-525bc6c0fef5bc316812df10a93dceafdfe25e16.tar.gz
gentoo-525bc6c0fef5bc316812df10a93dceafdfe25e16.tar.bz2
gentoo-525bc6c0fef5bc316812df10a93dceafdfe25e16.zip
sys-libs/glibc: mangle bad -march= only for ABI=x86
Normally setup_target_flags() attempts to guard against too conservative (or missing) -march= value by chacking if sync primitives can be compiled. If it can't be compiled glibc assumes -march= value to be too low. Unfortunately, test always runs against 32-bit ABI without checking if current ABI is actually 32-bit. This causes the test mis-fire on USE=-multilib ARCH=amd64 systems. Sweep workaround under ABI=x86 case. Reported-by: Klaus Kusche Closes: https://bugs.gentoo.org/700232 Package-Manager: Portage-2.3.79, Repoman-2.3.18 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Diffstat (limited to 'sys-libs')
-rw-r--r--sys-libs/glibc/glibc-2.30-r2.ebuild5
-rw-r--r--sys-libs/glibc/glibc-9999.ebuild5
2 files changed, 4 insertions, 6 deletions
diff --git a/sys-libs/glibc/glibc-2.30-r2.ebuild b/sys-libs/glibc/glibc-2.30-r2.ebuild
index 910396913f25..21a2145abdd5 100644
--- a/sys-libs/glibc/glibc-2.30-r2.ebuild
+++ b/sys-libs/glibc/glibc-2.30-r2.ebuild
@@ -256,9 +256,8 @@ setup_target_flags() {
;;
amd64)
# -march needed for #185404 #199334
- # Note: This test only matters when the x86 ABI is enabled, so we could
- # optimize a bit and elide it.
# TODO: See cross-compile issues listed above for x86.
+ [[ ${ABI} == x86 ]] &&
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
local t=${CTARGET_OPT:-${CTARGET}}
t=${t%%-*}
@@ -269,7 +268,7 @@ setup_target_flags() {
# ugly, ugly, ugly. ugly.
CFLAGS_x86=$(CFLAGS=${CFLAGS_x86} filter-flags '-march=*'; echo "${CFLAGS}")
export CFLAGS_x86="${CFLAGS_x86} -march=${t}"
- einfo "Auto adding -march=${t} to CFLAGS_x86 #185404"
+ einfo "Auto adding -march=${t} to CFLAGS_x86 #185404 (ABI=${ABI})"
fi
;;
mips)
diff --git a/sys-libs/glibc/glibc-9999.ebuild b/sys-libs/glibc/glibc-9999.ebuild
index f1b57d70806c..4ddf0a273219 100644
--- a/sys-libs/glibc/glibc-9999.ebuild
+++ b/sys-libs/glibc/glibc-9999.ebuild
@@ -257,9 +257,8 @@ setup_target_flags() {
;;
amd64)
# -march needed for #185404 #199334
- # Note: This test only matters when the x86 ABI is enabled, so we could
- # optimize a bit and elide it.
# TODO: See cross-compile issues listed above for x86.
+ [[ ${ABI} == x86 ]] &&
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
local t=${CTARGET_OPT:-${CTARGET}}
t=${t%%-*}
@@ -270,7 +269,7 @@ setup_target_flags() {
# ugly, ugly, ugly. ugly.
CFLAGS_x86=$(CFLAGS=${CFLAGS_x86} filter-flags '-march=*'; echo "${CFLAGS}")
export CFLAGS_x86="${CFLAGS_x86} -march=${t}"
- einfo "Auto adding -march=${t} to CFLAGS_x86 #185404"
+ einfo "Auto adding -march=${t} to CFLAGS_x86 #185404 (ABI=${ABI})"
fi
;;
mips)