Chandler Carruth | a765ffc | 2012-06-25 08:40:10 +0000 | [diff] [blame] | 1 | # First, add the subdirectories which contain feature-based runtime libraries |
| 2 | # and several convenience helper libraries. |
Alexey Samsonov | b46941a | 2012-09-24 11:43:40 +0000 | [diff] [blame] | 3 | if(CMAKE_SYSTEM_NAME MATCHES "Darwin|Linux") |
Alexey Samsonov | 1c2a24e | 2012-09-19 14:15:30 +0000 | [diff] [blame] | 4 | # 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 Samsonov | 43b4b9c | 2013-01-18 16:51:07 +0000 | [diff] [blame] | 9 | if(NOT ANDROID) |
Alexey Samsonov | 4df99d2 | 2013-03-25 14:20:11 +0000 | [diff] [blame] | 10 | add_subdirectory(profile) |
Alexey Samsonov | 43b4b9c | 2013-01-18 16:51:07 +0000 | [diff] [blame] | 11 | add_subdirectory(ubsan) |
Alexey Samsonov | ff86a5f | 2013-01-18 17:03:47 +0000 | [diff] [blame] | 12 | endif() |
Alexey Samsonov | 1c2a24e | 2012-09-19 14:15:30 +0000 | [diff] [blame] | 13 | endif() |
Alexey Samsonov | 43b4b9c | 2013-01-18 16:51:07 +0000 | [diff] [blame] | 14 | if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" AND NOT ANDROID) |
Evgeniy Stepanov | 78c56c3 | 2012-12-11 12:27:27 +0000 | [diff] [blame] | 15 | # ThreadSanitizer and MemorySanitizer are supported on Linux only. |
Alexey Samsonov | 06dc82d | 2012-09-19 13:11:13 +0000 | [diff] [blame] | 16 | add_subdirectory(tsan) |
Evgeniy Stepanov | 78c56c3 | 2012-12-11 12:27:27 +0000 | [diff] [blame] | 17 | add_subdirectory(msan) |
Evgeniy Stepanov | 79b2d17 | 2013-02-22 09:34:19 +0000 | [diff] [blame] | 18 | add_subdirectory(msandr) |
Sergey Matveev | f484ff3 | 2013-05-20 11:13:33 +0000 | [diff] [blame] | 19 | add_subdirectory(lsan) |
Alexey Samsonov | 06dc82d | 2012-09-19 13:11:13 +0000 | [diff] [blame] | 20 | endif() |
Chandler Carruth | 0c87068 | 2012-06-22 21:09:10 +0000 | [diff] [blame] | 21 | |
Chandler Carruth | d51e0a0 | 2012-04-04 22:12:04 +0000 | [diff] [blame] | 22 | # 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 Carruth | 479d47f | 2012-06-20 10:18:43 +0000 | [diff] [blame] | 26 | set(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 Samsonov | 84d0d7d | 2013-05-22 14:22:04 +0000 | [diff] [blame] | 40 | # FIXME: atomic.c may only be compiled if host compiler understands _Atomic |
| 41 | # atomic.c |
Chandler Carruth | 479d47f | 2012-06-20 10:18:43 +0000 | [diff] [blame] | 42 | 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 Carruth | d51e0a0 | 2012-04-04 22:12:04 +0000 | [diff] [blame] | 157 | |
Alexey Samsonov | e16af95 | 2013-01-20 13:58:10 +0000 | [diff] [blame] | 158 | set(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 | |
| 167 | set(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 | |
| 184 | foreach(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() |
| 190 | endforeach() |