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