Skip to content

Commit 4cb3733

Browse files
miss-islingtontiran
andcommitted
[3.7] bpo-32647: Link ctypes extension with libdl. (GH-5550) (#5874)
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> (cherry picked from commit 5bb9692) Co-authored-by: Christian Heimes <christian@python.org>
1 parent ff7528f commit 4cb3733

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
@@ -2005,6 +2005,10 @@ def detect_ctypes(self, inc_dirs, lib_dirs):
20052005
ext.libraries.append(ffi_lib)
20062006
self.use_system_libffi = True
20072007

2008+
if sysconfig.get_config_var('HAVE_LIBDL'):
2009+
# for dlopen, see bpo-32647
2010+
ext.libraries.append('dl')
2011+
20082012
def _decimal_ext(self):
20092013
extra_compile_args = []
20102014
undef_macros = []

0 commit comments

Comments
 (0)