Skip to content

Commit 37a2cc9

Browse files
committed
add new substitutions to the tests to support the new static/dynamic runtime thunks
and the fact we're "always" using the dynamic asan runtime. python formatting
1 parent 9004911 commit 37a2cc9

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

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

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,11 @@ def build_invocation(compile_flags, with_lto=False):
130130
config.compiler_rt_libdir,
131131
"libclang_rt.asan_{}_dynamic.dylib".format(config.apple_platform),
132132
)
133+
elif config.host_os == "Windows":
134+
shared_libasan_path = os.path.join(
135+
config.compiler_rt_libdir,
136+
"clang_rt.asan_dynamic-{}.lib".format(config.target_suffix),
137+
)
133138
else:
134139
lit_config.warning(
135140
"%shared_libasan substitution not set but dynamic ASan is available."
@@ -178,8 +183,22 @@ def build_invocation(compile_flags, with_lto=False):
178183
base_lib = os.path.join(
179184
config.compiler_rt_libdir, "clang_rt.asan%%s%s.lib" % config.target_suffix
180185
)
181-
config.substitutions.append(("%asan_lib", base_lib % ""))
186+
config.substitutions.append(("%asan_lib", base_lib % "_dynamic"))
187+
if config.asan_dynamic:
188+
config.substitutions.append(
189+
("%asan_thunk", base_lib % "_dynamic_runtime_thunk")
190+
)
191+
else:
192+
config.substitutions.append(
193+
("%asan_thunk", base_lib % "_static_runtime_thunk")
194+
)
182195
config.substitutions.append(("%asan_cxx_lib", base_lib % "_cxx"))
196+
config.substitutions.append(
197+
("%asan_dynamic_runtime_thunk", base_lib % "_dynamic_runtime_thunk")
198+
)
199+
config.substitutions.append(
200+
("%asan_static_runtime_thunk", base_lib % "_static_runtime_thunk")
201+
)
183202
config.substitutions.append(("%asan_dll_thunk", base_lib % "_dll_thunk"))
184203
else:
185204
# To make some of these tests work on MinGW target without changing their

0 commit comments

Comments
 (0)