Skip to content

Commit 79a33a7

Browse files
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 9404d3a commit 79a33a7

File tree

2 files changed

+62
-29
lines changed

2 files changed

+62
-29
lines changed

tools/icu/icu-generic.gyp

+37-14
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

+25-15
Original file line numberDiff line numberDiff line change
@@ -1890,7 +1890,31 @@
18901890
['enable_lto=="true"', {
18911891
'cflags_cc': [ '-fno-lto' ],
18921892
}],
1893-
['clang==1 or OS!="win"', {
1893+
# Chnges in push_registers_asm.cc in V8 v12.8 requires using
1894+
# push_registers_masm on Windows even with ClangCL on x64
1895+
['OS=="win"', {
1896+
'conditions': [
1897+
['_toolset == "host" and host_arch == "x64" or _toolset == "target" and target_arch=="x64"', {
1898+
'sources': [
1899+
'<(V8_ROOT)/src/heap/base/asm/x64/push_registers_masm.asm',
1900+
],
1901+
}],
1902+
['_toolset == "host" and host_arch == "arm64" or _toolset == "target" and target_arch=="arm64"', {
1903+
'conditions': [
1904+
['clang==1', {
1905+
'sources': [
1906+
'<(V8_ROOT)/src/heap/base/asm/arm64/push_registers_asm.cc',
1907+
],
1908+
}],
1909+
['clang==0', {
1910+
'sources': [
1911+
'<(V8_ROOT)/src/heap/base/asm/arm64/push_registers_masm.S',
1912+
],
1913+
}],
1914+
],
1915+
}],
1916+
],
1917+
}, { # 'OS!="win"'
18941918
'conditions': [
18951919
['_toolset == "host" and host_arch == "x64" or _toolset == "target" and target_arch=="x64"', {
18961920
'sources': [
@@ -1939,20 +1963,6 @@
19391963
}],
19401964
]
19411965
}],
1942-
['OS=="win" and clang==0', {
1943-
'conditions': [
1944-
['_toolset == "host" and host_arch == "x64" or _toolset == "target" and target_arch=="x64"', {
1945-
'sources': [
1946-
'<(V8_ROOT)/src/heap/base/asm/x64/push_registers_masm.asm',
1947-
],
1948-
}],
1949-
['_toolset == "host" and host_arch == "arm64" or _toolset == "target" and target_arch=="arm64"', {
1950-
'sources': [
1951-
'<(V8_ROOT)/src/heap/base/asm/arm64/push_registers_masm.S',
1952-
],
1953-
}],
1954-
],
1955-
}],
19561966
],
19571967
},
19581968
}, # v8_heap_base

0 commit comments

Comments
 (0)