]> granicus.if.org Git - python/commitdiff
bpo-32647: Link ctypes extension with libdl. (#5550)
authorChristian Heimes <christian@python.org>
Sun, 25 Feb 2018 09:22:14 +0000 (10:22 +0100)
committerGitHub <noreply@github.com>
Sun, 25 Feb 2018 09:22:14 +0000 (10:22 +0100)
The ctypes module used to depend on indirect linking for dlopen. The shared
extension is now explicitly linked against libdl on platforms with dl.

Signed-off-by: Christian Heimes <christian@python.org>
Misc/NEWS.d/next/Library/2018-02-05-13-31-42.bpo-32647.ktmfR_.rst [new file with mode: 0644]
setup.py

diff --git a/Misc/NEWS.d/next/Library/2018-02-05-13-31-42.bpo-32647.ktmfR_.rst b/Misc/NEWS.d/next/Library/2018-02-05-13-31-42.bpo-32647.ktmfR_.rst
new file mode 100644 (file)
index 0000000..04fc024
--- /dev/null
@@ -0,0 +1,2 @@
+The ctypes module used to depend on indirect linking for dlopen. The shared
+extension is now explicitly linked against libdl on platforms with dl.
index f4f6e4fdb1f059950cec2218f429766611f9053e..8536c350fe3a103189d5d02aac5533d20a5f40d8 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -2005,6 +2005,10 @@ class PyBuildExt(build_ext):
             ext.libraries.append(ffi_lib)
             self.use_system_libffi = True
 
+        if sysconfig.get_config_var('HAVE_LIBDL'):
+            # for dlopen, see bpo-32647
+            ext.libraries.append('dl')
+
     def _decimal_ext(self):
         extra_compile_args = []
         undef_macros = []