Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-31904: add library search path by wr-cc in add_cross_compiling_paths() #24191

Merged
merged 5 commits into from Jan 22, 2021

Conversation

@pxinwr
Copy link
Contributor

@pxinwr pxinwr commented Jan 11, 2021

VxWorks has a compiler driver utility called wr-cc which wraps gcc or clang compiler. The call of sysconfig.get_config_var('CC') on building machine returns "wr-cc" for VxWorks cross compiling. "wr-cc --print-search-dirs" will add VSB specific path for library searching. Building extension modules will need these paths. So adding them in add_cross_compiling_paths().

https://bugs.python.org/issue31904

pxinwr added 2 commits Jan 11, 2021
setup.py Outdated Show resolved Hide resolved
setup.py Show resolved Hide resolved
setup.py Outdated Show resolved Hide resolved
setup.py Outdated Show resolved Hide resolved
setup.py Outdated Show resolved Hide resolved
setup.py Outdated Show resolved Hide resolved
setup.py Outdated Show resolved Hide resolved
setup.py Outdated Show resolved Hide resolved
@vstinner
Copy link
Member

@vstinner vstinner commented Jan 22, 2021

LGTM, thanks for the updates.

I'm not fully comfortable with this PR which is maybe a little bit too specific to "clang --print-search-dirs" on Windows using MSYS. It's only used on VxWorks and only for cross-compilation. It's a little bit annoying to have to accumulate such code in setup.py to support different toolchains, but I don't see a better option for now.

distutils is not great for cross-compiling, and right now setup.py is implemented with distutils build_ext and Extension classes. I doubt that setuptools will have a better support for cross-compilation soon.

In the meanwhile, setup.py is the right place for such code.

@vstinner vstinner merged commit 5e45f1c into python:master Jan 22, 2021
11 checks passed
11 checks passed
Docs
Details
Check for source changes
Details
Check if generated files are up to date
Details
Windows (x86)
Details
Windows (x64) Windows (x64)
Details
macOS
Details
Ubuntu
Details
Azure Pipelines PR #20210120.20 succeeded
Details
Travis CI - Pull Request Build Passed
Details
bedevere/issue-number Issue number 31904 found
Details
bedevere/news News entry found in Misc/NEWS.d
@vstinner
Copy link
Member

@vstinner vstinner commented Jan 22, 2021

I rewrote the commit title to better summarize what it does. Thanks @pxinwr, I merged your PR.

m000 added a commit to m000/cpython that referenced this pull request Jan 29, 2021
Add library search path by wr-cc in add_cross_compiling_paths().
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants