[issue36659] distutils UnixCCompiler: Remove standard library path from rpath

2019-04-25 Thread STINNER Victor
STINNER Victor added the comment: I discussed the "rpath question" with different people. At the end, I think that the Fedora patch is "temporary fix" which we kept for way too long :-) We should remove this patch and ensure that upstream C extensions respect our rpath policy (Debian, OpenSus

[issue36659] distutils UnixCCompiler: Remove standard library path from rpath

2019-04-24 Thread Matej Cepl
Matej Cepl added the comment: OK, vstinner asked me for more explanation: * we at openSUSE are as opposed to rpath as Fedora developers (actually, https://en.opensuse.org/openSUSE:Packaging_checks#Beware_of_Rpath is stolen from Fedora wiki, apparently) * none of Python packages (python2,

[issue36659] distutils UnixCCompiler: Remove standard library path from rpath

2019-04-24 Thread Matej Cepl
Matej Cepl added the comment: Just to add my CZK 0.02 (or €0,0008 ;)). We don't have this patch in openSUSE Python packages, we run rpmlint on all submissions to our build system (so unwanted rpath shouldn't sneak into the distribution), and yet the only Python C extension which needs RPATH m

[issue36659] distutils UnixCCompiler: Remove standard library path from rpath

2019-04-23 Thread STINNER Victor
STINNER Victor added the comment: To come back to RPATH vs RUNPATH: these 2 are very different in term of priorities in search (see other comments). distutils uses an heuristic to opt-in for RUNPATH using GNU ld --enable-new-dtags option. This option is only used if the following 3 conditio

[issue36659] distutils UnixCCompiler: Remove standard library path from rpath

2019-04-23 Thread STINNER Victor
STINNER Victor added the comment: Ratione from my colleague Carlos O'Donell: "The intent of this patch is to remove the default search paths of the dynamic loader from DT_RPATH/DT_RUNPATH. This allows the default system paths to be searched last as is expected by most programs, and enables LD

[issue36659] distutils UnixCCompiler: Remove standard library path from rpath

2019-04-23 Thread STINNER Victor
STINNER Victor added the comment: In 2015, Robert Kuska proposed to remove the patch from Fedora: "This check should be covered by rpmlint which MUST be run during the review so I propose to drop this patch." https://bugzilla.redhat.com/show_bug.cgi?id=1287566#c1 But Toshio Ernie Kuratomi exp

[issue36659] distutils UnixCCompiler: Remove standard library path from rpath

2019-04-23 Thread STINNER Victor
STINNER Victor added the comment: 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 bu

[issue36659] distutils UnixCCompiler: Remove standard library path from rpath

2019-04-23 Thread Charalampos Stratakis
Change by Charalampos Stratakis : -- nosy: +cstratak ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://

[issue36659] distutils UnixCCompiler: Remove standard library path from rpath

2019-04-23 Thread STINNER Victor
STINNER Victor added the comment: > Since 2010, the Fedora packages of Python are using a patch on distutils > UnixCCompiler to remove standard library path from rpath. The patch has been > written by David Malcolm for Python 2.6.4: > https://src.fedoraproject.org/rpms/python2/c/f5df1f834310

[issue36659] distutils UnixCCompiler: Remove standard library path from rpath

2019-04-23 Thread Florian Weimer
Florian Weimer added the comment: Note that linking with -Wl,-rpath,/usr/lib64 (even if it's redundant) disables part of the ld.so cache on Linux. Instead, paths under /usr/lib64 are probed explicitly. This can add quite a few failing open/openat system calls to the process startup. -

[issue36659] distutils UnixCCompiler: Remove standard library path from rpath

2019-04-23 Thread Florian Weimer
Change by Florian Weimer : -- nosy: +fweimer ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyt

[issue36659] distutils UnixCCompiler: Remove standard library path from rpath

2019-04-23 Thread Kubilay Kocak
Change by Kubilay Kocak : -- nosy: +koobs ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python

[issue36659] distutils UnixCCompiler: Remove standard library path from rpath

2019-04-23 Thread STINNER Victor
STINNER Victor added the comment: My understanding of Fedora 1-rpath.patch is that it ignores -rpath PATH option passed to the setup.py bdist command if PATH is equal to Python sysconfig LIBDIR variable. So it impacts how third party C extensions are built. On my Fedora, LIBDIR is set to

[issue36659] distutils UnixCCompiler: Remove standard library path from rpath

2019-04-23 Thread STINNER Victor
STINNER Victor added the comment: See also bpo-445902 which modified distutils to use "-Wl,-R " rather than "-R ". -- ___ Python tracker ___ _

[issue36659] distutils UnixCCompiler: Remove standard library path from rpath

2019-04-23 Thread STINNER Victor
STINNER Victor added the comment: I'm also confused by the diversity of ways to declare runtime paths. I found these linker flags related to rpath: * -rpath=PATH * -rpath-link=PATH * -R FILENAME, --just-symbols=FILENAME: "Read symbol names and their addresses from FILENAME, (...). For compat

[issue36659] distutils UnixCCompiler: Remove standard library path from rpath

2019-04-23 Thread STINNER Victor
STINNER Victor added the comment: > ... Now, I'm confused. Is PR 12876 useless? Was distutils already fixed? My test was wrong, objdump sometimes uses "RUNPATH", sometimes "RPATH": $ objdump -a -x build/lib.linux-x86_64-*/lxml/etree.cpython-*-x86_64-linux-gnu.so|grep -i -E 'rpath|RUNPATH'

[issue36659] distutils UnixCCompiler: Remove standard library path from rpath

2019-04-18 Thread STINNER Victor
STINNER Victor added the comment: Another test, without my PR 12876. Python compiled without RPATH: $ ./configure --prefix=/opt/py38 $ make $ make install $ /opt/py38/bin/python3.8 -m sysconfig|grep LIBDIR LIBDIR = "/opt/py38/lib" Build lxml manually using "setup.py build_ext --rpath

[issue36659] distutils UnixCCompiler: Remove standard library path from rpath

2019-04-18 Thread STINNER Victor
STINNER Victor added the comment: My colleague Miro Hrončok points me to: https://docs.fedoraproject.org/en-US/packaging-guidelines/#_beware_of_rpath "Any rpath flagged by check-rpaths MUST be removed." Note: On Linux, "chrpath" tool can be used to read, modify or remove the RPATH of an ELF b

[issue36659] distutils UnixCCompiler: Remove standard library path from rpath

2019-04-18 Thread STINNER Victor
Change by STINNER Victor : -- keywords: +patch pull_requests: +12801 stage: -> patch review ___ Python tracker ___ ___ Python-bugs-

[issue36659] distutils UnixCCompiler: Remove standard library path from rpath

2019-04-18 Thread STINNER Victor
STINNER Victor added the comment: Output with attached PR 12876: $ /opt/py38/bin/python3.8 -m venv opt_env $ opt_env/bin/python -m pip install lxml $ objdump -a -x $(opt_env/bin/python -c 'import lxml.etree; print(lxml.etree.__file__)')|grep -i rpath RPATH/opt/py38/lib/ ...

[issue36659] distutils UnixCCompiler: Remove standard library path from rpath

2019-04-18 Thread STINNER Victor
New submission from STINNER Victor : Since 2010, the Fedora packages of Python are using a patch on distutils UnixCCompiler to remove standard library path from rpath. The patch has been written by David Malcolm for Python 2.6.4: * https://src.fedoraproject.org/rpms/python38/blob/master/f/000