python3: Update to 3.11.3, refresh/redo patches
[feed/packages.git] / lang / python / python3 / patches / 131-configure_ac-switch-PLATFORM_TRIPLET-suffix-to-musl.patch
1 From 15d512cc35106392ed7583d0e000d9a1b865f1e1 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?=C5=A0imon=20Bo=C5=99ek?= <simon.borek@nic.cz>
3 Date: Mon, 27 Jun 2022 13:53:37 +0200
4 Subject: [PATCH 2/2] configure.ac: switch PLATFORM_TRIPLET suffix to '-musl'
5 based on `host_os` instead of `build_os`
6
7 As `build_os` and `host_os` are results of autoconf's `AC_CANONICAL_BUILD`
8 and `AC_CANONICAL_HOST` macros[^1], the former refers to the system running the build
9 and the latter to the system that will run the compiled program.
10
11 `PLATFORM_TRIPLET` should refer to the target platform when cross-compiling.
12 Its libc related part should be therefore derived from the target platform as well
13 - which is currently not the case - `PLATFORM_TRIPLET` '-gnu' suffix is/isn't switched to '-musl'
14 based on `build-os` rather than `host-os` which leads to error message[^2]
15 and build failure when compiling Python on glibc system for musl target.
16
17 [^1]: https://www.gnu.org/software/autoconf/manual/autoconf-2.68/html_node/Canonicalizing.html ,
18 https://www.gnu.org/software/autoconf/manual/autoconf-2.68/html_node/Specifying-Target-Triplets.html
19 [^2]: "internal configure error for the platform triplet, please file a bug report"
20
21 Co-authored-by: Pali Rohár <pali@kernel.org>
22 Signed-off-by: Šimon Bořek <simon.borek@nic.cz>
23 ---
24 configure | 2 +-
25 configure.ac | 2 +-
26 2 files changed, 2 insertions(+), 2 deletions(-)
27
28 --- a/configure
29 +++ b/configure
30 @@ -6186,7 +6186,7 @@ EOF
31
32 if $CPP $CPPFLAGS conftest.c >conftest.out 2>/dev/null; then
33 PLATFORM_TRIPLET=`grep -v '^#' conftest.out | grep -v '^ *$' | tr -d ' '`
34 - case "$build_os" in
35 + case "$host_os" in
36 linux-musl*)
37 PLATFORM_TRIPLET=`echo "$PLATFORM_TRIPLET" | sed 's/linux-gnu/linux-musl/'`
38 ;;
39 --- a/configure.ac
40 +++ b/configure.ac
41 @@ -1081,7 +1081,7 @@ EOF
42
43 if $CPP $CPPFLAGS conftest.c >conftest.out 2>/dev/null; then
44 PLATFORM_TRIPLET=`grep -v '^#' conftest.out | grep -v '^ *$' | tr -d ' '`
45 - case "$build_os" in
46 + case "$host_os" in
47 linux-musl*)
48 PLATFORM_TRIPLET=`echo "$PLATFORM_TRIPLET" | sed 's/linux-gnu/linux-musl/'`
49 ;;