build,win: add support for MSVC cross-compilation
* Fixes cases in icutools where commands were issued without .exe * Changes to build scripts * Add /fp:strict flag so that MSVC's floating point behaves correctly * Enables marmasm PR-URL: https://github.com/nodejs/node/pull/32867 Reviewed-By: Christian Clauss <cclauss@me.com> Reviewed-By: João Reis <reis@janeasystems.com>
This commit is contained in:
parent
66807e995d
commit
8833551257
@ -193,6 +193,11 @@
|
||||
],
|
||||
'msvs_settings': {
|
||||
'VCCLCompilerTool': {
|
||||
'conditions': [
|
||||
['target_arch=="arm64"', {
|
||||
'FloatingPointModel': 1 # /fp:strict
|
||||
}]
|
||||
],
|
||||
'EnableFunctionLevelLinking': 'true',
|
||||
'EnableIntrinsicFunctions': 'true',
|
||||
'FavorSizeOrSpeed': 1, # /Ot, favor speed over size
|
||||
|
@ -1041,6 +1041,8 @@ def configure_node(o):
|
||||
cross_compiling = (options.cross_compiling
|
||||
if options.cross_compiling is not None
|
||||
else target_arch != host_arch)
|
||||
if cross_compiling:
|
||||
os.environ['GYP_CROSSCOMPILE'] = "1"
|
||||
if options.unused_without_snapshot:
|
||||
warn('building --without-snapshot is no longer possible')
|
||||
|
||||
|
@ -197,7 +197,7 @@
|
||||
}],
|
||||
['_toolset=="host"', {
|
||||
'type': 'none',
|
||||
'dependencies': [ 'icutools' ],
|
||||
'dependencies': [ 'icutools#host' ],
|
||||
'export_dependent_settings': [ 'icutools' ],
|
||||
}],
|
||||
],
|
||||
@ -221,7 +221,7 @@
|
||||
'inputs': [ '<(icu_data_in)' ],
|
||||
'outputs': [ '<(SHARED_INTERMEDIATE_DIR)/icudt<(icu_ver_major)<(icu_endianness)_dat.<(icu_asm_ext)' ],
|
||||
# on Windows, we can go directly to .obj file (-o) option.
|
||||
'action': [ '<(PRODUCT_DIR)/genccode',
|
||||
'action': [ '<(PRODUCT_DIR)/genccode<(EXECUTABLE_SUFFIX)',
|
||||
'<@(icu_asm_opts)', # -o
|
||||
'-d', '<(SHARED_INTERMEDIATE_DIR)',
|
||||
'-n', 'icudata',
|
||||
@ -258,7 +258,7 @@
|
||||
'msvs_quote_cmd': 0,
|
||||
'inputs': [ '<(SHARED_INTERMEDIATE_DIR)/icutmp/icudt<(icu_ver_major)<(icu_endianness).dat' ],
|
||||
'outputs': [ '<(SHARED_INTERMEDIATE_DIR)/icudt<(icu_ver_major)<(icu_endianness)_dat.<(icu_asm_ext)' ],
|
||||
'action': [ '<(PRODUCT_DIR)/genccode',
|
||||
'action': [ '<(PRODUCT_DIR)/genccode<(EXECUTABLE_SUFFIX)',
|
||||
'<@(icu_asm_opts)', # -o
|
||||
'-d', '<(SHARED_INTERMEDIATE_DIR)/',
|
||||
'-n', 'icudata',
|
||||
@ -284,7 +284,7 @@
|
||||
'action_name': 'icupkg',
|
||||
'inputs': [ '<(icu_data_in)' ],
|
||||
'outputs':[ '<(SHARED_INTERMEDIATE_DIR)/icudt<(icu_ver_major)<(icu_endianness).dat' ],
|
||||
'action': [ '<(PRODUCT_DIR)/icupkg',
|
||||
'action': [ '<(PRODUCT_DIR)/icupkg<(EXECUTABLE_SUFFIX)',
|
||||
'-t<(icu_endianness)',
|
||||
'<@(_inputs)',
|
||||
'<@(_outputs)',
|
||||
@ -305,7 +305,7 @@
|
||||
'action_name': 'icudata',
|
||||
'inputs': [ '<(SHARED_INTERMEDIATE_DIR)/icudt<(icu_ver_major).dat' ],
|
||||
'outputs':[ '<(SHARED_INTERMEDIATE_DIR)/icudt<(icu_ver_major)_dat.<(icu_asm_ext)' ],
|
||||
'action': [ '<(PRODUCT_DIR)/genccode',
|
||||
'action': [ '<(PRODUCT_DIR)/genccode<(EXECUTABLE_SUFFIX)',
|
||||
'-e', 'icudt<(icu_ver_major)',
|
||||
'-d', '<(SHARED_INTERMEDIATE_DIR)',
|
||||
'<@(icu_asm_opts)',
|
||||
@ -350,7 +350,7 @@
|
||||
'action_name': 'genccode',
|
||||
'inputs': [ '<(SHARED_INTERMEDIATE_DIR)/icutmp/icusmdt<(icu_ver_major).dat' ],
|
||||
'outputs': [ '<(SHARED_INTERMEDIATE_DIR)/icusmdt<(icu_ver_major)_dat.<(icu_asm_ext)' ],
|
||||
'action': [ '<(PRODUCT_DIR)/genccode',
|
||||
'action': [ '<(PRODUCT_DIR)/genccode<(EXECUTABLE_SUFFIX)',
|
||||
'<@(icu_asm_opts)',
|
||||
'-d', '<(SHARED_INTERMEDIATE_DIR)',
|
||||
'<@(_inputs)' ],
|
||||
@ -388,7 +388,7 @@
|
||||
'toolsets': [ 'target', 'host' ],
|
||||
'conditions' : [
|
||||
['_toolset=="host"', {
|
||||
'dependencies': [ 'icutools' ],
|
||||
'dependencies': [ 'icutools#host' ],
|
||||
'export_dependent_settings': [ 'icutools' ],
|
||||
}],
|
||||
['_toolset=="target"', {
|
||||
|
@ -470,6 +470,11 @@
|
||||
'toolsets': ['target'],
|
||||
'conditions': [
|
||||
['want_separate_host_toolset', {
|
||||
'conditions': [
|
||||
['v8_target_arch=="arm64"', {
|
||||
'msvs_enable_marmasm': 1,
|
||||
}]
|
||||
],
|
||||
'dependencies': [
|
||||
'generate_bytecode_builtins_list',
|
||||
'run_torque',
|
||||
@ -785,6 +790,14 @@
|
||||
'sources': [ ### gcmole(arch:arm64) ###
|
||||
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_base_without_compiler.*?v8_current_cpu == \\"arm64\\".*?sources \+= ")',
|
||||
],
|
||||
'conditions': [
|
||||
['OS=="win"', {
|
||||
'sources': [
|
||||
"<(V8_ROOT)/src/diagnostics/unwinding-info-win64.cc",
|
||||
"<(V8_ROOT)/src/diagnostics/unwinding-info-win64.h"
|
||||
],
|
||||
}],
|
||||
],
|
||||
}],
|
||||
['v8_target_arch=="mips" or v8_target_arch=="mipsel"', {
|
||||
'sources': [ ### gcmole(arch:mipsel) ###
|
||||
|
@ -197,6 +197,7 @@ if defined target_arch set configure_flags=%configure_flags% --dest-cpu=%ta
|
||||
if defined openssl_no_asm set configure_flags=%configure_flags% --openssl-no-asm
|
||||
if defined DEBUG_HELPER set configure_flags=%configure_flags% --verbose
|
||||
if "%target_arch%"=="x86" if "%PROCESSOR_ARCHITECTURE%"=="AMD64" set configure_flags=%configure_flags% --no-cross-compiling
|
||||
if "%target_arch%"=="arm64" set configure_flags=%configure_flags% --cross-compiling
|
||||
|
||||
if not exist "%~dp0deps\icu" goto no-depsicu
|
||||
if "%target%"=="Clean" echo deleting %~dp0deps\icu
|
||||
|
Loading…
x
Reference in New Issue
Block a user