Skip to content

Commit

Permalink
build: configure byte order for mips targets
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
bnoordhuis authored and codebytere committed Jul 10, 2020
1 parent 773fd7a commit 3c61df8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -1001,12 +1001,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):
Expand Down Expand Up @@ -1062,7 +1064,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'
Expand Down

0 comments on commit 3c61df8

Please sign in to comment.