This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients vstinner
Date 2019-04-23.11:26:08
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
My understanding of Fedora 00001-rpath.patch is that it ignores -rpath PATH option passed to the 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'))"

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

--- 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 bdist_ext command:

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