@@ -908,17 +908,24 @@ def source_compiler_rt_libs(path):
908
908
source_compiler_rt_libs (os .path .join (test_resource_dir , 'clang' , 'lib' ,
909
909
platform .system ().lower ()))
910
910
911
- def check_runtime_feature ( name ):
911
+ def check_runtime_libs ( features_to_check ):
912
912
for lib in config .compiler_rt_libs :
913
- if lib .startswith ('libclang_rt.' + name + '_' ):
914
- config .available_features .add (name + '_runtime' )
915
- return
916
-
917
- check_runtime_feature ('profile' )
918
- check_runtime_feature ('asan' )
919
- check_runtime_feature ('ubsan' )
920
- check_runtime_feature ('tsan' )
921
- check_runtime_feature ('safestack' )
913
+ for (libname , feature ) in features_to_check :
914
+ if lib .startswith ("libclang_rt." + libname + "_" ):
915
+ config .available_features .add (feature )
916
+
917
+ runtime_libs = [
918
+ ('profile' , 'profile_runtime' ),
919
+ ('asan' , 'asan_runtime' ),
920
+ ('ubsan' , 'ubsan_runtime' ),
921
+ ('tsan' , 'tsan_runtime' ),
922
+ ('safestack' , 'safestack_runtime' )
923
+ ]
924
+
925
+ if run_ptrsize != "32" :
926
+ runtime_libs .append (('tsan' , 'tsan_runtime' ))
927
+
928
+ check_runtime_libs (libs_to_check )
922
929
923
930
if not getattr (config , 'target_run_simple_swift' , None ):
924
931
config .target_run_simple_swift = (
0 commit comments