From b3cc16dc830a688b3e12271fd34f7dd458e2af43 Mon Sep 17 00:00:00 2001 From: Fedora Python maintainers Date: Wed, 15 Jul 2020 15:42:17 +0200 Subject: 00187-add-RPATH-to-pyexpat.patch 00187 # Add an explicit RPATH to pyexpat.so pointing at the directory containing the system expat (which has the extra XML_SetHashSalt symbol), to avoid an ImportError with a link error if there's an LD_LIBRARY_PATH containing a "vanilla" build of expat (without the symbol) --- setup.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/setup.py b/setup.py index 761efff..b401ab8 100644 --- a/setup.py +++ b/setup.py @@ -1536,12 +1536,21 @@ class PyBuildExt(build_ext): 'expat/xmltok_impl.h' ] + # Add an explicit RPATH to pyexpat.so pointing at the directory + # containing the system expat (which has the extra XML_SetHashSalt + # symbol), to avoid an ImportError with a link error if there's an + # LD_LIBRARY_PATH containing a "vanilla" build of expat (without the + # symbol) (rhbz#833271): + EXPAT_RPATH = '/usr/lib64' if sys.maxint == 0x7fffffffffffffff else '/usr/lib' + + exts.append(Extension('pyexpat', define_macros = define_macros, include_dirs = expat_inc, libraries = expat_lib, sources = ['pyexpat.c'] + expat_sources, depends = expat_depends, + extra_link_args = ['-Wl,-rpath,%s' % EXPAT_RPATH] )) # Fredrik Lundh's cElementTree module. Note that this also -- cgit v0.12