Skip to content

Commit e057189

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 b92c0cb commit e057189

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
@@ -1001,12 +1001,14 @@ def configure_arm(o):
10011001
o['variables']['arm_fpu'] = options.arm_fpu or arm_fpu
10021002

10031003

1004-
def configure_mips(o):
1004+
def configure_mips(o, target_arch):
10051005
can_use_fpu_instructions = (options.mips_float_abi != 'soft')
10061006
o['variables']['v8_can_use_fpu_instructions'] = b(can_use_fpu_instructions)
10071007
o['variables']['v8_use_mips_abi_hardfloat'] = b(can_use_fpu_instructions)
10081008
o['variables']['mips_arch_variant'] = options.mips_arch_variant
10091009
o['variables']['mips_fpu_mode'] = options.mips_fpu_mode
1010+
host_byteorder = 'little' if target_arch in ('mipsel', 'mips64el') else 'big'
1011+
o['variables']['v8_host_byteorder'] = host_byteorder
10101012

10111013

10121014
def gcc_version_ge(version_checked):
@@ -1062,7 +1064,7 @@ def configure_node(o):
10621064
if target_arch == 'arm':
10631065
configure_arm(o)
10641066
elif target_arch in ('mips', 'mipsel', 'mips64el'):
1065-
configure_mips(o)
1067+
configure_mips(o, target_arch)
10661068

10671069
if flavor == 'aix':
10681070
o['variables']['node_target_type'] = 'static_library'

0 commit comments

Comments
 (0)