@@ -28,7 +28,7 @@ def get_required_attr(config, attr_name):
28
28
# tests to prevent regressions.
29
29
# Currently, detect_leaks for asan tests only work on Intel MacOS.
30
30
if (
31
- config .host_os == "Darwin"
31
+ config .target_os == "Darwin"
32
32
and config .apple_platform == "osx"
33
33
and config .target_arch == "x86_64"
34
34
):
@@ -45,7 +45,7 @@ def get_required_attr(config, attr_name):
45
45
# Setup source root.
46
46
config .test_source_root = os .path .dirname (__file__ )
47
47
48
- if config .host_os not in ["FreeBSD" , "NetBSD" ]:
48
+ if config .target_os not in ["FreeBSD" , "NetBSD" ]:
49
49
libdl_flag = "-ldl"
50
50
else :
51
51
libdl_flag = ""
@@ -125,17 +125,17 @@ def build_invocation(compile_flags, with_lto=False):
125
125
("%clangxx_asan_lto " , build_invocation (clang_asan_cxxflags , True ))
126
126
)
127
127
if config .asan_dynamic :
128
- if config .host_os in ["Linux" , "FreeBSD" , "NetBSD" , "SunOS" ]:
128
+ if config .target_os in ["Linux" , "FreeBSD" , "NetBSD" , "SunOS" ]:
129
129
shared_libasan_path = os .path .join (
130
130
config .compiler_rt_libdir ,
131
131
"libclang_rt.asan{}.so" .format (config .target_suffix ),
132
132
)
133
- elif config .host_os == "Darwin" :
133
+ elif config .target_os == "Darwin" :
134
134
shared_libasan_path = os .path .join (
135
135
config .compiler_rt_libdir ,
136
136
"libclang_rt.asan_{}_dynamic.dylib" .format (config .apple_platform ),
137
137
)
138
- elif config .host_os == "Windows" :
138
+ elif config .target_os == "Windows" :
139
139
shared_libasan_path = os .path .join (
140
140
config .compiler_rt_libdir ,
141
141
"clang_rt.asan_dynamic-{}.lib" .format (config .target_suffix ),
@@ -274,16 +274,16 @@ def build_invocation(compile_flags, with_lto=False):
274
274
and (config .target_arch in ["x86_64" , "i386" , "i686" , "aarch64" ])
275
275
)
276
276
leak_detection_linux = (
277
- (config .host_os == "Linux" )
277
+ (config .target_os == "Linux" )
278
278
and (not config .android )
279
279
and (config .target_arch in ["x86_64" , "i386" , "riscv64" , "loongarch64" ])
280
280
)
281
281
leak_detection_mac = (
282
- (config .host_os == "Darwin" )
282
+ (config .target_os == "Darwin" )
283
283
and (config .apple_platform == "osx" )
284
284
and (config .target_arch == "x86_64" )
285
285
)
286
- leak_detection_netbsd = (config .host_os == "NetBSD" ) and (
286
+ leak_detection_netbsd = (config .target_os == "NetBSD" ) and (
287
287
config .target_arch in ["x86_64" , "i386" ]
288
288
)
289
289
if (
@@ -296,7 +296,7 @@ def build_invocation(compile_flags, with_lto=False):
296
296
297
297
# Add the RT libdir to PATH directly so that we can successfully run the gtest
298
298
# binary to list its tests.
299
- if config .host_os == "Windows" :
299
+ if config .target_os == "Windows" :
300
300
os .environ ["PATH" ] = os .path .pathsep .join (
301
301
[config .compiler_rt_libdir , os .environ .get ("PATH" , "" )]
302
302
)
@@ -310,10 +310,10 @@ def build_invocation(compile_flags, with_lto=False):
310
310
# Default test suffixes.
311
311
config .suffixes = [".c" , ".cpp" ]
312
312
313
- if config .host_os == "Darwin" :
313
+ if config .target_os == "Darwin" :
314
314
config .suffixes .append (".mm" )
315
315
316
- if config .host_os == "Windows" :
316
+ if config .target_os == "Windows" :
317
317
config .substitutions .append (("%fPIC" , "" ))
318
318
config .substitutions .append (("%fPIE" , "" ))
319
319
config .substitutions .append (("%pie" , "" ))
@@ -323,11 +323,11 @@ def build_invocation(compile_flags, with_lto=False):
323
323
config .substitutions .append (("%pie" , "-pie" ))
324
324
325
325
# Only run the tests on supported OSs.
326
- if config .host_os not in ["Linux" , "Darwin" , "FreeBSD" , "SunOS" , "Windows" , "NetBSD" ]:
326
+ if config .target_os not in ["Linux" , "Darwin" , "FreeBSD" , "SunOS" , "Windows" , "NetBSD" ]:
327
327
config .unsupported = True
328
328
329
329
if not config .parallelism_group :
330
330
config .parallelism_group = "shadow-memory"
331
331
332
- if config .host_os == "NetBSD" :
332
+ if config .target_os == "NetBSD" :
333
333
config .substitutions .insert (0 , ("%run" , config .netbsd_noaslr_prefix ))
0 commit comments