Skip to content

Commit e38e305

Browse files
StefanStojanovicRafaelGSS
authored andcommitted
build,win: enable clang-cl compilation
This uses the backported ICU fix needed for compiling with ClangCL. Refs: #54502 Fixes: #34201 PR-URL: #54655 Refs: #52809 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Steven R Loomis <[email protected]>
1 parent 2b68c30 commit e38e305

File tree

2 files changed

+62
-15
lines changed

2 files changed

+62
-15
lines changed

tools/icu/icu-generic.gyp

Lines changed: 37 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -139,20 +139,43 @@
139139
# full data - just build the full data file, then we are done.
140140
'sources': [ '<(SHARED_INTERMEDIATE_DIR)/icudt<(icu_ver_major)<(icu_endianness)_dat.<(icu_asm_ext)' ],
141141
'dependencies': [ 'genccode#host' ],
142-
'actions': [
143-
{
144-
'action_name': 'icudata',
145-
'msvs_quote_cmd': 0,
146-
'inputs': [ '<(icu_data_in)' ],
147-
'outputs': [ '<(SHARED_INTERMEDIATE_DIR)/icudt<(icu_ver_major)<(icu_endianness)_dat.<(icu_asm_ext)' ],
148-
# on Windows, we can go directly to .obj file (-o) option.
149-
'action': [ '<(PRODUCT_DIR)/genccode<(EXECUTABLE_SUFFIX)',
150-
'<@(icu_asm_opts)', # -o
151-
'-d', '<(SHARED_INTERMEDIATE_DIR)',
152-
'-n', 'icudata',
153-
'-e', 'icudt<(icu_ver_major)',
154-
'<@(_inputs)' ],
155-
},
142+
'conditions': [
143+
[ 'clang==1', {
144+
'actions': [
145+
{
146+
'action_name': 'icudata',
147+
'msvs_quote_cmd': 0,
148+
'inputs': [ '<(icu_data_in)' ],
149+
'outputs': [ '<(SHARED_INTERMEDIATE_DIR)/icudt<(icu_ver_major)<(icu_endianness)_dat.<(icu_asm_ext)' ],
150+
# on Windows, we can go directly to .obj file (-o) option.
151+
# for Clang use "-c <(target_arch)" option
152+
'action': [ '<(PRODUCT_DIR)/genccode<(EXECUTABLE_SUFFIX)',
153+
'<@(icu_asm_opts)', # -o
154+
'-c', '<(target_arch)',
155+
'-d', '<(SHARED_INTERMEDIATE_DIR)',
156+
'-n', 'icudata',
157+
'-e', 'icudt<(icu_ver_major)',
158+
'<@(_inputs)' ],
159+
},
160+
],
161+
}, {
162+
'actions': [
163+
{
164+
'action_name': 'icudata',
165+
'msvs_quote_cmd': 0,
166+
'inputs': [ '<(icu_data_in)' ],
167+
'outputs': [ '<(SHARED_INTERMEDIATE_DIR)/icudt<(icu_ver_major)<(icu_endianness)_dat.<(icu_asm_ext)' ],
168+
# on Windows, we can go directly to .obj file (-o) option.
169+
# for MSVC do not use "-c <(target_arch)" option
170+
'action': [ '<(PRODUCT_DIR)/genccode<(EXECUTABLE_SUFFIX)',
171+
'<@(icu_asm_opts)', # -o
172+
'-d', '<(SHARED_INTERMEDIATE_DIR)',
173+
'-n', 'icudata',
174+
'-e', 'icudt<(icu_ver_major)',
175+
'<@(_inputs)' ],
176+
},
177+
],
178+
}]
156179
],
157180
}, { # icu_small == TRUE and OS == win
158181
# link against stub data primarily

tools/v8_gypfiles/v8.gyp

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1897,7 +1897,31 @@
18971897
['enable_lto=="true"', {
18981898
'cflags_cc': [ '-fno-lto' ],
18991899
}],
1900-
['clang==1 or OS!="win"', {
1900+
# Chnges in push_registers_asm.cc in V8 v12.8 requires using
1901+
# push_registers_masm on Windows even with ClangCL on x64
1902+
['OS=="win"', {
1903+
'conditions': [
1904+
['_toolset == "host" and host_arch == "x64" or _toolset == "target" and target_arch=="x64"', {
1905+
'sources': [
1906+
'<(V8_ROOT)/src/heap/base/asm/x64/push_registers_masm.asm',
1907+
],
1908+
}],
1909+
['_toolset == "host" and host_arch == "arm64" or _toolset == "target" and target_arch=="arm64"', {
1910+
'conditions': [
1911+
['clang==1', {
1912+
'sources': [
1913+
'<(V8_ROOT)/src/heap/base/asm/arm64/push_registers_asm.cc',
1914+
],
1915+
}],
1916+
['clang==0', {
1917+
'sources': [
1918+
'<(V8_ROOT)/src/heap/base/asm/arm64/push_registers_masm.S',
1919+
],
1920+
}],
1921+
],
1922+
}],
1923+
],
1924+
}, { # 'OS!="win"'
19011925
'conditions': [
19021926
['_toolset == "host" and host_arch == "x64" or _toolset == "target" and target_arch=="x64"', {
19031927
'sources': [

0 commit comments

Comments
 (0)