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': {
|
'msvs_settings': {
|
||||||
'VCCLCompilerTool': {
|
'VCCLCompilerTool': {
|
||||||
|
'conditions': [
|
||||||
|
['target_arch=="arm64"', {
|
||||||
|
'FloatingPointModel': 1 # /fp:strict
|
||||||
|
}]
|
||||||
|
],
|
||||||
'EnableFunctionLevelLinking': 'true',
|
'EnableFunctionLevelLinking': 'true',
|
||||||
'EnableIntrinsicFunctions': 'true',
|
'EnableIntrinsicFunctions': 'true',
|
||||||
'FavorSizeOrSpeed': 1, # /Ot, favor speed over size
|
'FavorSizeOrSpeed': 1, # /Ot, favor speed over size
|
||||||
|
@ -1041,6 +1041,8 @@ def configure_node(o):
|
|||||||
cross_compiling = (options.cross_compiling
|
cross_compiling = (options.cross_compiling
|
||||||
if options.cross_compiling is not None
|
if options.cross_compiling is not None
|
||||||
else target_arch != host_arch)
|
else target_arch != host_arch)
|
||||||
|
if cross_compiling:
|
||||||
|
os.environ['GYP_CROSSCOMPILE'] = "1"
|
||||||
if options.unused_without_snapshot:
|
if options.unused_without_snapshot:
|
||||||
warn('building --without-snapshot is no longer possible')
|
warn('building --without-snapshot is no longer possible')
|
||||||
|
|
||||||
|
@ -197,7 +197,7 @@
|
|||||||
}],
|
}],
|
||||||
['_toolset=="host"', {
|
['_toolset=="host"', {
|
||||||
'type': 'none',
|
'type': 'none',
|
||||||
'dependencies': [ 'icutools' ],
|
'dependencies': [ 'icutools#host' ],
|
||||||
'export_dependent_settings': [ 'icutools' ],
|
'export_dependent_settings': [ 'icutools' ],
|
||||||
}],
|
}],
|
||||||
],
|
],
|
||||||
@ -221,7 +221,7 @@
|
|||||||
'inputs': [ '<(icu_data_in)' ],
|
'inputs': [ '<(icu_data_in)' ],
|
||||||
'outputs': [ '<(SHARED_INTERMEDIATE_DIR)/icudt<(icu_ver_major)<(icu_endianness)_dat.<(icu_asm_ext)' ],
|
'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.
|
# 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
|
'<@(icu_asm_opts)', # -o
|
||||||
'-d', '<(SHARED_INTERMEDIATE_DIR)',
|
'-d', '<(SHARED_INTERMEDIATE_DIR)',
|
||||||
'-n', 'icudata',
|
'-n', 'icudata',
|
||||||
@ -258,7 +258,7 @@
|
|||||||
'msvs_quote_cmd': 0,
|
'msvs_quote_cmd': 0,
|
||||||
'inputs': [ '<(SHARED_INTERMEDIATE_DIR)/icutmp/icudt<(icu_ver_major)<(icu_endianness).dat' ],
|
'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)' ],
|
'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
|
'<@(icu_asm_opts)', # -o
|
||||||
'-d', '<(SHARED_INTERMEDIATE_DIR)/',
|
'-d', '<(SHARED_INTERMEDIATE_DIR)/',
|
||||||
'-n', 'icudata',
|
'-n', 'icudata',
|
||||||
@ -284,7 +284,7 @@
|
|||||||
'action_name': 'icupkg',
|
'action_name': 'icupkg',
|
||||||
'inputs': [ '<(icu_data_in)' ],
|
'inputs': [ '<(icu_data_in)' ],
|
||||||
'outputs':[ '<(SHARED_INTERMEDIATE_DIR)/icudt<(icu_ver_major)<(icu_endianness).dat' ],
|
'outputs':[ '<(SHARED_INTERMEDIATE_DIR)/icudt<(icu_ver_major)<(icu_endianness).dat' ],
|
||||||
'action': [ '<(PRODUCT_DIR)/icupkg',
|
'action': [ '<(PRODUCT_DIR)/icupkg<(EXECUTABLE_SUFFIX)',
|
||||||
'-t<(icu_endianness)',
|
'-t<(icu_endianness)',
|
||||||
'<@(_inputs)',
|
'<@(_inputs)',
|
||||||
'<@(_outputs)',
|
'<@(_outputs)',
|
||||||
@ -305,7 +305,7 @@
|
|||||||
'action_name': 'icudata',
|
'action_name': 'icudata',
|
||||||
'inputs': [ '<(SHARED_INTERMEDIATE_DIR)/icudt<(icu_ver_major).dat' ],
|
'inputs': [ '<(SHARED_INTERMEDIATE_DIR)/icudt<(icu_ver_major).dat' ],
|
||||||
'outputs':[ '<(SHARED_INTERMEDIATE_DIR)/icudt<(icu_ver_major)_dat.<(icu_asm_ext)' ],
|
'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)',
|
'-e', 'icudt<(icu_ver_major)',
|
||||||
'-d', '<(SHARED_INTERMEDIATE_DIR)',
|
'-d', '<(SHARED_INTERMEDIATE_DIR)',
|
||||||
'<@(icu_asm_opts)',
|
'<@(icu_asm_opts)',
|
||||||
@ -350,7 +350,7 @@
|
|||||||
'action_name': 'genccode',
|
'action_name': 'genccode',
|
||||||
'inputs': [ '<(SHARED_INTERMEDIATE_DIR)/icutmp/icusmdt<(icu_ver_major).dat' ],
|
'inputs': [ '<(SHARED_INTERMEDIATE_DIR)/icutmp/icusmdt<(icu_ver_major).dat' ],
|
||||||
'outputs': [ '<(SHARED_INTERMEDIATE_DIR)/icusmdt<(icu_ver_major)_dat.<(icu_asm_ext)' ],
|
'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)',
|
'<@(icu_asm_opts)',
|
||||||
'-d', '<(SHARED_INTERMEDIATE_DIR)',
|
'-d', '<(SHARED_INTERMEDIATE_DIR)',
|
||||||
'<@(_inputs)' ],
|
'<@(_inputs)' ],
|
||||||
@ -388,7 +388,7 @@
|
|||||||
'toolsets': [ 'target', 'host' ],
|
'toolsets': [ 'target', 'host' ],
|
||||||
'conditions' : [
|
'conditions' : [
|
||||||
['_toolset=="host"', {
|
['_toolset=="host"', {
|
||||||
'dependencies': [ 'icutools' ],
|
'dependencies': [ 'icutools#host' ],
|
||||||
'export_dependent_settings': [ 'icutools' ],
|
'export_dependent_settings': [ 'icutools' ],
|
||||||
}],
|
}],
|
||||||
['_toolset=="target"', {
|
['_toolset=="target"', {
|
||||||
|
@ -470,6 +470,11 @@
|
|||||||
'toolsets': ['target'],
|
'toolsets': ['target'],
|
||||||
'conditions': [
|
'conditions': [
|
||||||
['want_separate_host_toolset', {
|
['want_separate_host_toolset', {
|
||||||
|
'conditions': [
|
||||||
|
['v8_target_arch=="arm64"', {
|
||||||
|
'msvs_enable_marmasm': 1,
|
||||||
|
}]
|
||||||
|
],
|
||||||
'dependencies': [
|
'dependencies': [
|
||||||
'generate_bytecode_builtins_list',
|
'generate_bytecode_builtins_list',
|
||||||
'run_torque',
|
'run_torque',
|
||||||
@ -785,6 +790,14 @@
|
|||||||
'sources': [ ### gcmole(arch:arm64) ###
|
'sources': [ ### gcmole(arch:arm64) ###
|
||||||
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_base_without_compiler.*?v8_current_cpu == \\"arm64\\".*?sources \+= ")',
|
'<!@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"', {
|
['v8_target_arch=="mips" or v8_target_arch=="mipsel"', {
|
||||||
'sources': [ ### gcmole(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 openssl_no_asm set configure_flags=%configure_flags% --openssl-no-asm
|
||||||
if defined DEBUG_HELPER set configure_flags=%configure_flags% --verbose
|
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%"=="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 not exist "%~dp0deps\icu" goto no-depsicu
|
||||||
if "%target%"=="Clean" echo deleting %~dp0deps\icu
|
if "%target%"=="Clean" echo deleting %~dp0deps\icu
|
||||||
|
Loading…
x
Reference in New Issue
Block a user