@@ -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,22 @@ 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 (
189
+ ("%asan_thunk" , base_lib % "_dynamic_runtime_thunk" )
190
+ )
191
+ else :
192
+ config .substitutions .append (
193
+ ("%asan_thunk" , base_lib % "_static_runtime_thunk" )
194
+ )
182
195
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
+ )
183
202
config .substitutions .append (("%asan_dll_thunk" , base_lib % "_dll_thunk" ))
184
203
else :
185
204
# To make some of these tests work on MinGW target without changing their
0 commit comments