0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-21 21:19:50 +01:00

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: https://github.com/nodejs/node/issues/33703#issuecomment-644639158

PR-URL: https://github.com/nodejs/node/pull/33898
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
Ben Noordhuis 2020-06-16 11:17:27 +02:00 committed by James M Snell
parent bd8a7196fc
commit dca816325d
No known key found for this signature in database
GPG Key ID: 7341B15C070877AC

View File

@ -1059,12 +1059,14 @@ def configure_arm(o):
o['variables']['arm_fpu'] = options.arm_fpu or arm_fpu
def configure_mips(o):
def configure_mips(o, target_arch):
can_use_fpu_instructions = (options.mips_float_abi != 'soft')
o['variables']['v8_can_use_fpu_instructions'] = b(can_use_fpu_instructions)
o['variables']['v8_use_mips_abi_hardfloat'] = b(can_use_fpu_instructions)
o['variables']['mips_arch_variant'] = options.mips_arch_variant
o['variables']['mips_fpu_mode'] = options.mips_fpu_mode
host_byteorder = 'little' if target_arch in ('mipsel', 'mips64el') else 'big'
o['variables']['v8_host_byteorder'] = host_byteorder
def gcc_version_ge(version_checked):
@ -1124,7 +1126,7 @@ def configure_node(o):
if target_arch == 'arm':
configure_arm(o)
elif target_arch in ('mips', 'mipsel', 'mips64el'):
configure_mips(o)
configure_mips(o, target_arch)
if flavor == 'aix':
o['variables']['node_target_type'] = 'static_library'