Skip to content

Commit 3e4b3b4

Browse files
committed
gh-122917 Allow stable API extensions to include a multiarch tuple in the filename
This permits stable ABI extensions for multiple architectures to be co-installed into the same directory, without clashing with each other, the same way (non-stable ABI) regular extensions can. It is listed below the current .abi3 suffix because setuptools will select the first suffix containing .abi3, as the target filename. We do this to protect older Python versions predating this patch.
1 parent e163e8d commit 3e4b3b4

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

Makefile.pre.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1803,6 +1803,7 @@ Python/interpconfig.o: $(srcdir)/Python/interpconfig.c $(srcdir)/Python/config_c
18031803
Python/dynload_shlib.o: $(srcdir)/Python/dynload_shlib.c Makefile
18041804
$(CC) -c $(PY_CORE_CFLAGS) \
18051805
-DSOABI='"$(SOABI)"' \
1806+
$(MULTIARCH_CPPFLAGS) \
18061807
-o $@ $(srcdir)/Python/dynload_shlib.c
18071808

18081809
Python/dynload_hpux.o: $(srcdir)/Python/dynload_hpux.c Makefile
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Allow importing stable ABI C extensions that include a multiarch tuple
2+
in their filename, e.g. ``foo.abi3-x86-64-linux-gnu.so``.

Python/dynload_shlib.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ const char *_PyImport_DynLoadFiletab[] = {
4343
"." ALT_SOABI ".so",
4444
#endif
4545
".abi" PYTHON_ABI_STRING ".so",
46+
#ifdef MULTIARCH
47+
".abi" PYTHON_ABI_STRING "-" MULTIARCH ".so",
48+
#endif
4649
".so",
4750
#endif /* __CYGWIN__ */
4851
NULL,

0 commit comments

Comments
 (0)