Skip to content

Build failure with GCC <= 9.4 when using runtime_library_dirs #96488

Closed as not planned
@chrismile

Description

@chrismile

Bug report

When compiling Python 3.10 using vcpkg on Ubuntu 18.04 and Ubuntu 20.04, the build of multiple built-in modules like binascii fails with the output cc: error: unrecognized command line option ‘-R’.

I initially reported this bug to vcpkg (microsoft/vcpkg#26573), but was forwared by them to the upstream Python project. It seems like vcpkg uses runtime_library_dirs in setup.py. Python seems to use the -R flag in setup.py for self.compiler.runtime_library_dirs. However, GCC <= 9.4 (as provided by Ubuntu 18.04 and Ubuntu 20.04) only seems to accept the -Wl,-R flag when I tested it. GCC 11 on Ubuntu 22.04 seems to accept the -R flag.

I hope this can be fixed in the upstream repo. In setup.py of Python 3.10.6, line 800 is ('LDFLAGS', '-R', self.compiler.runtime_library_dirs), which I believe might be the source of this problem. I hope changing this to -Wl,-R does not lead to problems with any other compilers like Clang. I am also not 100% sure if there are any other places where -R might be used at the moment.

Your environment

  • Python 3.10
  • Ubuntu 18.04 and Ubuntu 20.04

Metadata

Metadata

Assignees

No one assigned

    Labels

    buildThe build process and cross-buildtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions