Skip to content

Commit 2955027

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 363374c commit 2955027

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
@@ -1729,6 +1729,7 @@ Python/interpconfig.o: $(srcdir)/Python/interpconfig.c $(srcdir)/Python/config_c
17291729
Python/dynload_shlib.o: $(srcdir)/Python/dynload_shlib.c Makefile
17301730
$(CC) -c $(PY_CORE_CFLAGS) \
17311731
-DSOABI='"$(SOABI)"' \
1732+
$(MULTIARCH_CPPFLAGS) \
17321733
-o $@ $(srcdir)/Python/dynload_shlib.c
17331734

17341735
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)