blob: f07ab1e1872b9e8529a8c67bd0d0f2b4d93b6572 [file] [log] [blame]
Chandler Carrutha765ffc2012-06-25 08:40:10 +00001# First, add the subdirectories which contain feature-based runtime libraries
2# and several convenience helper libraries.
Alexey Samsonovb46941a2012-09-24 11:43:40 +00003if(CMAKE_SYSTEM_NAME MATCHES "Darwin|Linux")
Alexey Samsonov1c2a24e2012-09-19 14:15:30 +00004 # AddressSanitizer is supported on Linux and Mac OS X.
5 # Windows support is work in progress.
6 add_subdirectory(asan)
7 add_subdirectory(interception)
8 add_subdirectory(sanitizer_common)
Alexey Samsonov43b4b9c2013-01-18 16:51:07 +00009 if(NOT ANDROID)
Alexey Samsonov4df99d22013-03-25 14:20:11 +000010 add_subdirectory(profile)
Alexey Samsonov43b4b9c2013-01-18 16:51:07 +000011 add_subdirectory(ubsan)
Alexey Samsonovff86a5f2013-01-18 17:03:47 +000012 endif()
Alexey Samsonov1c2a24e2012-09-19 14:15:30 +000013endif()
Alexey Samsonov43b4b9c2013-01-18 16:51:07 +000014if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" AND NOT ANDROID)
Evgeniy Stepanov78c56c32012-12-11 12:27:27 +000015 # ThreadSanitizer and MemorySanitizer are supported on Linux only.
Alexey Samsonov06dc82d2012-09-19 13:11:13 +000016 add_subdirectory(tsan)
Evgeniy Stepanov78c56c32012-12-11 12:27:27 +000017 add_subdirectory(msan)
Evgeniy Stepanov79b2d172013-02-22 09:34:19 +000018 add_subdirectory(msandr)
Sergey Matveevf484ff32013-05-20 11:13:33 +000019 add_subdirectory(lsan)
Alexey Samsonov06dc82d2012-09-19 13:11:13 +000020endif()
Chandler Carruth0c870682012-06-22 21:09:10 +000021
Chandler Carruthd51e0a02012-04-04 22:12:04 +000022# The top-level lib directory contains a large amount of C code which provides
23# generic implementations of the core runtime library along with optimized
24# architecture-specific code in various subdirectories.
25
Chandler Carruth479d47f2012-06-20 10:18:43 +000026set(GENERIC_SOURCES
27 absvdi2.c
28 absvsi2.c
29 absvti2.c
30 adddf3.c
31 addsf3.c
32 addvdi3.c
33 addvsi3.c
34 addvti3.c
35 apple_versioning.c
36 ashldi3.c
37 ashlti3.c
38 ashrdi3.c
39 ashrti3.c
Alexey Samsonov84d0d7d2013-05-22 14:22:04 +000040 # FIXME: atomic.c may only be compiled if host compiler understands _Atomic
41 # atomic.c
Chandler Carruth479d47f2012-06-20 10:18:43 +000042 clear_cache.c
43 clzdi2.c
44 clzsi2.c
45 clzti2.c
46 cmpdi2.c
47 cmpti2.c
48 comparedf2.c
49 comparesf2.c
50 ctzdi2.c
51 ctzsi2.c
52 ctzti2.c
53 divdc3.c
54 divdf3.c
55 divdi3.c
56 divmoddi4.c
57 divmodsi4.c
58 divsc3.c
59 divsf3.c
60 divsi3.c
61 divti3.c
62 divxc3.c
63 enable_execute_stack.c
64 eprintf.c
65 extendsfdf2.c
66 ffsdi2.c
67 ffsti2.c
68 fixdfdi.c
69 fixdfsi.c
70 fixdfti.c
71 fixsfdi.c
72 fixsfsi.c
73 fixsfti.c
74 fixunsdfdi.c
75 fixunsdfsi.c
76 fixunsdfti.c
77 fixunssfdi.c
78 fixunssfsi.c
79 fixunssfti.c
80 fixunsxfdi.c
81 fixunsxfsi.c
82 fixunsxfti.c
83 fixxfdi.c
84 fixxfti.c
85 floatdidf.c
86 floatdisf.c
87 floatdixf.c
88 floatsidf.c
89 floatsisf.c
90 floattidf.c
91 floattisf.c
92 floattixf.c
93 floatundidf.c
94 floatundisf.c
95 floatundixf.c
96 floatunsidf.c
97 floatunsisf.c
98 floatuntidf.c
99 floatuntisf.c
100 floatuntixf.c
101 gcc_personality_v0.c
102 int_util.c
103 lshrdi3.c
104 lshrti3.c
105 moddi3.c
106 modsi3.c
107 modti3.c
108 muldc3.c
109 muldf3.c
110 muldi3.c
111 mulodi4.c
112 mulosi4.c
113 muloti4.c
114 mulsc3.c
115 mulsf3.c
116 multi3.c
117 mulvdi3.c
118 mulvsi3.c
119 mulvti3.c
120 mulxc3.c
121 negdf2.c
122 negdi2.c
123 negsf2.c
124 negti2.c
125 negvdi2.c
126 negvsi2.c
127 negvti2.c
128 paritydi2.c
129 paritysi2.c
130 parityti2.c
131 popcountdi2.c
132 popcountsi2.c
133 popcountti2.c
134 powidf2.c
135 powisf2.c
136 powitf2.c
137 powixf2.c
138 subdf3.c
139 subsf3.c
140 subvdi3.c
141 subvsi3.c
142 subvti3.c
143 trampoline_setup.c
144 truncdfsf2.c
145 ucmpdi2.c
146 ucmpti2.c
147 udivdi3.c
148 udivmoddi4.c
149 udivmodsi4.c
150 udivmodti4.c
151 udivsi3.c
152 udivti3.c
153 umoddi3.c
154 umodsi3.c
155 umodti3.c
156 )
Chandler Carruthd51e0a02012-04-04 22:12:04 +0000157
Alexey Samsonove16af952013-01-20 13:58:10 +0000158set(x86_64_SOURCES
159 x86_64/floatdidf.c
160 x86_64/floatdisf.c
161 x86_64/floatdixf.c
162 x86_64/floatundidf.S
163 x86_64/floatundisf.S
164 x86_64/floatundixf.S
165 ${GENERIC_SOURCES})
166
167set(i386_SOURCES
168 i386/ashldi3.S
169 i386/ashrdi3.S
170 i386/divdi3.S
171 i386/floatdidf.S
172 i386/floatdisf.S
173 i386/floatdixf.S
174 i386/floatundidf.S
175 i386/floatundisf.S
176 i386/floatundixf.S
177 i386/lshrdi3.S
178 i386/moddi3.S
179 i386/muldi3.S
180 i386/udivdi3.S
181 i386/umoddi3.S
182 ${GENERIC_SOURCES})
183
184foreach(arch x86_64 i386)
185 if(CAN_TARGET_${arch})
186 add_compiler_rt_static_runtime(clang_rt.${arch} ${arch}
187 SOURCES ${${arch}_SOURCES}
188 CFLAGS "-std=c99")
189 endif()
190endforeach()