Skip to content

Commit 43fd474

Browse files
bnoordhuiscodebytere
authored andcommitted
build: configure byte order for mips targets
The build defaulted to the byte order of the host system but that can be different from the endianness of the target system. Refs: #33703 (comment) PR-URL: #33898 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent b894df8 commit 43fd474

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

configure.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -1012,12 +1012,14 @@ def configure_arm(o):
10121012
o['variables']['arm_fpu'] = options.arm_fpu or arm_fpu
10131013

10141014

1015-
def configure_mips(o):
1015+
def configure_mips(o, target_arch):
10161016
can_use_fpu_instructions = (options.mips_float_abi != 'soft')
10171017
o['variables']['v8_can_use_fpu_instructions'] = b(can_use_fpu_instructions)
10181018
o['variables']['v8_use_mips_abi_hardfloat'] = b(can_use_fpu_instructions)
10191019
o['variables']['mips_arch_variant'] = options.mips_arch_variant
10201020
o['variables']['mips_fpu_mode'] = options.mips_fpu_mode
1021+
host_byteorder = 'little' if target_arch in ('mipsel', 'mips64el') else 'big'
1022+
o['variables']['v8_host_byteorder'] = host_byteorder
10211023

10221024

10231025
def gcc_version_ge(version_checked):
@@ -1077,7 +1079,7 @@ def configure_node(o):
10771079
if target_arch == 'arm':
10781080
configure_arm(o)
10791081
elif target_arch in ('mips', 'mipsel', 'mips64el'):
1080-
configure_mips(o)
1082+
configure_mips(o, target_arch)
10811083

10821084
if flavor == 'aix':
10831085
o['variables']['node_target_type'] = 'static_library'

0 commit comments

Comments
 (0)