Skip to content

gh-96488: Fix build failure with older versions of GCC#98220

Closed
chrismile wants to merge 3 commits intopython:mainfrom
chrismile:main
Closed

gh-96488: Fix build failure with older versions of GCC#98220
chrismile wants to merge 3 commits intopython:mainfrom
chrismile:main

Conversation

@chrismile
Copy link

@chrismile chrismile commented Oct 12, 2022

This PR fixes #96488, microsoft/vcpkg#26573, rbgirshick/py-faster-rcnn#706, LSSTDESC/CCL#270. These issues happended when runtime_library_dirs was used with distutils on systems with older versions of GCC not supporting the -R flag.

In rbgirshick/py-faster-rcnn#706, it was proposed to fix the problem by replacing the string "-R" in https://github.com/python/cpython/blob/main/Lib/distutils/unixccompiler.py#L261 by "-Wl,-R". However, the problem comes not from the fact that this line is wrong, but from _is_gcc(compiler) not accepting the compiler name cc as a possibly valid alias for GCC. On Linux, cc is a symlink to the default C++ compiler. In this PR, cc is now resolved to the actually used compiler. Thus, _is_gcc works correctly now for the compiler alias cc, and using runtime_library_dirs no longer results in compiler errors on older versions of GCC.

@bedevere-bot
Copy link

Most changes to Python require a NEWS entry.

Please add it using the blurb_it web app or the blurb command-line tool.

@ghost
Copy link

ghost commented Oct 12, 2022

All commit authors signed the Contributor License Agreement.
CLA signed

@chrismile
Copy link
Author

chrismile commented Oct 12, 2022

It seems to me that the build failures for Tests / Windows (x64) and macOS are unrelated to this PR. Please correct me if I'm wrong.

@hauntsaninja
Copy link
Contributor

Closing as per #96487 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build failure with GCC <= 9.4 when using runtime_library_dirs

3 participants