@@ -28,7 +28,7 @@ def get_required_attr(config, attr_name):
2828# tests to prevent regressions.
2929# Currently, detect_leaks for asan tests only work on Intel MacOS.
3030if (
31- config .host_os == "Darwin"
31+ config .target_os == "Darwin"
3232 and config .apple_platform == "osx"
3333 and config .target_arch == "x86_64"
3434):
@@ -45,7 +45,7 @@ def get_required_attr(config, attr_name):
4545# Setup source root.
4646config .test_source_root = os .path .dirname (__file__ )
4747
48- if config .host_os not in ["FreeBSD" , "NetBSD" ]:
48+ if config .target_os not in ["FreeBSD" , "NetBSD" ]:
4949 libdl_flag = "-ldl"
5050else :
5151 libdl_flag = ""
@@ -125,17 +125,17 @@ def build_invocation(compile_flags, with_lto=False):
125125 ("%clangxx_asan_lto " , build_invocation (clang_asan_cxxflags , True ))
126126)
127127if config .asan_dynamic :
128- if config .host_os in ["Linux" , "FreeBSD" , "NetBSD" , "SunOS" ]:
128+ if config .target_os in ["Linux" , "FreeBSD" , "NetBSD" , "SunOS" ]:
129129 shared_libasan_path = os .path .join (
130130 config .compiler_rt_libdir ,
131131 "libclang_rt.asan{}.so" .format (config .target_suffix ),
132132 )
133- elif config .host_os == "Darwin" :
133+ elif config .target_os == "Darwin" :
134134 shared_libasan_path = os .path .join (
135135 config .compiler_rt_libdir ,
136136 "libclang_rt.asan_{}_dynamic.dylib" .format (config .apple_platform ),
137137 )
138- elif config .host_os == "Windows" :
138+ elif config .target_os == "Windows" :
139139 shared_libasan_path = os .path .join (
140140 config .compiler_rt_libdir ,
141141 "clang_rt.asan_dynamic-{}.lib" .format (config .target_suffix ),
@@ -274,16 +274,16 @@ def build_invocation(compile_flags, with_lto=False):
274274 and (config .target_arch in ["x86_64" , "i386" , "i686" , "aarch64" ])
275275)
276276leak_detection_linux = (
277- (config .host_os == "Linux" )
277+ (config .target_os == "Linux" )
278278 and (not config .android )
279279 and (config .target_arch in ["x86_64" , "i386" , "riscv64" , "loongarch64" ])
280280)
281281leak_detection_mac = (
282- (config .host_os == "Darwin" )
282+ (config .target_os == "Darwin" )
283283 and (config .apple_platform == "osx" )
284284 and (config .target_arch == "x86_64" )
285285)
286- leak_detection_netbsd = (config .host_os == "NetBSD" ) and (
286+ leak_detection_netbsd = (config .target_os == "NetBSD" ) and (
287287 config .target_arch in ["x86_64" , "i386" ]
288288)
289289if (
@@ -296,7 +296,7 @@ def build_invocation(compile_flags, with_lto=False):
296296
297297# Add the RT libdir to PATH directly so that we can successfully run the gtest
298298# binary to list its tests.
299- if config .host_os == "Windows" :
299+ if config .target_os == "Windows" :
300300 os .environ ["PATH" ] = os .path .pathsep .join (
301301 [config .compiler_rt_libdir , os .environ .get ("PATH" , "" )]
302302 )
@@ -310,10 +310,10 @@ def build_invocation(compile_flags, with_lto=False):
310310# Default test suffixes.
311311config .suffixes = [".c" , ".cpp" ]
312312
313- if config .host_os == "Darwin" :
313+ if config .target_os == "Darwin" :
314314 config .suffixes .append (".mm" )
315315
316- if config .host_os == "Windows" :
316+ if config .target_os == "Windows" :
317317 config .substitutions .append (("%fPIC" , "" ))
318318 config .substitutions .append (("%fPIE" , "" ))
319319 config .substitutions .append (("%pie" , "" ))
@@ -323,11 +323,11 @@ def build_invocation(compile_flags, with_lto=False):
323323 config .substitutions .append (("%pie" , "-pie" ))
324324
325325# 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" ]:
327327 config .unsupported = True
328328
329329if not config .parallelism_group :
330330 config .parallelism_group = "shadow-memory"
331331
332- if config .host_os == "NetBSD" :
332+ if config .target_os == "NetBSD" :
333333 config .substitutions .insert (0 , ("%run" , config .netbsd_noaslr_prefix ))
0 commit comments