-
-
Notifications
You must be signed in to change notification settings - Fork 30.9k
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
gh-89640: Hardcode WASM float word ordering as little endian #126387
gh-89640: Hardcode WASM float word ordering as little endian #126387
Conversation
erlend-aasland
commented
Nov 4, 2024
•
edited by bedevere-app
bot
Loading
edited by bedevere-app
bot
- Issue: configure script cannot detect float word ordering on linux #89640
cc. @hoodmane |
Thanks for the help @erlend-aasland! |
This comment was marked as spam.
This comment was marked as spam.
Any compliant implementation of webassembly is little endian: I think that if someone forked the spec and invented "big endian wasm" but still called the target If for some reason we don't want to hard code Emscripten, there is an option here: |
…ython#126387) Properly detect float word ordering on Linux (pythongh-125571) autoconf-archive patch by Dan Amelang. (cherry picked from commit 26d6277) Hardcode WASM float word ordering to little endian (pythongh-126387) (cherry picked from commit 532fc08)
One effect that this change had is that it will no longer raise the error:
if the float word order does not match arm or wasm and --- a/configure.ac
+++ b/configure.ac
@@ -5920,7 +5920,15 @@ AX_C_FLOAT_WORDS_BIGENDIAN(
stored in ARM mixed-endian order (byte order 45670123)])],
[wasm*], [AC_DEFINE([DOUBLE_IS_LITTLE_ENDIAN_IEEE754], [1],
[Define if C doubles are 64-bit IEEE 754 binary format,
- stored with the least significant byte first])])])
+ stored with the least significant byte first])],
+ AC_MSG_ERROR[([
+
+Unknown float word ordering. You need to manually preset
+ax_cv_c_float_words_bigendian=no (or yes) according to your system.
+
+ ])]
+ )]
+)
# The short float repr introduced in Python 3.1 requires the
# correctly-rounded string <-> double conversion functions from |
…float word order Before python#126387, if we didn't detect float word order we'd raise the following configure error: ``` Unknown float word ordering. You need to manually preset ax_cv_c_float_words_bigendian=no (or yes) according to your system. ``` This puts it back (except for host_cpu arm or wasm).
…float word order Before python#126387, if we didn't detect float word order we'd raise the following configure error: ``` Unknown float word ordering. You need to manually preset ax_cv_c_float_words_bigendian=no (or yes) according to your system. ``` This puts it back (except for host_cpu arm or wasm).
Good catch, @hoodmane! Yes, indeed we should. |
…word order (#126569) Before #126387, if we didn't detect float word order we'd raise the following configure error: Unknown float word ordering. You need to manually preset ax_cv_c_float_words_bigendian=no (or yes) according to your system. This puts it back (except for ARM or WASM, which as hardcoded).
The original patch: autoconf-archive/autoconf-archive#279 broke endianness detection on Emscripten. This was fixed in this followup: autoconf-archive/autoconf-archive#316 We also have worked around the problem by adjusting `configure.ac` in the Python repo to handle this case: python/cpython#126387 But it's useful for us to use the upstream autoconf-archive detection so that we can be completely sure that the fix works in practice.
…float word order (python#126569) Before python#126387, if we didn't detect float word order we'd raise the following configure error: Unknown float word ordering. You need to manually preset ax_cv_c_float_words_bigendian=no (or yes) according to your system. This puts it back (except for ARM or WASM, which as hardcoded).
…float word order (python#126569) Before python#126387, if we didn't detect float word order we'd raise the following configure error: Unknown float word ordering. You need to manually preset ax_cv_c_float_words_bigendian=no (or yes) according to your system. This puts it back (except for ARM or WASM, which as hardcoded).