@@ -940,9 +940,10 @@ class libcompiler_rt(MTLibrary, SjLjLibrary):
940940 # restriction soon: https://reviews.llvm.org/D71738
941941 force_object_files = True
942942
943- cflags = ['-fno-builtin' , '-DNDEBUG' ]
943+ cflags = ['-fno-builtin' , '-DNDEBUG' , '-DCOMPILER_RT_HAS_UNAME=1' ]
944944 src_dir = 'system/lib/compiler-rt/lib/builtins'
945- includes = ['system/lib/libc' ]
945+ profile_src_dir = 'system/lib/compiler-rt/lib/profile'
946+ includes = ['system/lib/libc' , 'system/lib/compiler-rt/include' ]
946947 excludes = [
947948 # gcc_personality_v0.c depends on libunwind, which don't include by default.
948949 'gcc_personality_v0.c' ,
@@ -970,6 +971,8 @@ class libcompiler_rt(MTLibrary, SjLjLibrary):
970971 'trunctfxf2.c' ,
971972 ]
972973 src_files = glob_in_path (src_dir , '*.c' , excludes = excludes )
974+ src_files += glob_in_path (profile_src_dir , '*.c' )
975+ src_files += glob_in_path (profile_src_dir , '*.cpp' )
973976 src_files += files_in_path (
974977 path = 'system/lib/compiler-rt' ,
975978 filenames = [
@@ -2082,15 +2085,6 @@ class CompilerRTLibrary(Library):
20822085 # restriction soon: https://reviews.llvm.org/D71738
20832086 force_object_files = True
20842087
2085- class libcompiler_rt_profile (Library ):
2086- name = 'libcompiler_rt_profile'
2087-
2088- cflags = ['-fno-builtin' , '-DCOMPILER_RT_HAS_UNAME=1' ]
2089- includes = ['system/lib/libc' , 'system/lib/compiler-rt/include' ]
2090- src_dir = 'system/lib/compiler-rt/lib/profile'
2091- src_files = glob_in_path (src_dir , '*.c' )
2092- src_files += glob_in_path (src_dir , '*.cpp' )
2093-
20942088class libubsan_minimal_rt (CompilerRTLibrary , MTLibrary ):
20952089 name = 'libubsan_minimal_rt'
20962090 never_force = True
@@ -2365,7 +2359,6 @@ def add_sanitizer_libs():
23652359
23662360 if only_forced :
23672361 add_library ('libcompiler_rt' )
2368- add_library ('libcompiler_rt_profile' )
23692362 add_sanitizer_libs ()
23702363 add_forced_libs ()
23712364 return libs_to_link
@@ -2403,7 +2396,6 @@ def add_sanitizer_libs():
24032396 elif settings .MALLOC != 'none' :
24042397 add_library ('libmalloc' )
24052398 add_library ('libcompiler_rt' )
2406- add_library ('libcompiler_rt_profile' )
24072399 if settings .LINK_AS_CXX :
24082400 add_library ('libc++' )
24092401 if settings .LINK_AS_CXX or sanitize :
0 commit comments