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

[RFC] bpo-34585: Don't do runtime test to get float byte order #9085

Merged
merged 1 commit into from Sep 19, 2018

Conversation

@rossburton
Copy link
Contributor

rossburton commented Sep 6, 2018

Currently configure.ac uses AC_RUN_IFELSE to determine the byte order of doubles, but this silently fails under cross compilation and Python doesn't do floats properly.

Instead, steal a macro from autoconf-archive which compiles code using magic doubles (which encode to ASCII) and grep for the representation in the binary.

RFC because this doesn't yet handle the weird ancient ARMv4 OABI 'mixed-endian' encoding properly. This encoding is ancient and I don't believe the union of "Python 3.8 users" and "OABI users" has anything in. Should the support for this just be dropped too? Alternatively, someone will need to find an OABI toolchain to verify the encoding of the magic double.

https://bugs.python.org/issue34585

@the-knights-who-say-ni

This comment has been minimized.

Copy link

the-knights-who-say-ni commented Sep 6, 2018

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA).

Unfortunately our records indicate you have not signed the CLA. For legal reasons we need you to sign this before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

You can check yourself to see if the CLA has been received.

Thanks again for your contribution, we look forward to reviewing it!

@yan12125

This comment has been minimized.

Copy link
Contributor

yan12125 commented Sep 7, 2018

That's a great idea and it should help Android builds, too! A minor issue is - I remember in CPython, changes to ./configure should be added to the commit if configure.ac is modified.

@benjaminp

This comment has been minimized.

Copy link
Contributor

benjaminp commented Sep 10, 2018

This seems fine, but we should get a CLA.

@rossburton

This comment has been minimized.

Copy link
Contributor Author

rossburton commented Sep 18, 2018

CLA sorted.

@rossburton rossburton force-pushed the rossburton:float branch from 3c8fdf9 to 985d944 Sep 18, 2018
@rossburton rossburton force-pushed the rossburton:float branch from 985d944 to b3b12c4 Sep 18, 2018
@benjaminp benjaminp merged commit 2a9c380 into python:master Sep 19, 2018
7 of 9 checks passed
7 of 9 checks passed
Linux-PR #Linux-PR_20180918.37 failed
Details
Linux-PR-Coverage #Linux-PR-Coverage_20180918.26 failed
Details
Windows-PR #Windows-PR_20180918.37 succeeded
Details
bedevere/issue-number Issue number 34585 found
Details
bedevere/news News entry found in Misc/NEWS.d
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
docs #docs_20180918.37 succeeded
Details
macOS-PR #macOS-PR_20180918.37 succeeded
Details
@benjaminp

This comment has been minimized.

Copy link
Contributor

benjaminp commented Sep 19, 2018

Thanks for the PR. I agree we should probably look into not pretending to support ARM4.

yan12125 added a commit to yan12125/python3-android that referenced this pull request Sep 19, 2018
Support for cross-builds is added in python/cpython#9085
yahya-abou-imran added a commit to yahya-abou-imran/cpython that referenced this pull request Nov 2, 2018
…honGH-9085)

Currently configure.ac uses AC_RUN_IFELSE to determine the byte order of doubles, but this silently fails under cross compilation and Python doesn't do floats properly.

Instead, steal a macro from autoconf-archive which compiles code using magic doubles (which encode to ASCII) and grep for the representation in the binary.

RFC because this doesn't yet handle the weird ancient ARMv4 OABI 'mixed-endian' encoding properly. This encoding is ancient and I don't believe the union of "Python 3.8 users" and "OABI users" has anything in. Should the support for this just be dropped too? Alternatively, someone will need to find an OABI toolchain to verify the encoding of the magic double.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.