@@ -130,6 +130,11 @@ def build_invocation(compile_flags, with_lto=False):
130
130
config .compiler_rt_libdir ,
131
131
"libclang_rt.asan_{}_dynamic.dylib" .format (config .apple_platform ),
132
132
)
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
+ )
133
138
else :
134
139
lit_config .warning (
135
140
"%shared_libasan substitution not set but dynamic ASan is available."
@@ -178,8 +183,14 @@ def build_invocation(compile_flags, with_lto=False):
178
183
base_lib = os .path .join (
179
184
config .compiler_rt_libdir , "clang_rt.asan%%s%s.lib" % config .target_suffix
180
185
)
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 (("%asan_thunk" , base_lib % "_dynamic_runtime_thunk" ))
189
+ else :
190
+ config .substitutions .append (("%asan_thunk" , base_lib % "_static_runtime_thunk" ))
182
191
config .substitutions .append (("%asan_cxx_lib" , base_lib % "_cxx" ))
192
+ config .substitutions .append (("%asan_dynamic_runtime_thunk" , base_lib % "_dynamic_runtime_thunk" ))
193
+ config .substitutions .append (("%asan_static_runtime_thunk" , base_lib % "_static_runtime_thunk" ))
183
194
config .substitutions .append (("%asan_dll_thunk" , base_lib % "_dll_thunk" ))
184
195
else :
185
196
# To make some of these tests work on MinGW target without changing their
0 commit comments