aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2022-09-09 09:51:42 +0200
committerMichał Górny <mgorny@gentoo.org>2024-06-07 02:59:25 +0200
commit8f32f635a3c96d38cbc8262fc0902ad82f274f0f (patch)
tree018ce3d1e7deae11a96031bbc7bb4ca19cfbe84a
parentSkip sched/priority tests (diff)
downloadcpython-8f32f635a3c96d38cbc8262fc0902ad82f274f0f.tar.gz
cpython-8f32f635a3c96d38cbc8262fc0902ad82f274f0f.tar.bz2
cpython-8f32f635a3c96d38cbc8262fc0902ad82f274f0f.zip
Workaround clang+musl build failure
The current configure code detects musl and sets an appropriate suffix correctly but afterwards verifies that the detection result matches whatever --print-multiarch prints. Unfortunately, the current Clang releases incorrectly report linux-gnu on musl, causing the safety check to fail. Until upstreams sort that out, just nuke the multiarch check on musl target. Bug: https://bugs.gentoo.org/862888
-rw-r--r--configure.ac20
1 files changed, 11 insertions, 9 deletions
diff --git a/configure.ac b/configure.ac
index 8a32cb58f4e..0a05d0d541b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1106,11 +1106,22 @@ cat > conftest.c <<EOF
EOF
+AC_MSG_CHECKING([for multiarch])
+AS_CASE([$ac_sys_system],
+ [Darwin*], [MULTIARCH=""],
+ [FreeBSD*], [MULTIARCH=""],
+ [MULTIARCH=$($CC --print-multiarch 2>/dev/null)]
+)
+AC_SUBST([MULTIARCH])
+AC_MSG_RESULT([$MULTIARCH])
+
if $CPP $CPPFLAGS conftest.c >conftest.out 2>/dev/null; then
PLATFORM_TRIPLET=`grep -v '^#' conftest.out | grep -v '^ *$' | tr -d ' '`
case "$build_os" in
linux-musl*)
PLATFORM_TRIPLET=`echo "$PLATFORM_TRIPLET" | sed 's/linux-gnu/linux-musl/'`
+ # Gentoo hack: clang reports wrong MULTIARCH value for musl
+ MULTIARCH=
;;
esac
AC_MSG_RESULT([$PLATFORM_TRIPLET])
@@ -1119,15 +1130,6 @@ else
fi
rm -f conftest.c conftest.out
-AC_MSG_CHECKING([for multiarch])
-AS_CASE([$ac_sys_system],
- [Darwin*], [MULTIARCH=""],
- [FreeBSD*], [MULTIARCH=""],
- [MULTIARCH=$($CC --print-multiarch 2>/dev/null)]
-)
-AC_SUBST([MULTIARCH])
-AC_MSG_RESULT([$MULTIARCH])
-
if test x$PLATFORM_TRIPLET != x && test x$MULTIARCH != x; then
if test x$PLATFORM_TRIPLET != x$MULTIARCH; then
AC_MSG_ERROR([internal configure error for the platform triplet, please file a bug report])