Dan Willemsen | 9dd1a51 | 2015-09-11 13:04:31 -0700 | [diff] [blame] | 1 | // |
| 2 | // Copyright (C) 2012 The Android Open Source Project |
| 3 | // |
| 4 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | // you may not use this file except in compliance with the License. |
| 6 | // You may obtain a copy of the License at |
| 7 | // |
| 8 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | // |
| 10 | // Unless required by applicable law or agreed to in writing, software |
| 11 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | // See the License for the specific language governing permissions and |
| 14 | // limitations under the License. |
| 15 | // |
| 16 | // |
| 17 | |
| 18 | //===================================================================== |
| 19 | // Static Library: libcompiler_rt-extras |
| 20 | //===================================================================== |
| 21 | |
| 22 | cc_library_static { |
| 23 | name: "libcompiler_rt-extras", |
| 24 | host_supported: true, |
| 25 | clang: true, |
| 26 | // The following list contains functions that are not available in libgcc.a, so |
| 27 | // we potentially need them when using a Clang-built component (e.g., -ftrapv |
| 28 | // with 64-bit integer multiplies. See http://llvm.org/bugs/show_bug.cgi?id=14469.) |
| 29 | srcs: ["lib/builtins/mulodi4.c"], |
| 30 | sanitize: ["never"], |
| 31 | stl: "none", |
Dan Willemsen | dd3079a | 2015-11-30 15:58:44 -0800 | [diff] [blame] | 32 | |
| 33 | target: { |
| 34 | windows: { |
| 35 | enabled: true, |
| 36 | }, |
| 37 | }, |
Dan Willemsen | 9dd1a51 | 2015-09-11 13:04:31 -0700 | [diff] [blame] | 38 | } |
| 39 | |
| 40 | // Don't build compiler-rt without clang |
| 41 | // ANDROIDMK TRANSLATION ERROR: unsupported directive |
| 42 | // ifneq ($(WITHOUT_TARGET_CLANG), true) |
| 43 | //===================================================================== |
| 44 | // Device and Host Static Library: libcompiler_rt |
| 45 | //===================================================================== |
| 46 | |
| 47 | cc_library { |
| 48 | name: "libcompiler_rt", |
| 49 | host_supported: true, |
| 50 | // The following list contains platform-independent functionalities. |
| 51 | // |
| 52 | // Skip apple_versioning.c since it is unused. |
| 53 | // Skip atomic.c since it needs to be built separately according to the docs. |
| 54 | srcs: [ |
| 55 | "lib/builtins/absvdi2.c", |
| 56 | "lib/builtins/absvsi2.c", |
| 57 | "lib/builtins/absvti2.c", |
| 58 | "lib/builtins/adddf3.c", |
| 59 | "lib/builtins/addsf3.c", |
| 60 | "lib/builtins/addtf3.c", |
| 61 | "lib/builtins/addvdi3.c", |
| 62 | "lib/builtins/addvsi3.c", |
| 63 | "lib/builtins/addvti3.c", |
| 64 | "lib/builtins/ashldi3.c", |
| 65 | "lib/builtins/ashlti3.c", |
| 66 | "lib/builtins/ashrdi3.c", |
| 67 | "lib/builtins/ashrti3.c", |
| 68 | "lib/builtins/clear_cache.c", |
| 69 | "lib/builtins/clzdi2.c", |
| 70 | "lib/builtins/clzsi2.c", |
| 71 | "lib/builtins/clzti2.c", |
| 72 | "lib/builtins/cmpdi2.c", |
| 73 | "lib/builtins/cmpti2.c", |
| 74 | "lib/builtins/comparedf2.c", |
| 75 | "lib/builtins/comparesf2.c", |
| 76 | "lib/builtins/comparetf2.c", |
| 77 | "lib/builtins/ctzdi2.c", |
| 78 | "lib/builtins/ctzsi2.c", |
| 79 | "lib/builtins/ctzti2.c", |
| 80 | "lib/builtins/divdc3.c", |
| 81 | "lib/builtins/divdf3.c", |
| 82 | "lib/builtins/divdi3.c", |
| 83 | "lib/builtins/divmoddi4.c", |
| 84 | "lib/builtins/divmodsi4.c", |
| 85 | "lib/builtins/divsc3.c", |
| 86 | "lib/builtins/divsf3.c", |
| 87 | "lib/builtins/divsi3.c", |
| 88 | "lib/builtins/divtf3.c", |
| 89 | "lib/builtins/divti3.c", |
| 90 | "lib/builtins/divxc3.c", |
| 91 | "lib/builtins/eprintf.c", |
| 92 | "lib/builtins/extenddftf2.c", |
| 93 | "lib/builtins/extendhfsf2.c", |
| 94 | "lib/builtins/extendsfdf2.c", |
| 95 | "lib/builtins/extendsftf2.c", |
| 96 | "lib/builtins/ffsdi2.c", |
| 97 | "lib/builtins/ffsti2.c", |
| 98 | "lib/builtins/fixdfdi.c", |
| 99 | "lib/builtins/fixdfsi.c", |
| 100 | "lib/builtins/fixdfti.c", |
| 101 | "lib/builtins/fixsfdi.c", |
| 102 | "lib/builtins/fixsfsi.c", |
| 103 | "lib/builtins/fixsfti.c", |
| 104 | "lib/builtins/fixtfdi.c", |
| 105 | "lib/builtins/fixtfsi.c", |
| 106 | "lib/builtins/fixtfti.c", |
| 107 | "lib/builtins/fixunsdfdi.c", |
| 108 | "lib/builtins/fixunsdfsi.c", |
| 109 | "lib/builtins/fixunsdfti.c", |
| 110 | "lib/builtins/fixunssfdi.c", |
| 111 | "lib/builtins/fixunssfsi.c", |
| 112 | "lib/builtins/fixunssfti.c", |
| 113 | "lib/builtins/fixunstfdi.c", |
| 114 | "lib/builtins/fixunstfsi.c", |
| 115 | "lib/builtins/fixunstfti.c", |
| 116 | "lib/builtins/fixunsxfdi.c", |
| 117 | "lib/builtins/fixunsxfsi.c", |
| 118 | "lib/builtins/fixunsxfti.c", |
| 119 | "lib/builtins/fixxfdi.c", |
| 120 | "lib/builtins/fixxfti.c", |
| 121 | "lib/builtins/floatdidf.c", |
| 122 | "lib/builtins/floatdisf.c", |
| 123 | "lib/builtins/floatdixf.c", |
| 124 | "lib/builtins/floatsidf.c", |
| 125 | "lib/builtins/floatsisf.c", |
| 126 | "lib/builtins/floatsitf.c", |
| 127 | "lib/builtins/floattidf.c", |
| 128 | "lib/builtins/floattisf.c", |
| 129 | "lib/builtins/floattixf.c", |
| 130 | "lib/builtins/floatundidf.c", |
| 131 | "lib/builtins/floatundisf.c", |
| 132 | "lib/builtins/floatundixf.c", |
| 133 | "lib/builtins/floatunsidf.c", |
| 134 | "lib/builtins/floatunsisf.c", |
| 135 | "lib/builtins/floatunsitf.c", |
| 136 | "lib/builtins/floatuntidf.c", |
| 137 | "lib/builtins/floatuntisf.c", |
| 138 | "lib/builtins/floatuntixf.c", |
| 139 | "lib/builtins/gcc_personality_v0.c", |
| 140 | "lib/builtins/int_util.c", |
| 141 | "lib/builtins/lshrdi3.c", |
| 142 | "lib/builtins/lshrti3.c", |
| 143 | "lib/builtins/moddi3.c", |
| 144 | "lib/builtins/modsi3.c", |
| 145 | "lib/builtins/modti3.c", |
| 146 | "lib/builtins/muldc3.c", |
| 147 | "lib/builtins/muldf3.c", |
| 148 | "lib/builtins/muldi3.c", |
| 149 | "lib/builtins/mulodi4.c", |
| 150 | "lib/builtins/mulosi4.c", |
| 151 | "lib/builtins/muloti4.c", |
| 152 | "lib/builtins/mulsc3.c", |
| 153 | "lib/builtins/mulsf3.c", |
| 154 | "lib/builtins/multf3.c", |
| 155 | "lib/builtins/multi3.c", |
| 156 | "lib/builtins/mulvdi3.c", |
| 157 | "lib/builtins/mulvsi3.c", |
| 158 | "lib/builtins/mulvti3.c", |
| 159 | "lib/builtins/mulxc3.c", |
| 160 | "lib/builtins/negdf2.c", |
| 161 | "lib/builtins/negdi2.c", |
| 162 | "lib/builtins/negsf2.c", |
| 163 | "lib/builtins/negti2.c", |
| 164 | "lib/builtins/negvdi2.c", |
| 165 | "lib/builtins/negvsi2.c", |
| 166 | "lib/builtins/negvti2.c", |
| 167 | "lib/builtins/paritydi2.c", |
| 168 | "lib/builtins/paritysi2.c", |
| 169 | "lib/builtins/parityti2.c", |
| 170 | "lib/builtins/popcountdi2.c", |
| 171 | "lib/builtins/popcountsi2.c", |
| 172 | "lib/builtins/popcountti2.c", |
| 173 | "lib/builtins/powidf2.c", |
| 174 | "lib/builtins/powisf2.c", |
| 175 | "lib/builtins/powitf2.c", |
| 176 | "lib/builtins/powixf2.c", |
| 177 | "lib/builtins/subdf3.c", |
| 178 | "lib/builtins/subsf3.c", |
| 179 | "lib/builtins/subtf3.c", |
| 180 | "lib/builtins/subvdi3.c", |
| 181 | "lib/builtins/subvsi3.c", |
| 182 | "lib/builtins/subvti3.c", |
| 183 | "lib/builtins/trampoline_setup.c", |
| 184 | "lib/builtins/truncdfhf2.c", |
| 185 | "lib/builtins/truncdfsf2.c", |
| 186 | "lib/builtins/truncsfhf2.c", |
| 187 | "lib/builtins/trunctfdf2.c", |
| 188 | "lib/builtins/trunctfsf2.c", |
| 189 | "lib/builtins/ucmpdi2.c", |
| 190 | "lib/builtins/ucmpti2.c", |
| 191 | "lib/builtins/udivdi3.c", |
| 192 | "lib/builtins/udivmoddi4.c", |
| 193 | "lib/builtins/udivmodsi4.c", |
| 194 | "lib/builtins/udivmodti4.c", |
| 195 | "lib/builtins/udivsi3.c", |
| 196 | "lib/builtins/udivti3.c", |
| 197 | "lib/builtins/umoddi3.c", |
| 198 | "lib/builtins/umodsi3.c", |
| 199 | "lib/builtins/umodti3.c", |
| 200 | ], |
| 201 | |
| 202 | arch: { |
| 203 | arm: { |
| 204 | cflags: ["-D__ARM_EABI__"], |
| 205 | srcs: [ |
| 206 | "lib/builtins/arm/aeabi_dcmp.S", |
| 207 | "lib/builtins/arm/aeabi_div0.c", |
| 208 | "lib/builtins/arm/aeabi_fcmp.S", |
| 209 | "lib/builtins/arm/aeabi_idivmod.S", |
| 210 | "lib/builtins/arm/aeabi_ldivmod.S", |
| 211 | "lib/builtins/arm/aeabi_memcmp.S", |
| 212 | "lib/builtins/arm/aeabi_memcpy.S", |
| 213 | "lib/builtins/arm/aeabi_memmove.S", |
| 214 | "lib/builtins/arm/aeabi_memset.S", |
| 215 | "lib/builtins/arm/aeabi_uidivmod.S", |
| 216 | "lib/builtins/arm/aeabi_uldivmod.S", |
| 217 | "lib/builtins/arm/comparesf2.S", |
| 218 | "lib/builtins/arm/divmodsi4.S", |
| 219 | "lib/builtins/arm/divsi3.S", |
| 220 | "lib/builtins/arm/modsi3.S", |
| 221 | "lib/builtins/arm/udivmodsi4.S", |
| 222 | "lib/builtins/arm/udivsi3.S", |
| 223 | "lib/builtins/arm/umodsi3.S", |
| 224 | "lib/builtins/arm/adddf3vfp.S", |
| 225 | "lib/builtins/arm/addsf3vfp.S", |
| 226 | "lib/builtins/arm/divdf3vfp.S", |
| 227 | "lib/builtins/arm/divsf3vfp.S", |
| 228 | "lib/builtins/arm/eqdf2vfp.S", |
| 229 | "lib/builtins/arm/eqsf2vfp.S", |
| 230 | "lib/builtins/arm/extendsfdf2vfp.S", |
| 231 | "lib/builtins/arm/fixdfsivfp.S", |
| 232 | "lib/builtins/arm/fixsfsivfp.S", |
| 233 | "lib/builtins/arm/fixunsdfsivfp.S", |
| 234 | "lib/builtins/arm/fixunssfsivfp.S", |
| 235 | "lib/builtins/arm/floatsidfvfp.S", |
| 236 | "lib/builtins/arm/floatsisfvfp.S", |
| 237 | "lib/builtins/arm/floatunssidfvfp.S", |
| 238 | "lib/builtins/arm/floatunssisfvfp.S", |
| 239 | "lib/builtins/arm/gedf2vfp.S", |
| 240 | "lib/builtins/arm/gesf2vfp.S", |
| 241 | "lib/builtins/arm/gtdf2vfp.S", |
| 242 | "lib/builtins/arm/gtsf2vfp.S", |
| 243 | "lib/builtins/arm/ledf2vfp.S", |
| 244 | "lib/builtins/arm/lesf2vfp.S", |
| 245 | "lib/builtins/arm/ltdf2vfp.S", |
| 246 | "lib/builtins/arm/ltsf2vfp.S", |
| 247 | "lib/builtins/arm/muldf3vfp.S", |
| 248 | "lib/builtins/arm/mulsf3vfp.S", |
| 249 | "lib/builtins/arm/nedf2vfp.S", |
| 250 | "lib/builtins/arm/negdf2vfp.S", |
| 251 | "lib/builtins/arm/negsf2vfp.S", |
| 252 | "lib/builtins/arm/nesf2vfp.S", |
| 253 | "lib/builtins/arm/subdf3vfp.S", |
| 254 | "lib/builtins/arm/subsf3vfp.S", |
| 255 | "lib/builtins/arm/truncdfsf2vfp.S", |
| 256 | "lib/builtins/arm/unorddf2vfp.S", |
| 257 | "lib/builtins/arm/unordsf2vfp.S", |
| 258 | ], |
| 259 | exclude_srcs: [ |
| 260 | "lib/builtins/comparesf2.c", |
| 261 | "lib/builtins/divmodsi4.c", |
| 262 | "lib/builtins/divsi3.c", |
| 263 | "lib/builtins/modsi3.c", |
| 264 | "lib/builtins/udivmodsi4.c", |
| 265 | "lib/builtins/udivsi3.c", |
| 266 | "lib/builtins/umodsi3.c", |
| 267 | ], |
| 268 | }, |
| 269 | mips64: { |
| 270 | cflags: [ |
| 271 | "-DCRT_HAS_128BIT", |
| 272 | "-DCRT_LDBL_128BIT", |
| 273 | ], |
| 274 | }, |
| 275 | x86: { |
| 276 | srcs: [ |
| 277 | "lib/builtins/i386/ashldi3.S", |
| 278 | "lib/builtins/i386/ashrdi3.S", |
| 279 | "lib/builtins/i386/divdi3.S", |
| 280 | "lib/builtins/i386/floatdidf.S", |
| 281 | "lib/builtins/i386/floatdisf.S", |
| 282 | "lib/builtins/i386/floatdixf.S", |
| 283 | "lib/builtins/i386/floatundidf.S", |
| 284 | "lib/builtins/i386/floatundisf.S", |
| 285 | "lib/builtins/i386/floatundixf.S", |
| 286 | "lib/builtins/i386/lshrdi3.S", |
| 287 | "lib/builtins/i386/moddi3.S", |
| 288 | "lib/builtins/i386/muldi3.S", |
| 289 | "lib/builtins/i386/udivdi3.S", |
| 290 | "lib/builtins/i386/umoddi3.S", |
| 291 | ], |
| 292 | exclude_srcs: [ |
| 293 | "lib/builtins/ashldi3.c", |
| 294 | "lib/builtins/ashrdi3.c", |
| 295 | "lib/builtins/divdi3.c", |
| 296 | "lib/builtins/floatdidf.c", |
| 297 | "lib/builtins/floatdisf.c", |
| 298 | "lib/builtins/floatdixf.c", |
| 299 | "lib/builtins/floatundidf.c", |
| 300 | "lib/builtins/floatundisf.c", |
| 301 | "lib/builtins/floatundixf.c", |
| 302 | "lib/builtins/lshrdi3.c", |
| 303 | "lib/builtins/moddi3.c", |
| 304 | "lib/builtins/muldi3.c", |
| 305 | "lib/builtins/udivdi3.c", |
| 306 | "lib/builtins/umoddi3.c", |
| 307 | ], |
| 308 | }, |
| 309 | x86_64: { |
| 310 | srcs: [ |
| 311 | "lib/builtins/x86_64/floatundixf.S", |
| 312 | "lib/builtins/x86_64/floatdisf.c", |
| 313 | "lib/builtins/x86_64/floatdidf.c", |
| 314 | "lib/builtins/x86_64/floatdixf.c", |
| 315 | "lib/builtins/x86_64/floatundisf.S", |
| 316 | "lib/builtins/x86_64/floatundidf.S", |
| 317 | ], |
| 318 | exclude_srcs: [ |
| 319 | "lib/builtins/floatundixf.c", |
| 320 | "lib/builtins/floatdisf.c", |
| 321 | "lib/builtins/floatdidf.c", |
| 322 | "lib/builtins/floatdixf.c", |
| 323 | "lib/builtins/floatundisf.c", |
| 324 | "lib/builtins/floatundidf.c", |
| 325 | ], |
| 326 | }, |
| 327 | }, |
| 328 | |
| 329 | target: { |
| 330 | not_windows: { |
| 331 | // Only build enable_execute_stack.c on non-Windows hosts. |
| 332 | srcs: ["lib/builtins/enable_execute_stack.c"], |
| 333 | host_ldlibs: [ |
| 334 | "-lpthread", |
| 335 | "-lc", |
| 336 | "-lm", |
| 337 | ], |
| 338 | }, |
| 339 | android: { |
| 340 | srcs: ["lib/builtins/enable_execute_stack.c"], |
| 341 | shared_libs: ["libdl", "liblog"], |
| 342 | static_libs: ["liblzma"], |
| 343 | }, |
| 344 | android_arm: { |
| 345 | static_libs: ["libunwind_llvm"], |
| 346 | ldflags: ["-Wl,--exclude-libs,libunwind_llvm.a"], |
| 347 | }, |
| 348 | android_arm64: { |
Dan Willemsen | 5c64524 | 2016-02-03 22:27:15 -0800 | [diff] [blame] | 349 | // b/26968262 liblzma needs to be after libunwindbacktrace |
| 350 | static_libs: ["libunwindbacktrace","liblzma"], |
Dan Willemsen | 9dd1a51 | 2015-09-11 13:04:31 -0700 | [diff] [blame] | 351 | ldflags: ["-Wl,--exclude-libs,libunwindbacktrace.a"], |
| 352 | }, |
| 353 | android_mips: { |
Dan Willemsen | 5c64524 | 2016-02-03 22:27:15 -0800 | [diff] [blame] | 354 | // b/26968262 liblzma needs to be after libunwindbacktrace |
| 355 | static_libs: ["libunwindbacktrace","liblzma"], |
Dan Willemsen | 9dd1a51 | 2015-09-11 13:04:31 -0700 | [diff] [blame] | 356 | ldflags: ["-Wl,--exclude-libs,libunwindbacktrace.a"], |
| 357 | }, |
| 358 | android_mips64: { |
Dan Willemsen | 5c64524 | 2016-02-03 22:27:15 -0800 | [diff] [blame] | 359 | // b/26968262 liblzma needs to be after libunwindbacktrace |
| 360 | static_libs: ["libunwindbacktrace","liblzma"], |
Dan Willemsen | 9dd1a51 | 2015-09-11 13:04:31 -0700 | [diff] [blame] | 361 | ldflags: ["-Wl,--exclude-libs,libunwindbacktrace.a"], |
| 362 | }, |
| 363 | android_x86: { |
Dan Willemsen | 5c64524 | 2016-02-03 22:27:15 -0800 | [diff] [blame] | 364 | // b/26968262 liblzma needs to be after libunwindbacktrace |
| 365 | static_libs: ["libunwindbacktrace","liblzma"], |
Dan Willemsen | 9dd1a51 | 2015-09-11 13:04:31 -0700 | [diff] [blame] | 366 | ldflags: ["-Wl,--exclude-libs,libunwindbacktrace.a"], |
| 367 | }, |
| 368 | android_x86_64: { |
| 369 | srcs: ["lib/builtins/ppc/floatditf.c"], |
Dan Willemsen | 5c64524 | 2016-02-03 22:27:15 -0800 | [diff] [blame] | 370 | // b/26968262 liblzma needs to be after libunwindbacktrace |
| 371 | static_libs: ["libunwindbacktrace","liblzma"], |
Dan Willemsen | 9dd1a51 | 2015-09-11 13:04:31 -0700 | [diff] [blame] | 372 | ldflags: ["-Wl,--exclude-libs,libunwindbacktrace.a"], |
| 373 | }, |
| 374 | linux: { |
| 375 | static_libs: ["libunwindbacktrace"], |
| 376 | }, |
| 377 | }, |
| 378 | |
| 379 | asflags: ["-integrated-as"], |
| 380 | clang: true, |
| 381 | no_libgcc: true, |
| 382 | |
| 383 | sanitize: ["never"], |
| 384 | stl: "none", |
| 385 | } |
| 386 | |
| 387 | //===================================================================== |
| 388 | // Host and device Static Library: libprofile_rt |
| 389 | //===================================================================== |
| 390 | |
| 391 | cc_library_static { |
| 392 | name: "libprofile_rt", |
| 393 | host_supported: true, |
| 394 | clang: true, |
| 395 | sanitize: ["never"], |
| 396 | srcs: ["lib/profile/GCDAProfiling.c"], |
| 397 | |
| 398 | } |
| 399 | |
| 400 | // Build asan, lsan, etc. |
| 401 | // ANDROIDMK TRANSLATION ERROR: unsupported include |
| 402 | // include $(call all-makefiles-under,$(LOCAL_PATH)/lib) |
| 403 | // ANDROIDMK TRANSLATION ERROR: unsupported directive |
| 404 | // endif |