Skip to content

Commit 64f4e16

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 5518c2a commit 64f4e16

3 files changed

Lines changed: 6 additions & 0 deletions

File tree

Makefile.pre.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1817,6 +1817,7 @@ Python/interpconfig.o: $(srcdir)/Python/interpconfig.c $(srcdir)/Python/config_c
18171817
Python/dynload_shlib.o: $(srcdir)/Python/dynload_shlib.c Makefile
18181818
$(CC) -c $(PY_CORE_CFLAGS) \
18191819
-DSOABI='"$(SOABI)"' \
1820+
$(MULTIARCH_CPPFLAGS) \
18201821
-o $@ $(srcdir)/Python/dynload_shlib.c
18211822

18221823
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
@@ -45,6 +45,9 @@ const char *_PyImport_DynLoadFiletab[] = {
4545
"." ALT_SOABI ".so",
4646
#endif
4747
".abi" PYTHON_ABI_STRING ".so",
48+
#ifdef MULTIARCH
49+
".abi" PYTHON_ABI_STRING "-" MULTIARCH ".so",
50+
#endif
4851
".so",
4952
#endif /* __CYGWIN__ */
5053
NULL,

0 commit comments

Comments
 (0)