Author vstinner
Recipients vstinner
Date 2019-04-23.11:26:08
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1556018768.26.0.740720267919.issue36659@roundup.psfhosted.org>
In-reply-to
Content
My understanding of Fedora 00001-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:

$ python3 -c "import sysconfig; print(sysconfig.get_config_var('LIBDIR'))"
/usr/lib64

Only LIBDIR directory is ignored: other -rpath directories are passed to the linker.

---

UnixCCompiler.link() has a runtime_library_dirs parameter which can be modified by the _fix_lib_args() method and then is passed to gen_lib_options().

gen_lib_options() calls compiler.runtime_library_dir_option() on each directory of runtime_library_dirs: this part is responsible to use the proper linker option: -R, -rpath, -L, etc.

build_ext.build_extension() method of distutils.commands.build_ext pass Extension.runtime_library_dirs to compiler.link_shared_object()

build_ext.check_extensions_list() modify the runtime_library_dirs attribute:

    # Medium-easy stuff: same syntax/semantics, different names.
    ext.runtime_library_dirs = build_info.get('rpath')

I understand that build_info.get('rpath') comes from -rpath command line option of setup.py bdist_ext command:

        ('rpath=', 'R',
         "directories to search for shared C libraries at runtime"),
History
Date User Action Args
2019-04-23 11:26:08vstinnersetrecipients: + vstinner
2019-04-23 11:26:08vstinnersetmessageid: <1556018768.26.0.740720267919.issue36659@roundup.psfhosted.org>
2019-04-23 11:26:08vstinnerlinkissue36659 messages
2019-04-23 11:26:08vstinnercreate