Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Doc/c-api/stable.rst
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ On Windows, extensions that use the Stable ABI should be linked against
``python39.dll``.

On some platforms, Python will look for and load shared library files named
with the ``abi3`` tag (e.g. ``mymodule.abi3.so``).
with the ``abi3`` tag (e.g. ``mymodule.abi3.so`` or
``mymodule.abi3-x86-64-linux-gnu.so``).
It does not check if such extensions conform to a Stable ABI.
The user (or their packaging tools) need to ensure that, for example,
extensions built with the 3.10+ Limited API are not installed for lower
Expand Down
8 changes: 8 additions & 0 deletions Doc/whatsnew/3.15.rst
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,14 @@ Other language changes
not only integers or floats, although this does not improve precision.
(Contributed by Serhiy Storchaka in :gh:`67795`.)

* Stable ABI extensions may now include a multiarch tuple in the
filename, e.g. ``foo.abi3-x86-64-linux-gnu.so``.
This permits stable ABI extensions for multiple architectures to be
co-installed into the same directory, without clashing with each
other, as regular dynamic extensions do. Build tools will not generate
these multiarch tagged filenames, by default, while still supporting
older Python versions that don't recognize these filenames.
(Contributed by Stefano Rivera in :gh:`122931`.)

New modules
===========
Expand Down
1 change: 1 addition & 0 deletions Makefile.pre.in
Original file line number Diff line number Diff line change
Expand Up @@ -1958,6 +1958,7 @@ Python/interpconfig.o: $(srcdir)/Python/interpconfig.c $(srcdir)/Python/config_c
Python/dynload_shlib.o: $(srcdir)/Python/dynload_shlib.c Makefile
$(CC) -c $(PY_CORE_CFLAGS) \
-DSOABI='"$(SOABI)"' \
$(MULTIARCH_CPPFLAGS) \
-o $@ $(srcdir)/Python/dynload_shlib.c

Python/dynload_hpux.o: $(srcdir)/Python/dynload_hpux.c Makefile
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Allow importing stable ABI C extensions that include a multiarch tuple
in their filename, e.g. ``foo.abi3-x86-64-linux-gnu.so``.
3 changes: 3 additions & 0 deletions Python/dynload_shlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ const char *_PyImport_DynLoadFiletab[] = {
"." ALT_SOABI ".so",
#endif
".abi" PYTHON_ABI_STRING ".so",
#ifdef MULTIARCH
".abi" PYTHON_ABI_STRING "-" MULTIARCH ".so",
#endif
".so",
#endif /* __CYGWIN__ */
NULL,
Expand Down
Loading