blob: 56a28325728f0690250748da0c1364707d2f4b21 [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"],
24 local_include_dirs: ["include"],
25 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 ],
Dan Albert8144d212019-07-23 13:29:41 -070054}
55
56cc_library_static {
57 name: "libc++abi",
58 defaults: ["libc++abi_defaults"],
59 host_supported: true,
Colin Cross27edc0b2015-11-19 14:24:58 -080060 srcs: [
61 "src/abort_message.cpp",
62 "src/cxa_aux_runtime.cpp",
63 "src/cxa_default_handlers.cpp",
64 "src/cxa_demangle.cpp",
65 "src/cxa_exception.cpp",
66 "src/cxa_exception_storage.cpp",
67 "src/cxa_guard.cpp",
68 "src/cxa_handlers.cpp",
Colin Cross27edc0b2015-11-19 14:24:58 -080069 "src/cxa_personality.cpp",
70 "src/cxa_thread_atexit.cpp",
71 "src/cxa_unexpected.cpp",
72 "src/cxa_vector.cpp",
73 "src/cxa_virtual.cpp",
Dan Albert498f0312016-11-17 13:55:40 -080074 "src/fallback_malloc.cpp",
Colin Cross27edc0b2015-11-19 14:24:58 -080075 "src/private_typeinfo.cpp",
Dan Albert9dd52f42017-01-27 11:17:10 -080076 "src/stdlib_exception.cpp",
Dan Albert2eddfdf2018-02-07 17:24:02 -080077 "src/stdlib_new_delete.cpp",
Dan Albert9dd52f42017-01-27 11:17:10 -080078 "src/stdlib_stdexcept.cpp",
79 "src/stdlib_typeinfo.cpp",
Colin Cross27edc0b2015-11-19 14:24:58 -080080 ],
Dan Willemsena2140be2015-09-11 13:09:25 -070081 arch: {
82 arm: {
Colin Cross27edc0b2015-11-19 14:24:58 -080083 include_dirs: ["external/libunwind_llvm/include"],
Dan Willemsena2140be2015-09-11 13:09:25 -070084 cppflags: ["-DLIBCXXABI_USE_LLVM_UNWINDER=1"],
85 },
86 arm64: {
87 cppflags: ["-DLIBCXXABI_USE_LLVM_UNWINDER=0"],
88 },
89 mips: {
90 cppflags: ["-DLIBCXXABI_USE_LLVM_UNWINDER=0"],
91 },
92 mips64: {
93 cppflags: ["-DLIBCXXABI_USE_LLVM_UNWINDER=0"],
94 },
95 x86: {
96 cppflags: ["-DLIBCXXABI_USE_LLVM_UNWINDER=0"],
97 },
98 x86_64: {
99 cppflags: ["-DLIBCXXABI_USE_LLVM_UNWINDER=0"],
100 },
101 },
102 target: {
103 android: {
104 cppflags: ["-DHAVE___CXA_THREAD_ATEXIT_IMPL"],
Dan Albert8144d212019-07-23 13:29:41 -0700105 // Packaged in libc++demangle for Android to reduce bloat.
106 exclude_srcs: ["src/cxa_demangle.cpp"],
Dan Willemsena2140be2015-09-11 13:09:25 -0700107 },
108 darwin: {
109 // libcxxabi really doesn't like the non-LLVM assembler on Darwin
110 asflags: ["-integrated-as"],
Dan Albertfd5cfb82018-01-17 20:04:10 -0800111 cflags: ["-integrated-as", "-D_LIBCPP_DISABLE_AVAILABILITY"],
Dan Willemsena2140be2015-09-11 13:09:25 -0700112 cppflags: ["-integrated-as"],
113 },
Dan Willemsen8008d242016-11-04 12:26:06 -0700114 linux_bionic: {
115 cppflags: ["-DHAVE___CXA_THREAD_ATEXIT_IMPL"],
116 enabled: true,
117 },
Pirama Arumuga Nainar2dc3cf82018-08-08 10:30:41 -0700118 windows: {
119 enabled: true,
120 cppflags: [
121 "-D_LIBCPP_HAS_THREAD_API_WIN32",
122 "-D_LIBCXXABI_BUILDING_LIBRARY",
123 "-D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS",
124 "-D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS",
125 ],
126 exclude_srcs: [
127 "src/cxa_thread_atexit.cpp",
128
129 // Building stdlib_new_delete.cpp in libcxxabi causes
130 // multiple-definition errors against definitions in
131 // libcxx/src/new.cpp on Windows. This works on Linux and
132 // Android where the functions have 'weak' linkage and are
133 // discarded by the linker.
134 "src/stdlib_new_delete.cpp",
135 ],
136 },
137 windows_x86: {
138 cppflags: [
139 "-fsjlj-exceptions",
140 ],
141 }
Dan Willemsena2140be2015-09-11 13:09:25 -0700142 },
Jiyong Park6a27edc2020-03-07 16:42:32 +0900143 apex_available: [
144 "//apex_available:platform",
145 "//apex_available:anyapex",
146 ],
Dan Willemsena2140be2015-09-11 13:09:25 -0700147}