Skip to content

Commit ac7946e

Browse files
richard-townsend-armtargos
authored andcommitted
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: #32867 Reviewed-By: Christian Clauss <[email protected]> Reviewed-By: João Reis <[email protected]>
1 parent 2384044 commit ac7946e

File tree

5 files changed

+28
-7
lines changed

5 files changed

+28
-7
lines changed

common.gypi

+5
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,11 @@
193193
],
194194
'msvs_settings': {
195195
'VCCLCompilerTool': {
196+
'conditions': [
197+
['target_arch=="arm64"', {
198+
'FloatingPointModel': 1 # /fp:strict
199+
}]
200+
],
196201
'EnableFunctionLevelLinking': 'true',
197202
'EnableIntrinsicFunctions': 'true',
198203
'FavorSizeOrSpeed': 1, # /Ot, favor speed over size

configure.py

+2
Original file line numberDiff line numberDiff line change
@@ -1041,6 +1041,8 @@ def configure_node(o):
10411041
cross_compiling = (options.cross_compiling
10421042
if options.cross_compiling is not None
10431043
else target_arch != host_arch)
1044+
if cross_compiling:
1045+
os.environ['GYP_CROSSCOMPILE'] = "1"
10441046
if options.unused_without_snapshot:
10451047
warn('building --without-snapshot is no longer possible')
10461048

tools/icu/icu-generic.gyp

+7-7
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@
197197
}],
198198
['_toolset=="host"', {
199199
'type': 'none',
200-
'dependencies': [ 'icutools' ],
200+
'dependencies': [ 'icutools#host' ],
201201
'export_dependent_settings': [ 'icutools' ],
202202
}],
203203
],
@@ -221,7 +221,7 @@
221221
'inputs': [ '<(icu_data_in)' ],
222222
'outputs': [ '<(SHARED_INTERMEDIATE_DIR)/icudt<(icu_ver_major)<(icu_endianness)_dat.<(icu_asm_ext)' ],
223223
# on Windows, we can go directly to .obj file (-o) option.
224-
'action': [ '<(PRODUCT_DIR)/genccode',
224+
'action': [ '<(PRODUCT_DIR)/genccode<(EXECUTABLE_SUFFIX)',
225225
'<@(icu_asm_opts)', # -o
226226
'-d', '<(SHARED_INTERMEDIATE_DIR)',
227227
'-n', 'icudata',
@@ -258,7 +258,7 @@
258258
'msvs_quote_cmd': 0,
259259
'inputs': [ '<(SHARED_INTERMEDIATE_DIR)/icutmp/icudt<(icu_ver_major)<(icu_endianness).dat' ],
260260
'outputs': [ '<(SHARED_INTERMEDIATE_DIR)/icudt<(icu_ver_major)<(icu_endianness)_dat.<(icu_asm_ext)' ],
261-
'action': [ '<(PRODUCT_DIR)/genccode',
261+
'action': [ '<(PRODUCT_DIR)/genccode<(EXECUTABLE_SUFFIX)',
262262
'<@(icu_asm_opts)', # -o
263263
'-d', '<(SHARED_INTERMEDIATE_DIR)/',
264264
'-n', 'icudata',
@@ -284,7 +284,7 @@
284284
'action_name': 'icupkg',
285285
'inputs': [ '<(icu_data_in)' ],
286286
'outputs':[ '<(SHARED_INTERMEDIATE_DIR)/icudt<(icu_ver_major)<(icu_endianness).dat' ],
287-
'action': [ '<(PRODUCT_DIR)/icupkg',
287+
'action': [ '<(PRODUCT_DIR)/icupkg<(EXECUTABLE_SUFFIX)',
288288
'-t<(icu_endianness)',
289289
'<@(_inputs)',
290290
'<@(_outputs)',
@@ -305,7 +305,7 @@
305305
'action_name': 'icudata',
306306
'inputs': [ '<(SHARED_INTERMEDIATE_DIR)/icudt<(icu_ver_major).dat' ],
307307
'outputs':[ '<(SHARED_INTERMEDIATE_DIR)/icudt<(icu_ver_major)_dat.<(icu_asm_ext)' ],
308-
'action': [ '<(PRODUCT_DIR)/genccode',
308+
'action': [ '<(PRODUCT_DIR)/genccode<(EXECUTABLE_SUFFIX)',
309309
'-e', 'icudt<(icu_ver_major)',
310310
'-d', '<(SHARED_INTERMEDIATE_DIR)',
311311
'<@(icu_asm_opts)',
@@ -350,7 +350,7 @@
350350
'action_name': 'genccode',
351351
'inputs': [ '<(SHARED_INTERMEDIATE_DIR)/icutmp/icusmdt<(icu_ver_major).dat' ],
352352
'outputs': [ '<(SHARED_INTERMEDIATE_DIR)/icusmdt<(icu_ver_major)_dat.<(icu_asm_ext)' ],
353-
'action': [ '<(PRODUCT_DIR)/genccode',
353+
'action': [ '<(PRODUCT_DIR)/genccode<(EXECUTABLE_SUFFIX)',
354354
'<@(icu_asm_opts)',
355355
'-d', '<(SHARED_INTERMEDIATE_DIR)',
356356
'<@(_inputs)' ],
@@ -388,7 +388,7 @@
388388
'toolsets': [ 'target', 'host' ],
389389
'conditions' : [
390390
['_toolset=="host"', {
391-
'dependencies': [ 'icutools' ],
391+
'dependencies': [ 'icutools#host' ],
392392
'export_dependent_settings': [ 'icutools' ],
393393
}],
394394
['_toolset=="target"', {

tools/v8_gypfiles/v8.gyp

+13
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,11 @@
461461
'toolsets': ['target'],
462462
'conditions': [
463463
['want_separate_host_toolset', {
464+
'conditions': [
465+
['v8_target_arch=="arm64"', {
466+
'msvs_enable_marmasm': 1,
467+
}]
468+
],
464469
'dependencies': [
465470
'generate_bytecode_builtins_list',
466471
'run_torque',
@@ -766,6 +771,14 @@
766771
'sources': [ ### gcmole(arch:arm64) ###
767772
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_base_without_compiler.*?v8_current_cpu == \\"arm64.*?sources \+= ")',
768773
],
774+
'conditions': [
775+
['OS=="win"', {
776+
'sources': [
777+
"<(V8_ROOT)/src/diagnostics/unwinding-info-win64.cc",
778+
"<(V8_ROOT)/src/diagnostics/unwinding-info-win64.h"
779+
],
780+
}],
781+
],
769782
}],
770783
['v8_target_arch=="mips" or v8_target_arch=="mipsel"', {
771784
'sources': [ ### gcmole(arch:mipsel) ###

vcbuild.bat

+1
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ if defined target_arch set configure_flags=%configure_flags% --dest-cpu=%ta
197197
if defined openssl_no_asm set configure_flags=%configure_flags% --openssl-no-asm
198198
if defined DEBUG_HELPER set configure_flags=%configure_flags% --verbose
199199
if "%target_arch%"=="x86" if "%PROCESSOR_ARCHITECTURE%"=="AMD64" set configure_flags=%configure_flags% --no-cross-compiling
200+
if "%target_arch%"=="arm64" set configure_flags=%configure_flags% --cross-compiling
200201

201202
if not exist "%~dp0deps\icu" goto no-depsicu
202203
if "%target%"=="Clean" echo deleting %~dp0deps\icu

0 commit comments

Comments
 (0)