You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
distutil's runtime_library_dir (rpath) option doesn't work with clang #89534
Chris Hills reported in bpo-43466 that the new --with-openssl-rpath=auto does not work with clang. It turns out to be a bug in distutils. UnixCCompiler.runtime_library_dir_option() does not detect clang correctly and emits wrong option for rpath.
I tested this both with and without LDFLAGS="-Wl,-rpath -Wl,/home/chaz/.local/local/python3.10.0/lib", and in both cases this patch works as expected. Thank you!
Activity
tiran commentedon Oct 5, 2021
Chris Hills reported in bpo-43466 that the new --with-openssl-rpath=auto does not work with clang. It turns out to be a bug in distutils. UnixCCompiler.runtime_library_dir_option() does not detect clang correctly and emits wrong option for rpath.
tiran commentedon Oct 5, 2021
$ CC=clang ./configure --with-openssl=/home/heimes/dev/python/multissl/openssl/3.0.0 --with-openssl-rpath=auto $ make $ readelf -d build/lib.linux-x86_64-3.11/_ssl.cpython-311-x86_64-linux-gnu.so | grep RUNPATH 0x000000000000001d (RUNPATH) Library runpath: [/home/heimes/dev/python/multissl/openssl/3.0.0/lib]chaz6 commentedon Oct 5, 2021
I tested this both with and without LDFLAGS="-Wl,-rpath -Wl,/home/chaz/.local/local/python3.10.0/lib", and in both cases this patch works as expected. Thank you!
miss-islington commentedon Oct 5, 2021
New changeset ef61960 by Christian Heimes in branch 'main':
bpo-45371: Fix distutils' rpath support for clang (GH-28732)
ef61960
miss-islington commentedon Oct 5, 2021
New changeset 3733ddd by Miss Islington (bot) in branch '3.10':
[3.10] bpo-45371: Fix distutils' rpath support for clang (GH-28732) (GH-28733)
3733ddd
miss-islington commentedon Oct 5, 2021
New changeset 3ce5e07 by Miss Islington (bot) in branch '3.9':
bpo-45371: Fix distutils' rpath support for clang (GH-28732)
3ce5e07
tiran commentedon Oct 5, 2021
Thanks for confirming that the fix works for you. The fix will be in 3.10.1, which should be released in early December.
FFY00 commentedon Oct 6, 2021
The fix that was merged seems a bit hacky to me -- it changes the _is_gcc check so that it returns True on clang.
Even though distutils is deprecated and no longer synced externally, if someone needs to issue a similar fix, this might trip them over.
I would recommend replacing it with [1], from the now externally maintained distutils module.
[1] pypa/distutils#55
AA-Turner commentedon Jun 9, 2022
@FFY00 -- can this be closed? I don't believe it has been changed, but I also can't find any record of further discussion.
A
FFY00 commentedon Jun 9, 2022
I think it can, AFAIK there was no further discussion.