FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

bpo-41916: allow cross-compiled python to have -pthread set for CXX by virtuald · Pull Request #22525 · python/cpython · GitHub

/ cpython Public

bpo-41916: allow cross-compiled python to have -pthread set for CXX - #22525

Merged
gpshead merged 1 commit into
python:mainfrom
virtuald:allow-cxx-pthread-override
Jan 5, 2023
Merged

bpo-41916: allow cross-compiled python to have -pthread set for CXX#22525
gpshead merged 1 commit into
python:mainfrom
virtuald:allow-cxx-pthread-override

Conversation

virtuald commented Oct 3, 2020
edited by bedevere-bot
Loading

Copy link
Copy Markdown
Contributor

When cross-compiling, the compile/run test for -pthread always fails so -pthread will never be automatically set without an override from the cache. ac_cv_pthread can already be overridden, so do the same thing for ac_cv_cxx_thread.

I've validated that my cross-compiled python has the variables set now when configured via:

   ./configure --host=$TARGET_HOST --build=$BUILD_HOST --prefix=$PREFIX \
        --disable-ipv6 --enable-unicode=ucs4 \
        ac_cv_file__dev_ptmx=no ac_cv_file__dev_ptc=no \
        ac_cv_have_long_long_format=yes \
        ac_cv_pthread_is_default=no ac_cv_pthread=yes ac_cv_cxx_thread=yes; \

I now get as expected:

>>> import pprint, distutils.sysconfig
>>> pprint.pprint({i: distutils.sysconfig.get_config_vars(i)[0] for i in ('CC', 'CXX', 'LDSHARED')})
{'CC': 'arm-frc2020-linux-gnueabi-gcc -pthread',
 'CXX': 'arm-frc2020-linux-gnueabi-c++ -pthread',
 'LDSHARED': 'arm-frc2020-linux-gnueabi-gcc -pthread -shared'}

I haven't yet checked to see if it all works quite yet, will do later today.

https://bugs.python.org/issue41916

virtuald commented Oct 6, 2020

Copy link
Copy Markdown
Contributor Author

Some testing indicates that this worked without issues. Given that the tests all seem to pass on CI, I think this is good to go.

Copy link
Copy Markdown
Contributor Author

I have confirmed that this does fix the issues I was running into, and my cross compiled packages seem to be fine.

FFY00 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This fix looks correct. @jaraco could you have a look?

virtuald commented Mar 4, 2022

Copy link
Copy Markdown
Contributor Author

I've been using it to build python 3.9.x and more recently python 3.10.x without any issues.

FFY00 commented Mar 4, 2022

Copy link
Copy Markdown
Member

Perhaps, just add a news item to make it quicker to merge. I think the code is good, it is just missing a news entry.

Copy link
Copy Markdown
Contributor

You can use https://blurb-it.herokuapp.com/ to add a news fragment.

virtuald force-pushed the allow-cxx-pthread-override branch from 6ff346a to 0fdc88d Compare March 4, 2022 15:48

jaraco commented Apr 4, 2022

Copy link
Copy Markdown
Member

I'm afraid I don't have a lot of experience with this aspect of CPython. Perhaps @ambv could review or suggest a reviewer?

virtuald commented Apr 4, 2022
edited by bedevere-bot
Loading

Copy link
Copy Markdown
Contributor Author

FWIW, I've been using the patch to cross-compile python for use in CI since I've made the patch.

virtuald force-pushed the allow-cxx-pthread-override branch from 0fdc88d to 77af732 Compare October 14, 2022 05:25

Copy link
Copy Markdown
Contributor Author

Rebased on main; integrated changes that were made in #29485

Copy link
Copy Markdown
Contributor Author

@tiran seems to make a lot of changes to configure.ac, perhaps they might be a better reviewer for this?

When cross-compiling, the compile/run test for -pthread always fails so -pthread
will never be automatically set without an override from the cache. ac_cv_pthread
can already be overridden, so do the same thing for ac_cv_cxx_thread.
virtuald force-pushed the allow-cxx-pthread-override branch from 77af732 to fefd3d2 Compare October 14, 2022 06:06

FFY00 commented Oct 18, 2022
edited
Loading

Copy link
Copy Markdown
Member

@tiran, do have time to have a quick look at this PR? Thanks!

Copy link
Copy Markdown
Member

IIRC, @gpshead has some interest in cross-compilation and @erlend-aasland has experience with the configure script.

gpshead merged commit cc87487 into python:main Jan 5, 2023
virtuald mannequin mentioned this pull request Jan 5, 2023
virtuald deleted the allow-cxx-pthread-override branch January 6, 2023 02:36
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants


Back | FazBrowse Home | New Git URL