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 22cc_library_static { 23 name: "libcompiler_rt-extras", 24 host_supported: true, 25 vendor_available: true, 26 clang: true, 27 sdk_version: "9", 28 // The following list contains functions that are not available in libgcc.a, so 29 // we potentially need them when using a Clang-built component (e.g., -ftrapv 30 // with 64-bit integer multiplies. See http://llvm.org/bugs/show_bug.cgi?id=14469.) 31 srcs: ["lib/builtins/mulodi4.c"], 32 sanitize: { 33 never: true, 34 }, 35 stl: "none", 36 37 cflags: [ 38 "-Wno-unused-parameter", 39 "-Werror", 40 ], 41 42 arch: { 43 mips: { 44 srcs: ["lib/builtins/clear_cache.c"], 45 }, 46 mips64: { 47 srcs: ["lib/builtins/clear_cache.c"], 48 }, 49 // Clang generates call to __unorddf2 builtin when compiling s_fmal.c 50 // in bionic. Generate this builtin from compiler-rt for arm64 and 51 // x86_64 (where the corresponding libgcc does not have this builtin. 52 arm64: { 53 srcs: ["lib/builtins/comparedf2.c"], 54 }, 55 x86_64: { 56 srcs: ["lib/builtins/comparedf2.c"], 57 }, 58 }, 59 60 target: { 61 linux_bionic: { 62 enabled: true, 63 }, 64 windows: { 65 enabled: true, 66 }, 67 }, 68} 69 70//===================================================================== 71// Device and Host Static Library: libcompiler_rt 72//===================================================================== 73 74cc_library { 75 name: "libcompiler_rt", 76 vendor_available: true, 77 vndk: { 78 enabled: true, 79 support_system_process: true, 80 }, 81 host_supported: true, 82 // The following list contains platform-independent functionalities. 83 // 84 // Skip apple_versioning.c since it is unused. 85 // Skip atomic.c since it needs to be built separately according to the docs. 86 srcs: [ 87 "lib/builtins/enable_execute_stack.c", 88 "lib/builtins/absvdi2.c", 89 "lib/builtins/absvsi2.c", 90 "lib/builtins/absvti2.c", 91 "lib/builtins/adddf3.c", 92 "lib/builtins/addsf3.c", 93 "lib/builtins/addtf3.c", 94 "lib/builtins/addvdi3.c", 95 "lib/builtins/addvsi3.c", 96 "lib/builtins/addvti3.c", 97 "lib/builtins/ashldi3.c", 98 "lib/builtins/ashlti3.c", 99 "lib/builtins/ashrdi3.c", 100 "lib/builtins/ashrti3.c", 101 "lib/builtins/clear_cache.c", 102 "lib/builtins/clzdi2.c", 103 "lib/builtins/clzsi2.c", 104 "lib/builtins/clzti2.c", 105 "lib/builtins/cmpdi2.c", 106 "lib/builtins/cmpti2.c", 107 "lib/builtins/comparedf2.c", 108 "lib/builtins/comparesf2.c", 109 "lib/builtins/comparetf2.c", 110 "lib/builtins/ctzdi2.c", 111 "lib/builtins/ctzsi2.c", 112 "lib/builtins/ctzti2.c", 113 "lib/builtins/divdc3.c", 114 "lib/builtins/divdf3.c", 115 "lib/builtins/divdi3.c", 116 "lib/builtins/divmoddi4.c", 117 "lib/builtins/divmodsi4.c", 118 "lib/builtins/divsc3.c", 119 "lib/builtins/divsf3.c", 120 "lib/builtins/divsi3.c", 121 "lib/builtins/divtf3.c", 122 "lib/builtins/divti3.c", 123 "lib/builtins/divxc3.c", 124 "lib/builtins/eprintf.c", 125 "lib/builtins/extenddftf2.c", 126 "lib/builtins/extendhfsf2.c", 127 "lib/builtins/extendsfdf2.c", 128 "lib/builtins/extendsftf2.c", 129 "lib/builtins/ffsdi2.c", 130 "lib/builtins/ffsti2.c", 131 "lib/builtins/fixdfdi.c", 132 "lib/builtins/fixdfsi.c", 133 "lib/builtins/fixdfti.c", 134 "lib/builtins/fixsfdi.c", 135 "lib/builtins/fixsfsi.c", 136 "lib/builtins/fixsfti.c", 137 "lib/builtins/fixtfdi.c", 138 "lib/builtins/fixtfsi.c", 139 "lib/builtins/fixtfti.c", 140 "lib/builtins/fixunsdfdi.c", 141 "lib/builtins/fixunsdfsi.c", 142 "lib/builtins/fixunsdfti.c", 143 "lib/builtins/fixunssfdi.c", 144 "lib/builtins/fixunssfsi.c", 145 "lib/builtins/fixunssfti.c", 146 "lib/builtins/fixunstfdi.c", 147 "lib/builtins/fixunstfsi.c", 148 "lib/builtins/fixunstfti.c", 149 "lib/builtins/fixunsxfdi.c", 150 "lib/builtins/fixunsxfsi.c", 151 "lib/builtins/fixunsxfti.c", 152 "lib/builtins/fixxfdi.c", 153 "lib/builtins/fixxfti.c", 154 "lib/builtins/floatdidf.c", 155 "lib/builtins/floatdisf.c", 156 "lib/builtins/floatdixf.c", 157 "lib/builtins/floatsidf.c", 158 "lib/builtins/floatsisf.c", 159 "lib/builtins/floatsitf.c", 160 "lib/builtins/floattidf.c", 161 "lib/builtins/floattisf.c", 162 "lib/builtins/floattixf.c", 163 "lib/builtins/floatundidf.c", 164 "lib/builtins/floatundisf.c", 165 "lib/builtins/floatundixf.c", 166 "lib/builtins/floatunsidf.c", 167 "lib/builtins/floatunsisf.c", 168 "lib/builtins/floatunsitf.c", 169 "lib/builtins/floatuntidf.c", 170 "lib/builtins/floatuntisf.c", 171 "lib/builtins/floatuntixf.c", 172 "lib/builtins/gcc_personality_v0.c", 173 "lib/builtins/int_util.c", 174 "lib/builtins/lshrdi3.c", 175 "lib/builtins/lshrti3.c", 176 "lib/builtins/moddi3.c", 177 "lib/builtins/modsi3.c", 178 "lib/builtins/modti3.c", 179 "lib/builtins/muldc3.c", 180 "lib/builtins/muldf3.c", 181 "lib/builtins/muldi3.c", 182 "lib/builtins/mulodi4.c", 183 "lib/builtins/mulosi4.c", 184 "lib/builtins/muloti4.c", 185 "lib/builtins/mulsc3.c", 186 "lib/builtins/mulsf3.c", 187 "lib/builtins/multf3.c", 188 "lib/builtins/multi3.c", 189 "lib/builtins/mulvdi3.c", 190 "lib/builtins/mulvsi3.c", 191 "lib/builtins/mulvti3.c", 192 "lib/builtins/mulxc3.c", 193 "lib/builtins/negdf2.c", 194 "lib/builtins/negdi2.c", 195 "lib/builtins/negsf2.c", 196 "lib/builtins/negti2.c", 197 "lib/builtins/negvdi2.c", 198 "lib/builtins/negvsi2.c", 199 "lib/builtins/negvti2.c", 200 "lib/builtins/paritydi2.c", 201 "lib/builtins/paritysi2.c", 202 "lib/builtins/parityti2.c", 203 "lib/builtins/popcountdi2.c", 204 "lib/builtins/popcountsi2.c", 205 "lib/builtins/popcountti2.c", 206 "lib/builtins/powidf2.c", 207 "lib/builtins/powisf2.c", 208 "lib/builtins/powitf2.c", 209 "lib/builtins/powixf2.c", 210 "lib/builtins/subdf3.c", 211 "lib/builtins/subsf3.c", 212 "lib/builtins/subtf3.c", 213 "lib/builtins/subvdi3.c", 214 "lib/builtins/subvsi3.c", 215 "lib/builtins/subvti3.c", 216 "lib/builtins/trampoline_setup.c", 217 "lib/builtins/truncdfhf2.c", 218 "lib/builtins/truncdfsf2.c", 219 "lib/builtins/truncsfhf2.c", 220 "lib/builtins/trunctfdf2.c", 221 "lib/builtins/trunctfsf2.c", 222 "lib/builtins/ucmpdi2.c", 223 "lib/builtins/ucmpti2.c", 224 "lib/builtins/udivdi3.c", 225 "lib/builtins/udivmoddi4.c", 226 "lib/builtins/udivmodsi4.c", 227 "lib/builtins/udivmodti4.c", 228 "lib/builtins/udivsi3.c", 229 "lib/builtins/udivti3.c", 230 "lib/builtins/umoddi3.c", 231 "lib/builtins/umodsi3.c", 232 "lib/builtins/umodti3.c", 233 ], 234 235 cflags: [ 236 "-Wno-unused-parameter", 237 "-Werror", 238 ], 239 240 arch: { 241 arm: { 242 cflags: ["-D__ARM_EABI__"], 243 srcs: [ 244 "lib/builtins/arm/aeabi_dcmp.S", 245 "lib/builtins/arm/aeabi_div0.c", 246 "lib/builtins/arm/aeabi_fcmp.S", 247 "lib/builtins/arm/aeabi_idivmod.S", 248 "lib/builtins/arm/aeabi_ldivmod.S", 249 "lib/builtins/arm/aeabi_memcmp.S", 250 "lib/builtins/arm/aeabi_memcpy.S", 251 "lib/builtins/arm/aeabi_memmove.S", 252 "lib/builtins/arm/aeabi_memset.S", 253 "lib/builtins/arm/aeabi_uidivmod.S", 254 "lib/builtins/arm/aeabi_uldivmod.S", 255 "lib/builtins/arm/comparesf2.S", 256 "lib/builtins/arm/divmodsi4.S", 257 "lib/builtins/arm/divsi3.S", 258 "lib/builtins/arm/modsi3.S", 259 "lib/builtins/arm/udivmodsi4.S", 260 "lib/builtins/arm/udivsi3.S", 261 "lib/builtins/arm/umodsi3.S", 262 "lib/builtins/arm/adddf3vfp.S", 263 "lib/builtins/arm/addsf3vfp.S", 264 "lib/builtins/arm/divdf3vfp.S", 265 "lib/builtins/arm/divsf3vfp.S", 266 "lib/builtins/arm/eqdf2vfp.S", 267 "lib/builtins/arm/eqsf2vfp.S", 268 "lib/builtins/arm/extendsfdf2vfp.S", 269 "lib/builtins/arm/fixdfsivfp.S", 270 "lib/builtins/arm/fixsfsivfp.S", 271 "lib/builtins/arm/fixunsdfsivfp.S", 272 "lib/builtins/arm/fixunssfsivfp.S", 273 "lib/builtins/arm/floatsidfvfp.S", 274 "lib/builtins/arm/floatsisfvfp.S", 275 "lib/builtins/arm/floatunssidfvfp.S", 276 "lib/builtins/arm/floatunssisfvfp.S", 277 "lib/builtins/arm/gedf2vfp.S", 278 "lib/builtins/arm/gesf2vfp.S", 279 "lib/builtins/arm/gtdf2vfp.S", 280 "lib/builtins/arm/gtsf2vfp.S", 281 "lib/builtins/arm/ledf2vfp.S", 282 "lib/builtins/arm/lesf2vfp.S", 283 "lib/builtins/arm/ltdf2vfp.S", 284 "lib/builtins/arm/ltsf2vfp.S", 285 "lib/builtins/arm/muldf3vfp.S", 286 "lib/builtins/arm/mulsf3vfp.S", 287 "lib/builtins/arm/nedf2vfp.S", 288 "lib/builtins/arm/negdf2vfp.S", 289 "lib/builtins/arm/negsf2vfp.S", 290 "lib/builtins/arm/nesf2vfp.S", 291 "lib/builtins/arm/subdf3vfp.S", 292 "lib/builtins/arm/subsf3vfp.S", 293 "lib/builtins/arm/truncdfsf2vfp.S", 294 "lib/builtins/arm/unorddf2vfp.S", 295 "lib/builtins/arm/unordsf2vfp.S", 296 ], 297 exclude_srcs: [ 298 "lib/builtins/comparesf2.c", 299 "lib/builtins/divmodsi4.c", 300 "lib/builtins/divsi3.c", 301 "lib/builtins/modsi3.c", 302 "lib/builtins/udivmodsi4.c", 303 "lib/builtins/udivsi3.c", 304 "lib/builtins/umodsi3.c", 305 ], 306 }, 307 mips64: { 308 cflags: [ 309 "-DCRT_HAS_128BIT", 310 ], 311 }, 312 x86: { 313 srcs: [ 314 "lib/builtins/i386/ashldi3.S", 315 "lib/builtins/i386/ashrdi3.S", 316 "lib/builtins/i386/divdi3.S", 317 "lib/builtins/i386/floatdidf.S", 318 "lib/builtins/i386/floatdisf.S", 319 "lib/builtins/i386/floatdixf.S", 320 "lib/builtins/i386/floatundidf.S", 321 "lib/builtins/i386/floatundisf.S", 322 "lib/builtins/i386/floatundixf.S", 323 "lib/builtins/i386/lshrdi3.S", 324 "lib/builtins/i386/moddi3.S", 325 "lib/builtins/i386/muldi3.S", 326 "lib/builtins/i386/udivdi3.S", 327 "lib/builtins/i386/umoddi3.S", 328 ], 329 exclude_srcs: [ 330 "lib/builtins/ashldi3.c", 331 "lib/builtins/ashrdi3.c", 332 "lib/builtins/divdi3.c", 333 "lib/builtins/floatdidf.c", 334 "lib/builtins/floatdisf.c", 335 "lib/builtins/floatdixf.c", 336 "lib/builtins/floatundidf.c", 337 "lib/builtins/floatundisf.c", 338 "lib/builtins/floatundixf.c", 339 "lib/builtins/lshrdi3.c", 340 "lib/builtins/moddi3.c", 341 "lib/builtins/muldi3.c", 342 "lib/builtins/udivdi3.c", 343 "lib/builtins/umoddi3.c", 344 ], 345 }, 346 x86_64: { 347 srcs: [ 348 "lib/builtins/x86_64/floatundixf.S", 349 "lib/builtins/x86_64/floatdisf.c", 350 "lib/builtins/x86_64/floatdidf.c", 351 "lib/builtins/x86_64/floatdixf.c", 352 "lib/builtins/x86_64/floatundisf.S", 353 "lib/builtins/x86_64/floatundidf.S", 354 ], 355 exclude_srcs: [ 356 "lib/builtins/floatundixf.c", 357 "lib/builtins/floatdisf.c", 358 "lib/builtins/floatdidf.c", 359 "lib/builtins/floatdixf.c", 360 "lib/builtins/floatundisf.c", 361 "lib/builtins/floatundidf.c", 362 ], 363 }, 364 }, 365 366 sdk_version: "21", 367 target: { 368 not_windows: { 369 host_ldlibs: [ 370 "-lpthread", 371 "-lc", 372 "-lm", 373 ], 374 }, 375 android: { 376 shared_libs: ["libdl", "liblog"], 377 static_libs: ["liblzma"], 378 }, 379 android_arm: { 380 static_libs: ["libunwind_llvm"], 381 ldflags: ["-Wl,--exclude-libs,libunwind_llvm.a"], 382 }, 383 android_arm64: { 384 static_libs: ["libunwindbacktrace"], 385 ldflags: ["-Wl,--exclude-libs,libunwindbacktrace.a"], 386 }, 387 android_mips: { 388 static_libs: ["libunwindbacktrace"], 389 ldflags: ["-Wl,--exclude-libs,libunwindbacktrace.a"], 390 }, 391 android_mips64: { 392 static_libs: ["libunwindbacktrace"], 393 ldflags: ["-Wl,--exclude-libs,libunwindbacktrace.a"], 394 }, 395 android_x86: { 396 static_libs: ["libunwindbacktrace"], 397 ldflags: ["-Wl,--exclude-libs,libunwindbacktrace.a"], 398 }, 399 android_x86_64: { 400 srcs: ["lib/builtins/ppc/floatditf.c"], 401 static_libs: ["libunwindbacktrace"], 402 ldflags: ["-Wl,--exclude-libs,libunwindbacktrace.a"], 403 }, 404 linux: { 405 static_libs: ["libunwindbacktrace"], 406 shared_libs: ["liblzma"], 407 }, 408 windows: { 409 static_libs: ["libunwindbacktrace"], 410 // Only build enable_execute_stack.c on non-Windows hosts. 411 exclude_srcs: ["lib/builtins/enable_execute_stack.c"], 412 }, 413 }, 414 415 asflags: ["-integrated-as"], 416 clang: true, 417 no_libgcc: true, 418 419 sanitize: { 420 never: true, 421 }, 422 stl: "none", 423} 424 425cc_defaults { 426 name: "asan_arch_defaults", 427 428 vendor_available: true, 429 enabled: false, 430 target: { 431 android_arm: { 432 enabled: true, 433 }, 434 android_arm64: { 435 enabled: true, 436 }, 437 android_mips: { 438 enabled: true, 439 }, 440 android_mips64: { 441 enabled: true, 442 }, 443 android_x86: { 444 enabled: true, 445 }, 446 linux: { 447 enabled: true, 448 }, 449 }, 450} 451 452subdirs=["lib/*"] 453