Skip to content

Commit 95f67bb

Browse files
committed
[compiler-rt] [test] Only pass -incremental:no to the linker for MSVC/clang-cl
The target_is_msvc variable in lit.cfg.py matches a similar pattern used in the asan lit.cfg.py. Differential Revision: https://reviews.llvm.org/D147664
1 parent f2c9d24 commit 95f67bb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

compiler-rt/test/profile/lit.cfg.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# -*- Python -*-
22

33
import os
4+
import re
45

56
def get_required_attr(config, attr_name):
67
attr_value = getattr(config, attr_name, None)
@@ -22,9 +23,11 @@ def get_required_attr(config, attr_name):
2223
config.profile_lit_binary_dir is not None:
2324
config.test_exec_root = os.path.join(config.profile_lit_binary_dir, config.name)
2425

26+
target_is_msvc = bool(re.match(r'.*-windows-msvc$', config.target_triple))
27+
2528
if config.host_os in ['Linux']:
2629
extra_link_flags = ["-ldl"]
27-
elif config.host_os in ['Windows']:
30+
elif target_is_msvc:
2831
# InstrProf is incompatible with incremental linking. Disable it as a
2932
# workaround.
3033
extra_link_flags = ["-Wl,-incremental:no"]

0 commit comments

Comments
 (0)