Skip to content

Commit a7fc6cf

Browse files
committed
unix: remove LIBTOOL_CRUFT from configure
This is dead code and breaks macOS aarch64 -> x86_64 cross-compilation. Closes #150.
1 parent 0963d3c commit a7fc6cf

File tree

2 files changed

+81
-0
lines changed

2 files changed

+81
-0
lines changed

cpython-unix/build-cpython.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,10 @@ else
134134
patch -p1 -i ${ROOT}/patch-xopen-source-ios-legacy.patch
135135
fi
136136

137+
# LIBTOOL_CRUFT is unused and breaks cross-compiling on macOS. Nuke it.
138+
# Submitted upstream at https://github.com/python/cpython/pull/101048.
139+
patch -p1 -i ${ROOT}/patch-configure-remove-libtool-cruft.patch
140+
137141
# Configure nerfs RUNSHARED when cross-compiling, which prevents PGO from running when
138142
# we can in fact run the target binaries (e.g. x86_64 host and i686 target). Undo that.
139143
if [ -n "${CROSS_COMPILING}" ]; then
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
diff --git a/configure.ac b/configure.ac
2+
index 956334a865..d5f4aed476 100644
3+
--- a/configure.ac
4+
+++ b/configure.ac
5+
@@ -2970,72 +2970,6 @@ case $ac_sys_system/$ac_sys_release in
6+
;;
7+
esac
8+
9+
-
10+
-AC_SUBST(LIBTOOL_CRUFT)
11+
-case $ac_sys_system/$ac_sys_release in
12+
- Darwin/@<:@01567@:>@\..*)
13+
- LIBTOOL_CRUFT="-framework System -lcc_dynamic"
14+
- if test "${enable_universalsdk}"; then
15+
- :
16+
- else
17+
- LIBTOOL_CRUFT="${LIBTOOL_CRUFT} -arch_only `/usr/bin/arch`"
18+
- fi
19+
- LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -install_name $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
20+
- LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -compatibility_version $(VERSION) -current_version $(VERSION)';;
21+
- Darwin/*)
22+
- gcc_version=`gcc -dumpversion`
23+
- if test ${gcc_version} '<' 4.0
24+
- then
25+
- LIBTOOL_CRUFT="-lcc_dynamic"
26+
- else
27+
- LIBTOOL_CRUFT=""
28+
- fi
29+
- AC_RUN_IFELSE([AC_LANG_SOURCE([[
30+
- #include <unistd.h>
31+
- int main(int argc, char*argv[])
32+
- {
33+
- if (sizeof(long) == 4) {
34+
- return 0;
35+
- } else {
36+
- return 1;
37+
- }
38+
- }
39+
- ]])],[ac_osx_32bit=yes],[ac_osx_32bit=no],[ac_osx_32bit=yes])
40+
-
41+
- if test "${ac_osx_32bit}" = "yes"; then
42+
- case `/usr/bin/arch` in
43+
- i386)
44+
- MACOSX_DEFAULT_ARCH="i386"
45+
- ;;
46+
- ppc)
47+
- MACOSX_DEFAULT_ARCH="ppc"
48+
- ;;
49+
- *)
50+
- AC_MSG_ERROR([Unexpected output of 'arch' on macOS])
51+
- ;;
52+
- esac
53+
- else
54+
- case `/usr/bin/arch` in
55+
- i386)
56+
- MACOSX_DEFAULT_ARCH="x86_64"
57+
- ;;
58+
- ppc)
59+
- MACOSX_DEFAULT_ARCH="ppc64"
60+
- ;;
61+
- arm64)
62+
- MACOSX_DEFAULT_ARCH="arm64"
63+
- ;;
64+
- *)
65+
- AC_MSG_ERROR([Unexpected output of 'arch' on macOS])
66+
- ;;
67+
- esac
68+
-
69+
- fi
70+
-
71+
- LIBTOOL_CRUFT=$LIBTOOL_CRUFT" -lSystem -lSystemStubs -arch_only ${MACOSX_DEFAULT_ARCH}"
72+
- LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -install_name $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
73+
- LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -compatibility_version $(VERSION) -current_version $(VERSION)';;
74+
-esac
75+
AC_MSG_CHECKING(for --enable-framework)
76+
if test "$enable_framework"
77+
then

0 commit comments

Comments
 (0)