c8ca20
diff -r e8b8279ca118 setup.py
c8ca20
--- a/setup.py	Sun Jul 21 21:57:52 2013 -0400
c8ca20
+++ b/setup.py	Tue Aug 20 09:45:31 2013 +0200
c8ca20
@@ -1480,12 +1480,21 @@
c8ca20
                              'expat/xmltok_impl.h'
c8ca20
                              ]
c8ca20
 
c8ca20
+        # Add an explicit RPATH to pyexpat.so pointing at the directory
c8ca20
+        # containing the system expat (which has the extra XML_SetHashSalt
c8ca20
+        # symbol), to avoid an ImportError with a link error if there's an
c8ca20
+        # LD_LIBRARY_PATH containing a "vanilla" build of expat (without the
c8ca20
+        # symbol) (rhbz#833271):
c8ca20
+        EXPAT_RPATH = '/usr/lib64' if sys.maxint == 0x7fffffffffffffff else '/usr/lib'
c8ca20
+
c8ca20
+
c8ca20
         exts.append(Extension('pyexpat',
c8ca20
                               define_macros = define_macros,
c8ca20
                               include_dirs = expat_inc,
c8ca20
                               libraries = expat_lib,
c8ca20
                               sources = ['pyexpat.c'] + expat_sources,
c8ca20
                               depends = expat_depends,
c8ca20
+                              extra_link_args = ['-Wl,-rpath,%s' % EXPAT_RPATH]
c8ca20
                               ))
c8ca20
 
c8ca20
         # Fredrik Lundh's cElementTree module.  Note that this also