summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFedora Python maintainers <python-devel@lists.fedoraproject.org>2020-07-15 15:42:17 +0200
committerPetr Viktorin <pviktori@redhat.com>2020-09-29 15:59:05 +0200
commitb3cc16dc830a688b3e12271fd34f7dd458e2af43 (patch)
tree35a4b943e4794c0bf414b7b396b4070fb60b5c49
parentc1d2c7c30997babf718f3fcca688e07a7ce86c18 (diff)
downloadcpython-git-b3cc16dc830a688b3e12271fd34f7dd458e2af43.tar.gz
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)
-rw-r--r--setup.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/setup.py b/setup.py
index 761efff449..b401ab836a 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