Skip to content

Commit 192bff4

Browse files
miss-islingtontiran
andcommitted
[3.6] bpo-32647: Link ctypes extension with libdl. (pythonGH-5550) (python#5875)
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 <[email protected]> (cherry picked from commit 5bb9692) Co-authored-by: Christian Heimes <[email protected]>
1 parent 48707a1 commit 192bff4

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
The ctypes module used to depend on indirect linking for dlopen. The shared
2+
extension is now explicitly linked against libdl on platforms with dl.

setup.py

+4
Original file line numberDiff line numberDiff line change
@@ -2089,6 +2089,10 @@ def detect_ctypes(self, inc_dirs, lib_dirs):
20892089
ext.libraries.append(ffi_lib)
20902090
self.use_system_libffi = True
20912091

2092+
if sysconfig.get_config_var('HAVE_LIBDL'):
2093+
# for dlopen, see bpo-32647
2094+
ext.libraries.append('dl')
2095+
20922096
def _decimal_ext(self):
20932097
extra_compile_args = []
20942098
undef_macros = []

0 commit comments

Comments
 (0)