Message340729
I'm confused between RPATH and RUNPATH which are *different*.
When I configure Python using LDFLAGS="-Wl,-rpath=/opt/py38/lib/" (Python configure and Makefile), Python, libpython, and dynamic libraries ELF of C extensions get a RPATH.
When I use setup.py build_ext -rpath (distutils), dynamic libraries ELF of C extensions get a RUNPATH.
More details below.
--
When I build lxml using patched Fedora Python (/usr/bin/python3), I get:
$ python3 setup.py build_ext --rpath /custom/rpath
...
$ objdump -a -x build/lib.linux-x86_64-3.7/lxml/etree.cpython-37m-x86_64-linux-gnu.so|grep -Ei 'rpath|runpath'
RUNPATH /custom/rpath
Note: when I use patched Fedora Python, "--rpath /usr/lib64" of "python3 setup.py build_ext --rpath /usr/lib64" is ignored: the .so file doesn't have RPATH nor RUNPATH. That's the purpose of the patch.
--
When I built Python using ./configure --prefix /opt/py38 LDFLAGS="-Wl,-rpath=/opt/py38/lib/" --enable-shared, I got:
$ objdump -a -x /opt/py38/bin/python3.8|grep -i rpath
RPATH /opt/py38/lib/
$ objdump -a -x /opt/py38/lib/libpython3.8m.so|grep -i rpath
RPATH /opt/py38/lib/
If I build lxml without an explicit rpath, it inherits the Python rpath:
$ LD_LIBRARY_PATH=/opt/py38/lib ./opt_env/bin/python setup.py build_ext
$ objdump -a -x build/lib.linux-x86_64-3.8/lxml/etree.cpython-38m-x86_64-linux-gnu.so|grep -Ei 'rpath|runpath'
RPATH /opt/py38/lib/
If I build lxml with an explicit rpath, I get:
$ LD_LIBRARY_PATH=/opt/py38/lib ./opt_env/bin/python setup.py build_ext --rpath /custom/rpath
$ objdump -a -x build/lib.linux-x86_64-3.8/lxml/etree.cpython-38m-x86_64-linux-gnu.so|grep -Ei 'rpath|runpath'
RUNPATH /opt/py38/lib/:/custom/rpath |
|
Date |
User |
Action |
Args |
2019-04-23 15:02:44 | vstinner | set | recipients:
+ vstinner, koobs, fweimer, cstratak |
2019-04-23 15:02:44 | vstinner | set | messageid: <1556031764.42.0.296078449901.issue36659@roundup.psfhosted.org> |
2019-04-23 15:02:44 | vstinner | link | issue36659 messages |
2019-04-23 15:02:44 | vstinner | create | |
|