Skip to content

Commit 64595b5

Browse files
committed
More progress, new patches needed.
1 parent 1e38447 commit 64595b5

File tree

5 files changed

+45
-4
lines changed

5 files changed

+45
-4
lines changed

cpython-unix/build-cpython-host.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ pushd "Python-${PYTHON_VERSION}"
3838
# configure. This is reported as https://bugs.python.org/issue45405. We nerf the
3939
# check since we know what we're doing.
4040
if [ "${CC}" = "clang" ]; then
41-
if [ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_9}" ]; then
41+
if [ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_13}" ]; then
42+
patch -p1 -i ${ROOT}/patch-disable-multiarch-13.patch
43+
elif [ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_9}" ]; then
4244
patch -p1 -i ${ROOT}/patch-disable-multiarch.patch
4345
else
4446
patch -p1 -i ${ROOT}/patch-disable-multiarch-legacy.patch

cpython-unix/build-cpython.sh

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,10 @@ cat Makefile.extra
7272
pushd Python-${PYTHON_VERSION}
7373

7474
# configure doesn't support cross-compiling on Apple. Teach it.
75-
if [ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_12}" ]; then
75+
if [ "${PYTHON_MAJMIN_VERSION}" = "3.13" ]; then
76+
# FIXME: new patch may be required
77+
:
78+
elif [ "${PYTHON_MAJMIN_VERSION}" = "3.12" ]; then
7679
patch -p1 -i ${ROOT}/patch-apple-cross-3.12.patch
7780
else
7881
patch -p1 -i ${ROOT}/patch-apple-cross.patch
@@ -105,7 +108,9 @@ fi
105108
# configure. This is reported as https://bugs.python.org/issue45405. We nerf the
106109
# check since we know what we're doing.
107110
if [ "${CC}" = "clang" ]; then
108-
if [ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_9}" ]; then
111+
if [ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_13}" ]; then
112+
patch -p1 -i ${ROOT}/patch-disable-multiarch-13.patch
113+
elif [ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_9}" ]; then
109114
patch -p1 -i ${ROOT}/patch-disable-multiarch.patch
110115
else
111116
patch -p1 -i ${ROOT}/patch-disable-multiarch-legacy.patch
@@ -136,7 +141,11 @@ fi
136141

137142
# The default build rule for the macOS dylib doesn't pick up libraries
138143
# from modules / makesetup. So patch it accordingly.
139-
patch -p1 -i ${ROOT}/patch-macos-link-extension-modules.patch
144+
if [ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_13}" ]; then
145+
patch -p1 -i ${ROOT}/patch-macos-link-extension-modules-13.patch
146+
else
147+
patch -p1 -i ${ROOT}/patch-macos-link-extension-modules.patch
148+
fi
140149

141150
# Also on macOS, the `python` executable is linked against libraries defined by statically
142151
# linked modules. But those libraries should only get linked into libpython, not the

cpython-unix/build.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,7 @@ def build_cpython_host(
435435
support = {
436436
"build-cpython-host.sh",
437437
"patch-disable-multiarch.patch",
438+
"patch-disable-multiarch-13.patch",
438439
"patch-disable-multiarch-legacy.patch",
439440
}
440441
for s in sorted(support):
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
diff -u 13-a/configure.ac 13-b/configure.ac
2+
--- 13-a/configure.ac 2024-05-08 05:21:00.000000000 -0400
3+
+++ 13-b/configure.ac 2024-05-19 07:42:23.294762624 -0400
4+
@@ -1090,12 +1090,7 @@
5+
dnl architecture. PLATFORM_TRIPLET will be a pair or single value for these
6+
dnl platforms.
7+
AC_MSG_CHECKING([for multiarch])
8+
-AS_CASE([$ac_sys_system],
9+
- [Darwin*], [MULTIARCH=""],
10+
- [iOS], [MULTIARCH=""],
11+
- [FreeBSD*], [MULTIARCH=""],
12+
- [MULTIARCH=$($CC --print-multiarch 2>/dev/null)]
13+
-)
14+
+MULTIARCH=
15+
AC_SUBST([MULTIARCH])
16+
17+
if test x$PLATFORM_TRIPLET != x && test x$MULTIARCH != x; then
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
diff -u 13-a/Makefile.pre.in 13-b/Makefile.pre.in
2+
--- 13-a/Makefile.pre.in 2024-05-08 05:21:00.000000000 -0400
3+
+++ 13-b/Makefile.pre.in 2024-05-19 07:55:45.091521909 -0400
4+
@@ -903,7 +903,7 @@
5+
$(BLDSHARED) $(NO_AS_NEEDED) -o $@ -Wl,-h$@ $^
6+
7+
libpython$(LDVERSION).dylib: $(LIBRARY_OBJS)
8+
- $(CC) -dynamiclib $(PY_CORE_LDFLAGS) -undefined dynamic_lookup -Wl,-install_name,$(prefix)/lib/libpython$(LDVERSION).dylib -Wl,-compatibility_version,$(VERSION) -Wl,-current_version,$(VERSION) -o $@ $(LIBRARY_OBJS) $(DTRACE_OBJS) $(SHLIBS) $(LIBC) $(LIBM); \
9+
+ $(CC) -dynamiclib $(PY_CORE_LDFLAGS) -undefined dynamic_lookup -Wl,-install_name,$(prefix)/lib/libpython$(LDVERSION).dylib -Wl,-compatibility_version,$(VERSION) -Wl,-current_version,$(VERSION) -o $@ $(LIBRARY_OBJS) $(DTRACE_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM); \
10+
11+
12+
libpython$(VERSION).sl: $(LIBRARY_OBJS)

0 commit comments

Comments
 (0)