Skip to content

Commit dca8163

Browse files
bnoordhuisjasnell
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 bd8a719 commit dca8163

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

configure.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1059,12 +1059,14 @@ def configure_arm(o):
10591059
o['variables']['arm_fpu'] = options.arm_fpu or arm_fpu
10601060

10611061

1062-
def configure_mips(o):
1062+
def configure_mips(o, target_arch):
10631063
can_use_fpu_instructions = (options.mips_float_abi != 'soft')
10641064
o['variables']['v8_can_use_fpu_instructions'] = b(can_use_fpu_instructions)
10651065
o['variables']['v8_use_mips_abi_hardfloat'] = b(can_use_fpu_instructions)
10661066
o['variables']['mips_arch_variant'] = options.mips_arch_variant
10671067
o['variables']['mips_fpu_mode'] = options.mips_fpu_mode
1068+
host_byteorder = 'little' if target_arch in ('mipsel', 'mips64el') else 'big'
1069+
o['variables']['v8_host_byteorder'] = host_byteorder
10681070

10691071

10701072
def gcc_version_ge(version_checked):
@@ -1124,7 +1126,7 @@ def configure_node(o):
11241126
if target_arch == 'arm':
11251127
configure_arm(o)
11261128
elif target_arch in ('mips', 'mipsel', 'mips64el'):
1127-
configure_mips(o)
1129+
configure_mips(o, target_arch)
11281130

11291131
if flavor == 'aix':
11301132
o['variables']['node_target_type'] = 'static_library'

0 commit comments

Comments
 (0)