Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4bb9b9a

Browse files
authored
[2.7] bpo-32647: Link ctypes extension with libdl. (pythonGH-5550) (python#5877)
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 3d87f4c commit 4bb9b9a

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed
Lines changed: 2 additions & 0 deletions
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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2149,6 +2149,10 @@ def detect_ctypes(self, inc_dirs, lib_dirs):
21492149
ext.libraries.append(ffi_lib)
21502150
self.use_system_libffi = True
21512151

2152+
if sysconfig.get_config_var('HAVE_LIBDL'):
2153+
# for dlopen, see bpo-32647
2154+
ext.libraries.append('dl')
2155+
21522156
def _detect_nis(self, inc_dirs, lib_dirs):
21532157
if host_platform in {'win32', 'cygwin', 'qnx6'}:
21542158
return None

0 commit comments

Comments
 (0)