|
| 1 | +From 3f79de7b8411c76a1fcd1ca850ea62500be7a881 Mon Sep 17 00:00:00 2001 |
| 2 | +From: Natanael Copa < [email protected]> |
| 3 | +Date: Sat, 29 Jan 2022 00:02:54 +0100 |
| 4 | +Subject: [PATCH 1/2] bpo-43112: detect musl as a separate SOABI (GH-24502) |
| 5 | +MIME-Version: 1.0 |
| 6 | +Content-Type: text/plain; charset=UTF-8 |
| 7 | +Content-Transfer-Encoding: 8bit |
| 8 | + |
| 9 | +musl libc and gnu libc are not ABI compatible so we need set different |
| 10 | +SOABI for musl and not simply assume that all linux is linux-gnu. |
| 11 | + |
| 12 | +Replace linux-gnu with the detected os for the build from config.guess |
| 13 | +for linux-musl*. |
| 14 | + |
| 15 | +(cherry picked from commit 1f036ede59e2c4befc07714cf76603c591d5c972) |
| 16 | +Signed-off-by: Šimon Bořek < [email protected]> |
| 17 | +--- |
| 18 | + Lib/test/test_sysconfig.py | 8 ++++---- |
| 19 | + .../next/Build/2021-02-10-17-54-04.bpo-43112.H5Lat6.rst | 1 + |
| 20 | + configure | 5 +++++ |
| 21 | + configure.ac | 5 +++++ |
| 22 | + 4 files changed, 15 insertions(+), 4 deletions(-) |
| 23 | + create mode 100644 Misc/NEWS.d/next/Build/2021-02-10-17-54-04.bpo-43112.H5Lat6.rst |
| 24 | + |
| 25 | +--- a/Lib/test/test_sysconfig.py |
| 26 | ++++ b/Lib/test/test_sysconfig.py |
| 27 | +@@ -425,11 +425,11 @@ class TestSysConfig(unittest.TestCase): |
| 28 | + self.assertTrue('linux' in suffix, suffix) |
| 29 | + if re.match('(i[3-6]86|x86_64)$', machine): |
| 30 | + if ctypes.sizeof(ctypes.c_char_p()) == 4: |
| 31 | +- self.assertTrue(suffix.endswith('i386-linux-gnu.so') or |
| 32 | +- suffix.endswith('x86_64-linux-gnux32.so'), |
| 33 | +- suffix) |
| 34 | ++ expected_suffixes = 'i386-linux-gnu.so', 'x86_64-linux-gnux32.so', 'i386-linux-musl.so' |
| 35 | + else: # 8 byte pointer size |
| 36 | +- self.assertTrue(suffix.endswith('x86_64-linux-gnu.so'), suffix) |
| 37 | ++ expected_suffixes = 'x86_64-linux-gnu.so', 'x86_64-linux-musl.so' |
| 38 | ++ self.assertTrue(suffix.endswith(expected_suffixes), |
| 39 | ++ f'unexpected suffix {suffix!r}') |
| 40 | + |
| 41 | + @unittest.skipUnless(sys.platform == 'darwin', 'OS X-specific test') |
| 42 | + def test_osx_ext_suffix(self): |
| 43 | +--- /dev/null |
| 44 | ++++ b/Misc/NEWS.d/next/Build/2021-02-10-17-54-04.bpo-43112.H5Lat6.rst |
| 45 | +@@ -0,0 +1 @@ |
| 46 | ++Detect musl libc as a separate SOABI (tagged as ``linux-musl``). |
| 47 | +\ No newline at end of file |
| 48 | +--- a/configure |
| 49 | ++++ b/configure |
| 50 | +@@ -5376,6 +5376,11 @@ EOF |
| 51 | + |
| 52 | + if $CPP $CPPFLAGS conftest.c >conftest.out 2>/dev/null; then |
| 53 | + PLATFORM_TRIPLET=`grep -v '^#' conftest.out | grep -v '^ *$' | tr -d ' '` |
| 54 | ++ case "$build_os" in |
| 55 | ++ linux-musl*) |
| 56 | ++ PLATFORM_TRIPLET=`echo "$PLATFORM_TRIPLET" | sed 's/linux-gnu/linux-musl/'` |
| 57 | ++ ;; |
| 58 | ++ esac |
| 59 | + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PLATFORM_TRIPLET" >&5 |
| 60 | + $as_echo "$PLATFORM_TRIPLET" >&6; } |
| 61 | + else |
| 62 | +--- a/configure.ac |
| 63 | ++++ b/configure.ac |
| 64 | +@@ -866,6 +866,11 @@ EOF |
| 65 | + |
| 66 | + if $CPP $CPPFLAGS conftest.c >conftest.out 2>/dev/null; then |
| 67 | + PLATFORM_TRIPLET=`grep -v '^#' conftest.out | grep -v '^ *$' | tr -d ' '` |
| 68 | ++ case "$build_os" in |
| 69 | ++ linux-musl*) |
| 70 | ++ PLATFORM_TRIPLET=`echo "$PLATFORM_TRIPLET" | sed 's/linux-gnu/linux-musl/'` |
| 71 | ++ ;; |
| 72 | ++ esac |
| 73 | + AC_MSG_RESULT([$PLATFORM_TRIPLET]) |
| 74 | + else |
| 75 | + AC_MSG_RESULT([none]) |
0 commit comments