blob: c6fcc0e3d1436be1e8da2e49f9cfcf8eb2de702f [file] [log] [blame]
Dan Willemsena2140be2015-09-11 13:09:25 -07001//
2// Copyright (C) 2014 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
Bob Badour98c858f2021-02-12 19:49:33 -080017package {
18 default_applicable_licenses: ["external_libcxxabi_license"],
19}
20
21// Added automatically by a large-scale-change that took the approach of
22// 'apply every license found to every target'. While this makes sure we respect
23// every license restriction, it may not be entirely correct.
24//
25// e.g. GPL in an MIT project might only apply to the contrib/ directory.
26//
27// Please consider splitting the single license below into multiple licenses,
28// taking care not to lose any license_kind information, and overriding the
29// default license using the 'licenses: [...]' property on targets as needed.
30//
31// For unused files, consider creating a 'fileGroup' with "//visibility:private"
32// to attach the license to, and including a comment whether the files may be
33// used in the current project.
34//
35// large-scale-change included anything that looked like it might be a license
36// text as a license_text. e.g. LICENSE, NOTICE, COPYING etc.
37//
38// Please consider removing redundant or irrelevant files from 'license_text:'.
39// See: http://go/android-license-faq
40license {
41 name: "external_libcxxabi_license",
42 visibility: [":__subpackages__"],
43 license_kinds: [
44 "SPDX-license-identifier-BSD",
45 "SPDX-license-identifier-MIT",
46 "SPDX-license-identifier-NCSA",
47 ],
48 license_text: [
49 "LICENSE.TXT",
50 "NOTICE",
51 ],
52}
53
Dan Albert8144d212019-07-23 13:29:41 -070054cc_defaults {
55 name: "libc++abi_defaults",
Dan Willemsenc41479a2017-04-07 14:11:56 -070056 vendor_available: true,
Justin Yunf4aa2172020-11-11 16:26:03 +090057 product_available: true,
Yifan Hong29760422020-01-21 16:44:44 -080058 ramdisk_available: true,
Yifan Honga338afc2020-10-21 18:42:49 -070059 vendor_ramdisk_available: true,
Jiyong Park1607e382018-04-27 21:48:01 +090060 recovery_available: true,
dimitryd5744a92019-05-06 12:34:03 +020061 native_bridge_supported: true,
Dan Albert8144d212019-07-23 13:29:41 -070062 include_dirs: ["external/libcxx/include"],
Jooyung Han8e992d72020-04-16 18:48:28 +090063 local_include_dirs: ["include"],
Dan Albert8144d212019-07-23 13:29:41 -070064 export_include_dirs: ["include"],
65 cflags: [
66 "-Wall",
67 "-Werror",
68 ],
69 cppflags: [
70 "-std=c++14",
71 "-fexceptions",
72 "-Wextra",
73 "-Wno-unused-function",
74 "-Wno-implicit-fallthrough",
75 // src/cxa_demangle.cpp:2591 -Wimplicit-fallthrough
76 ],
77 sanitize: {
78 never: true,
79 },
80 stl: "none",
81 rtti: true,
82}
83
84cc_library_static {
85 name: "libc++demangle",
86 defaults: ["libc++abi_defaults"],
87 host_supported: false,
88 srcs: ["src/cxa_demangle.cpp"],
Jiyong Parked963322020-03-07 16:42:32 +090089 apex_available: [
90 "//apex_available:platform",
91 "//apex_available:anyapex",
92 ],
Jooyung Han8e992d72020-04-16 18:48:28 +090093 min_sdk_version: "apex_inherit",
Dan Albert8144d212019-07-23 13:29:41 -070094}
95
96cc_library_static {
97 name: "libc++abi",
98 defaults: ["libc++abi_defaults"],
99 host_supported: true,
Colin Cross27edc0b2015-11-19 14:24:58 -0800100 srcs: [
101 "src/abort_message.cpp",
102 "src/cxa_aux_runtime.cpp",
103 "src/cxa_default_handlers.cpp",
104 "src/cxa_demangle.cpp",
105 "src/cxa_exception.cpp",
106 "src/cxa_exception_storage.cpp",
107 "src/cxa_guard.cpp",
108 "src/cxa_handlers.cpp",
Colin Cross27edc0b2015-11-19 14:24:58 -0800109 "src/cxa_personality.cpp",
110 "src/cxa_thread_atexit.cpp",
111 "src/cxa_unexpected.cpp",
112 "src/cxa_vector.cpp",
113 "src/cxa_virtual.cpp",
Dan Albert498f0312016-11-17 13:55:40 -0800114 "src/fallback_malloc.cpp",
Colin Cross27edc0b2015-11-19 14:24:58 -0800115 "src/private_typeinfo.cpp",
Dan Albert9dd52f42017-01-27 11:17:10 -0800116 "src/stdlib_exception.cpp",
Dan Albert2eddfdf2018-02-07 17:24:02 -0800117 "src/stdlib_new_delete.cpp",
Dan Albert9dd52f42017-01-27 11:17:10 -0800118 "src/stdlib_stdexcept.cpp",
119 "src/stdlib_typeinfo.cpp",
Colin Cross27edc0b2015-11-19 14:24:58 -0800120 ],
Ryan Prichard64b98392021-04-02 17:12:53 -0700121 cppflags: ["-DLIBCXXABI_USE_LLVM_UNWINDER=1"],
Dan Willemsena2140be2015-09-11 13:09:25 -0700122 target: {
123 android: {
124 cppflags: ["-DHAVE___CXA_THREAD_ATEXIT_IMPL"],
Dan Albert8144d212019-07-23 13:29:41 -0700125 // Packaged in libc++demangle for Android to reduce bloat.
126 exclude_srcs: ["src/cxa_demangle.cpp"],
Dan Willemsena2140be2015-09-11 13:09:25 -0700127 },
128 darwin: {
129 // libcxxabi really doesn't like the non-LLVM assembler on Darwin
130 asflags: ["-integrated-as"],
Jooyung Han8e992d72020-04-16 18:48:28 +0900131 cflags: [
132 "-integrated-as",
133 "-D_LIBCPP_DISABLE_AVAILABILITY",
134 ],
Dan Willemsena2140be2015-09-11 13:09:25 -0700135 cppflags: ["-integrated-as"],
136 },
Dan Willemsen8008d242016-11-04 12:26:06 -0700137 linux_bionic: {
138 cppflags: ["-DHAVE___CXA_THREAD_ATEXIT_IMPL"],
139 enabled: true,
140 },
Pirama Arumuga Nainar2dc3cf82018-08-08 10:30:41 -0700141 windows: {
142 enabled: true,
143 cppflags: [
144 "-D_LIBCPP_HAS_THREAD_API_WIN32",
145 "-D_LIBCXXABI_BUILDING_LIBRARY",
146 "-D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS",
147 "-D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS",
148 ],
149 exclude_srcs: [
150 "src/cxa_thread_atexit.cpp",
151
152 // Building stdlib_new_delete.cpp in libcxxabi causes
153 // multiple-definition errors against definitions in
154 // libcxx/src/new.cpp on Windows. This works on Linux and
155 // Android where the functions have 'weak' linkage and are
156 // discarded by the linker.
157 "src/stdlib_new_delete.cpp",
158 ],
159 },
Dan Willemsena2140be2015-09-11 13:09:25 -0700160 },
Jiyong Parked963322020-03-07 16:42:32 +0900161 apex_available: [
162 "//apex_available:platform",
163 "//apex_available:anyapex",
164 ],
Jooyung Han8e992d72020-04-16 18:48:28 +0900165 min_sdk_version: "apex_inherit",
Dan Willemsena2140be2015-09-11 13:09:25 -0700166}
Christopher Ferris965a0b92019-07-18 15:45:40 -0700167
168cc_fuzz {
169 name: "cxa_demangle_fuzzer",
170 host_supported: true,
171 local_include_dirs: ["include"],
172
173 srcs: [
174 "fuzz/cxa_demangle_fuzzer.cpp",
175 "src/cxa_demangle.cpp",
176 ],
177}