blob: 856b2d1fc4e435b438bd142b875a1d517041d091 [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
Dan Albert8144d212019-07-23 13:29:41 -070017cc_defaults {
18 name: "libc++abi_defaults",
Dan Willemsenc41479a2017-04-07 14:11:56 -070019 vendor_available: true,
Yifan Hong29760422020-01-21 16:44:44 -080020 ramdisk_available: true,
Jiyong Park1607e382018-04-27 21:48:01 +090021 recovery_available: true,
dimitryd5744a92019-05-06 12:34:03 +020022 native_bridge_supported: true,
Dan Albert8144d212019-07-23 13:29:41 -070023 include_dirs: ["external/libcxx/include"],
Jooyung Han50938ff2020-04-16 18:48:28 +090024 local_include_dirs: ["include"],
Dan Albert8144d212019-07-23 13:29:41 -070025 export_include_dirs: ["include"],
26 cflags: [
27 "-Wall",
28 "-Werror",
29 ],
30 cppflags: [
31 "-std=c++14",
32 "-fexceptions",
33 "-Wextra",
34 "-Wno-unused-function",
35 "-Wno-implicit-fallthrough",
36 // src/cxa_demangle.cpp:2591 -Wimplicit-fallthrough
37 ],
38 sanitize: {
39 never: true,
40 },
41 stl: "none",
42 rtti: true,
43}
44
45cc_library_static {
46 name: "libc++demangle",
47 defaults: ["libc++abi_defaults"],
48 host_supported: false,
49 srcs: ["src/cxa_demangle.cpp"],
Jiyong Park6a27edc2020-03-07 16:42:32 +090050 apex_available: [
51 "//apex_available:platform",
52 "//apex_available:anyapex",
53 ],
Jooyung Han50938ff2020-04-16 18:48:28 +090054 min_sdk_version: "apex_inherit",
Dan Albert8144d212019-07-23 13:29:41 -070055}
56
57cc_library_static {
58 name: "libc++abi",
59 defaults: ["libc++abi_defaults"],
60 host_supported: true,
Colin Cross27edc0b2015-11-19 14:24:58 -080061 srcs: [
62 "src/abort_message.cpp",
63 "src/cxa_aux_runtime.cpp",
64 "src/cxa_default_handlers.cpp",
65 "src/cxa_demangle.cpp",
66 "src/cxa_exception.cpp",
67 "src/cxa_exception_storage.cpp",
68 "src/cxa_guard.cpp",
69 "src/cxa_handlers.cpp",
Colin Cross27edc0b2015-11-19 14:24:58 -080070 "src/cxa_personality.cpp",
71 "src/cxa_thread_atexit.cpp",
72 "src/cxa_unexpected.cpp",
73 "src/cxa_vector.cpp",
74 "src/cxa_virtual.cpp",
Dan Albert498f0312016-11-17 13:55:40 -080075 "src/fallback_malloc.cpp",
Colin Cross27edc0b2015-11-19 14:24:58 -080076 "src/private_typeinfo.cpp",
Dan Albert9dd52f42017-01-27 11:17:10 -080077 "src/stdlib_exception.cpp",
Dan Albert2eddfdf2018-02-07 17:24:02 -080078 "src/stdlib_new_delete.cpp",
Dan Albert9dd52f42017-01-27 11:17:10 -080079 "src/stdlib_stdexcept.cpp",
80 "src/stdlib_typeinfo.cpp",
Colin Cross27edc0b2015-11-19 14:24:58 -080081 ],
Dan Willemsena2140be2015-09-11 13:09:25 -070082 arch: {
83 arm: {
Colin Cross27edc0b2015-11-19 14:24:58 -080084 include_dirs: ["external/libunwind_llvm/include"],
Dan Willemsena2140be2015-09-11 13:09:25 -070085 cppflags: ["-DLIBCXXABI_USE_LLVM_UNWINDER=1"],
86 },
87 arm64: {
88 cppflags: ["-DLIBCXXABI_USE_LLVM_UNWINDER=0"],
89 },
90 mips: {
91 cppflags: ["-DLIBCXXABI_USE_LLVM_UNWINDER=0"],
92 },
93 mips64: {
94 cppflags: ["-DLIBCXXABI_USE_LLVM_UNWINDER=0"],
95 },
96 x86: {
97 cppflags: ["-DLIBCXXABI_USE_LLVM_UNWINDER=0"],
98 },
99 x86_64: {
100 cppflags: ["-DLIBCXXABI_USE_LLVM_UNWINDER=0"],
101 },
102 },
103 target: {
104 android: {
105 cppflags: ["-DHAVE___CXA_THREAD_ATEXIT_IMPL"],
Dan Albert8144d212019-07-23 13:29:41 -0700106 // Packaged in libc++demangle for Android to reduce bloat.
107 exclude_srcs: ["src/cxa_demangle.cpp"],
Dan Willemsena2140be2015-09-11 13:09:25 -0700108 },
109 darwin: {
110 // libcxxabi really doesn't like the non-LLVM assembler on Darwin
111 asflags: ["-integrated-as"],
Jooyung Han50938ff2020-04-16 18:48:28 +0900112 cflags: [
113 "-integrated-as",
114 "-D_LIBCPP_DISABLE_AVAILABILITY",
115 ],
Dan Willemsena2140be2015-09-11 13:09:25 -0700116 cppflags: ["-integrated-as"],
117 },
Dan Willemsen8008d242016-11-04 12:26:06 -0700118 linux_bionic: {
119 cppflags: ["-DHAVE___CXA_THREAD_ATEXIT_IMPL"],
120 enabled: true,
121 },
Pirama Arumuga Nainar2dc3cf82018-08-08 10:30:41 -0700122 windows: {
123 enabled: true,
124 cppflags: [
125 "-D_LIBCPP_HAS_THREAD_API_WIN32",
126 "-D_LIBCXXABI_BUILDING_LIBRARY",
127 "-D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS",
128 "-D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS",
129 ],
130 exclude_srcs: [
131 "src/cxa_thread_atexit.cpp",
132
133 // Building stdlib_new_delete.cpp in libcxxabi causes
134 // multiple-definition errors against definitions in
135 // libcxx/src/new.cpp on Windows. This works on Linux and
136 // Android where the functions have 'weak' linkage and are
137 // discarded by the linker.
138 "src/stdlib_new_delete.cpp",
139 ],
140 },
141 windows_x86: {
142 cppflags: [
143 "-fsjlj-exceptions",
144 ],
Jooyung Han50938ff2020-04-16 18:48:28 +0900145 },
Dan Willemsena2140be2015-09-11 13:09:25 -0700146 },
Jiyong Park6a27edc2020-03-07 16:42:32 +0900147 apex_available: [
148 "//apex_available:platform",
149 "//apex_available:anyapex",
150 ],
Jooyung Han50938ff2020-04-16 18:48:28 +0900151 min_sdk_version: "apex_inherit",
Dan Willemsena2140be2015-09-11 13:09:25 -0700152}