Skip to content
Closed
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
4 changes: 4 additions & 0 deletions Doc/distutils/apiref.rst
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,10 @@ the full reference.
| | simply skip the extension. | |
+------------------------+--------------------------------+---------------------------+

.. versionchanged:: 3.8

On Unix, C extensions are no longer linked to libpython.


.. class:: Distribution

Expand Down
19 changes: 2 additions & 17 deletions Lib/distutils/command/build_ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -713,20 +713,5 @@ def get_libraries(self, ext):
# don't extend ext.libraries, it may be shared with other
# extensions, it is a reference to the original list
return ext.libraries + [pythonlib]
else:
return ext.libraries
elif sys.platform == 'darwin':
# Don't use the default code below
return ext.libraries
elif sys.platform[:3] == 'aix':
# Don't use the default code below
return ext.libraries
else:
from distutils import sysconfig
if sysconfig.get_config_var('Py_ENABLE_SHARED'):
pythonlib = 'python{}.{}{}'.format(
sys.hexversion >> 24, (sys.hexversion >> 16) & 0xff,
sysconfig.get_config_var('ABIFLAGS'))
return ext.libraries + [pythonlib]
else:
return ext.libraries

return ext.libraries
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
On Unix, C extensions are no longer linked to libpython.