[3.6] bpo-32647: Link ctypes extension with libdl. (GH-5550) (#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 <christian@python.org>
(cherry picked from commit 5bb9692575)

Co-authored-by: Christian Heimes <christian@python.org>
This commit is contained in:
Miss Islington (bot) 2018-02-25 04:07:36 -08:00 committed by Christian Heimes
parent 48707a1baf
commit 192bff4e2d
2 changed files with 6 additions and 0 deletions

View file

@ -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.

View file

@ -2089,6 +2089,10 @@ def detect_ctypes(self, inc_dirs, lib_dirs):
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 = []