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`
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.
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.
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"
21 Co-authored-by: Pali Rohár <pali@kernel.org>
22 Signed-off-by: Šimon Bořek <simon.borek@nic.cz>
26 2 files changed, 2 insertions(+), 2 deletions(-)
30 @@ -6186,7 +6186,7 @@ EOF
32 if $CPP $CPPFLAGS conftest.c >conftest.out 2>/dev/null; then
33 PLATFORM_TRIPLET=`grep -v '^#' conftest.out | grep -v '^ *$' | tr -d ' '`
37 PLATFORM_TRIPLET=`echo "$PLATFORM_TRIPLET" | sed 's/linux-gnu/linux-musl/'`
41 @@ -1081,7 +1081,7 @@ EOF
43 if $CPP $CPPFLAGS conftest.c >conftest.out 2>/dev/null; then
44 PLATFORM_TRIPLET=`grep -v '^#' conftest.out | grep -v '^ *$' | tr -d ' '`
48 PLATFORM_TRIPLET=`echo "$PLATFORM_TRIPLET" | sed 's/linux-gnu/linux-musl/'`