Skip to content

Commit f7cbac5

Browse files
committed
Fix ax_c_float_words_bigendian test for iOS build.
If cpu is arm, assume little-endian.
1 parent b86ce3a commit f7cbac5

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

Tools/configure/conf_math.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,16 @@ def _define_float_little():
9494

9595

9696
def _define_float_unknown():
97-
pyconf.error(
98-
"Unknown float word ordering. You need to manually "
99-
"preset ax_cv_c_float_words_bigendian=no (or yes) "
100-
"according to your system."
101-
)
97+
# Fallback for platforms where float endianness detection fails.
98+
# Modern ARM (including iOS) uses little-endian IEEE 754 doubles.
99+
if pyconf.fnmatch_any(pyconf.host_cpu, ["arm*", "aarch64"]):
100+
_define_float_little()
101+
else:
102+
pyconf.error(
103+
"Unknown float word ordering. You need to manually "
104+
"preset ax_cv_c_float_words_bigendian=no (or yes) "
105+
"according to your system."
106+
)
102107

103108

104109
def check_gcc_asm_and_floating_point(v):

0 commit comments

Comments
 (0)