Dan Willemsen | a2140be | 2015-09-11 13:09:25 -0700 | [diff] [blame] | 1 | // |
| 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 Albert | 8144d21 | 2019-07-23 13:29:41 -0700 | [diff] [blame] | 17 | cc_defaults { |
| 18 | name: "libc++abi_defaults", |
Dan Willemsen | c41479a | 2017-04-07 14:11:56 -0700 | [diff] [blame] | 19 | vendor_available: true, |
Yifan Hong | 2976042 | 2020-01-21 16:44:44 -0800 | [diff] [blame] | 20 | ramdisk_available: true, |
Jiyong Park | 1607e38 | 2018-04-27 21:48:01 +0900 | [diff] [blame] | 21 | recovery_available: true, |
dimitry | d5744a9 | 2019-05-06 12:34:03 +0200 | [diff] [blame] | 22 | native_bridge_supported: true, |
Dan Albert | 8144d21 | 2019-07-23 13:29:41 -0700 | [diff] [blame] | 23 | include_dirs: ["external/libcxx/include"], |
Jooyung Han | 50938ff | 2020-04-16 18:48:28 +0900 | [diff] [blame] | 24 | local_include_dirs: ["include"], |
Dan Albert | 8144d21 | 2019-07-23 13:29:41 -0700 | [diff] [blame] | 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 | |
| 45 | cc_library_static { |
| 46 | name: "libc++demangle", |
| 47 | defaults: ["libc++abi_defaults"], |
| 48 | host_supported: false, |
| 49 | srcs: ["src/cxa_demangle.cpp"], |
Jiyong Park | 6a27edc | 2020-03-07 16:42:32 +0900 | [diff] [blame] | 50 | apex_available: [ |
| 51 | "//apex_available:platform", |
| 52 | "//apex_available:anyapex", |
| 53 | ], |
Jooyung Han | 50938ff | 2020-04-16 18:48:28 +0900 | [diff] [blame] | 54 | min_sdk_version: "apex_inherit", |
Dan Albert | 8144d21 | 2019-07-23 13:29:41 -0700 | [diff] [blame] | 55 | } |
| 56 | |
| 57 | cc_library_static { |
| 58 | name: "libc++abi", |
| 59 | defaults: ["libc++abi_defaults"], |
| 60 | host_supported: true, |
Colin Cross | 27edc0b | 2015-11-19 14:24:58 -0800 | [diff] [blame] | 61 | 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 Cross | 27edc0b | 2015-11-19 14:24:58 -0800 | [diff] [blame] | 70 | "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 Albert | 498f031 | 2016-11-17 13:55:40 -0800 | [diff] [blame] | 75 | "src/fallback_malloc.cpp", |
Colin Cross | 27edc0b | 2015-11-19 14:24:58 -0800 | [diff] [blame] | 76 | "src/private_typeinfo.cpp", |
Dan Albert | 9dd52f4 | 2017-01-27 11:17:10 -0800 | [diff] [blame] | 77 | "src/stdlib_exception.cpp", |
Dan Albert | 2eddfdf | 2018-02-07 17:24:02 -0800 | [diff] [blame] | 78 | "src/stdlib_new_delete.cpp", |
Dan Albert | 9dd52f4 | 2017-01-27 11:17:10 -0800 | [diff] [blame] | 79 | "src/stdlib_stdexcept.cpp", |
| 80 | "src/stdlib_typeinfo.cpp", |
Colin Cross | 27edc0b | 2015-11-19 14:24:58 -0800 | [diff] [blame] | 81 | ], |
Dan Willemsen | a2140be | 2015-09-11 13:09:25 -0700 | [diff] [blame] | 82 | arch: { |
| 83 | arm: { |
Colin Cross | 27edc0b | 2015-11-19 14:24:58 -0800 | [diff] [blame] | 84 | include_dirs: ["external/libunwind_llvm/include"], |
Dan Willemsen | a2140be | 2015-09-11 13:09:25 -0700 | [diff] [blame] | 85 | 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 Albert | 8144d21 | 2019-07-23 13:29:41 -0700 | [diff] [blame] | 106 | // Packaged in libc++demangle for Android to reduce bloat. |
| 107 | exclude_srcs: ["src/cxa_demangle.cpp"], |
Dan Willemsen | a2140be | 2015-09-11 13:09:25 -0700 | [diff] [blame] | 108 | }, |
| 109 | darwin: { |
| 110 | // libcxxabi really doesn't like the non-LLVM assembler on Darwin |
| 111 | asflags: ["-integrated-as"], |
Jooyung Han | 50938ff | 2020-04-16 18:48:28 +0900 | [diff] [blame] | 112 | cflags: [ |
| 113 | "-integrated-as", |
| 114 | "-D_LIBCPP_DISABLE_AVAILABILITY", |
| 115 | ], |
Dan Willemsen | a2140be | 2015-09-11 13:09:25 -0700 | [diff] [blame] | 116 | cppflags: ["-integrated-as"], |
| 117 | }, |
Dan Willemsen | 8008d24 | 2016-11-04 12:26:06 -0700 | [diff] [blame] | 118 | linux_bionic: { |
| 119 | cppflags: ["-DHAVE___CXA_THREAD_ATEXIT_IMPL"], |
| 120 | enabled: true, |
| 121 | }, |
Pirama Arumuga Nainar | 2dc3cf8 | 2018-08-08 10:30:41 -0700 | [diff] [blame] | 122 | 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 Han | 50938ff | 2020-04-16 18:48:28 +0900 | [diff] [blame] | 145 | }, |
Dan Willemsen | a2140be | 2015-09-11 13:09:25 -0700 | [diff] [blame] | 146 | }, |
Jiyong Park | 6a27edc | 2020-03-07 16:42:32 +0900 | [diff] [blame] | 147 | apex_available: [ |
| 148 | "//apex_available:platform", |
| 149 | "//apex_available:anyapex", |
| 150 | ], |
Jooyung Han | 50938ff | 2020-04-16 18:48:28 +0900 | [diff] [blame] | 151 | min_sdk_version: "apex_inherit", |
Dan Willemsen | a2140be | 2015-09-11 13:09:25 -0700 | [diff] [blame] | 152 | } |