You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
closes bpo-34585: Don't do runtime test to get float byte order. (GH-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.
double d = 90904234967036810337470478905505011476211692735615632014797120844053488865816695273723469097858056257517020191247487429516932130503560650002327564517570778480236724525140520121371739201496540132640109977779420565776568942592.0;
49
+
50
+
]])], [
51
+
52
+
if grep noonsees conftest.$ac_objext >/dev/null ; then
53
+
ax_cv_c_float_words_bigendian=yes
54
+
fi
55
+
if grep seesnoon conftest.$ac_objext >/dev/null ; then
56
+
if test "$ax_cv_c_float_words_bigendian" = unknown; then
57
+
ax_cv_c_float_words_bigendian=no
58
+
else
59
+
ax_cv_c_float_words_bigendian=unknown
60
+
fi
61
+
fi
62
+
63
+
])])
64
+
65
+
case $ax_cv_c_float_words_bigendian in
66
+
yes)
67
+
m4_default([$1],
68
+
[AC_DEFINE([FLOAT_WORDS_BIGENDIAN], 1,
69
+
[Define to 1 if your system stores words within floats
70
+
with the most significant word first])]) ;;
71
+
no)
72
+
$2 ;;
73
+
*)
74
+
m4_default([$3],
75
+
[AC_MSG_ERROR([
76
+
77
+
Unknown float word ordering. You need to manually preset
78
+
ax_cv_c_float_words_bigendian=no (or yes) according to your system.
0 commit comments