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 Willemsen | a2140be | 2015-09-11 13:09:25 -0700 | [diff] [blame] | 17 | cc_library_static { |
| 18 | name: "libc++abi", |
| 19 | host_supported: true, |
Dan Willemsen | c41479a | 2017-04-07 14:11:56 -0700 | [diff] [blame] | 20 | vendor_available: true, |
Jiyong Park | 1607e38 | 2018-04-27 21:48:01 +0900 | [diff] [blame] | 21 | recovery_available: true, |
Colin Cross | 27edc0b | 2015-11-19 14:24:58 -0800 | [diff] [blame] | 22 | srcs: [ |
| 23 | "src/abort_message.cpp", |
| 24 | "src/cxa_aux_runtime.cpp", |
| 25 | "src/cxa_default_handlers.cpp", |
| 26 | "src/cxa_demangle.cpp", |
| 27 | "src/cxa_exception.cpp", |
| 28 | "src/cxa_exception_storage.cpp", |
| 29 | "src/cxa_guard.cpp", |
| 30 | "src/cxa_handlers.cpp", |
Colin Cross | 27edc0b | 2015-11-19 14:24:58 -0800 | [diff] [blame] | 31 | "src/cxa_personality.cpp", |
| 32 | "src/cxa_thread_atexit.cpp", |
| 33 | "src/cxa_unexpected.cpp", |
| 34 | "src/cxa_vector.cpp", |
| 35 | "src/cxa_virtual.cpp", |
Dan Albert | 498f031 | 2016-11-17 13:55:40 -0800 | [diff] [blame] | 36 | "src/fallback_malloc.cpp", |
Colin Cross | 27edc0b | 2015-11-19 14:24:58 -0800 | [diff] [blame] | 37 | "src/private_typeinfo.cpp", |
Dan Albert | 9dd52f4 | 2017-01-27 11:17:10 -0800 | [diff] [blame] | 38 | "src/stdlib_exception.cpp", |
Dan Albert | 2eddfdf | 2018-02-07 17:24:02 -0800 | [diff] [blame] | 39 | "src/stdlib_new_delete.cpp", |
Dan Albert | 9dd52f4 | 2017-01-27 11:17:10 -0800 | [diff] [blame] | 40 | "src/stdlib_stdexcept.cpp", |
| 41 | "src/stdlib_typeinfo.cpp", |
Colin Cross | 27edc0b | 2015-11-19 14:24:58 -0800 | [diff] [blame] | 42 | ], |
| 43 | include_dirs: ["external/libcxx/include"], |
| 44 | local_include_dirs: ["include"], |
| 45 | export_include_dirs: ["include"], |
Chih-Hung Hsieh | 3b3514c | 2017-09-28 13:56:31 -0700 | [diff] [blame] | 46 | cflags: [ |
| 47 | "-Wall", |
| 48 | "-Werror", |
| 49 | ], |
Colin Cross | 27edc0b | 2015-11-19 14:24:58 -0800 | [diff] [blame] | 50 | cppflags: [ |
| 51 | "-std=c++14", |
| 52 | "-fexceptions", |
Colin Cross | 27edc0b | 2015-11-19 14:24:58 -0800 | [diff] [blame] | 53 | "-Wextra", |
| 54 | "-Wno-unused-function", |
Chih-Hung Hsieh | f8126cd | 2018-09-04 14:16:00 -0700 | [diff] [blame] | 55 | "-Wno-implicit-fallthrough", |
| 56 | // src/cxa_demangle.cpp:2591 -Wimplicit-fallthrough |
Colin Cross | 27edc0b | 2015-11-19 14:24:58 -0800 | [diff] [blame] | 57 | ], |
Colin Cross | 032303c | 2016-04-07 13:28:30 -0700 | [diff] [blame] | 58 | sanitize: { |
| 59 | never: true, |
| 60 | }, |
Dan Willemsen | a2140be | 2015-09-11 13:09:25 -0700 | [diff] [blame] | 61 | stl: "none", |
| 62 | rtti: true, |
| 63 | arch: { |
| 64 | arm: { |
Colin Cross | 27edc0b | 2015-11-19 14:24:58 -0800 | [diff] [blame] | 65 | include_dirs: ["external/libunwind_llvm/include"], |
Dan Willemsen | a2140be | 2015-09-11 13:09:25 -0700 | [diff] [blame] | 66 | cppflags: ["-DLIBCXXABI_USE_LLVM_UNWINDER=1"], |
| 67 | }, |
| 68 | arm64: { |
| 69 | cppflags: ["-DLIBCXXABI_USE_LLVM_UNWINDER=0"], |
| 70 | }, |
| 71 | mips: { |
| 72 | cppflags: ["-DLIBCXXABI_USE_LLVM_UNWINDER=0"], |
| 73 | }, |
| 74 | mips64: { |
| 75 | cppflags: ["-DLIBCXXABI_USE_LLVM_UNWINDER=0"], |
| 76 | }, |
| 77 | x86: { |
| 78 | cppflags: ["-DLIBCXXABI_USE_LLVM_UNWINDER=0"], |
| 79 | }, |
| 80 | x86_64: { |
| 81 | cppflags: ["-DLIBCXXABI_USE_LLVM_UNWINDER=0"], |
| 82 | }, |
| 83 | }, |
| 84 | target: { |
| 85 | android: { |
| 86 | cppflags: ["-DHAVE___CXA_THREAD_ATEXIT_IMPL"], |
| 87 | }, |
| 88 | darwin: { |
| 89 | // libcxxabi really doesn't like the non-LLVM assembler on Darwin |
| 90 | asflags: ["-integrated-as"], |
Dan Albert | fd5cfb8 | 2018-01-17 20:04:10 -0800 | [diff] [blame] | 91 | cflags: ["-integrated-as", "-D_LIBCPP_DISABLE_AVAILABILITY"], |
Dan Willemsen | a2140be | 2015-09-11 13:09:25 -0700 | [diff] [blame] | 92 | cppflags: ["-integrated-as"], |
| 93 | }, |
Dan Willemsen | 8008d24 | 2016-11-04 12:26:06 -0700 | [diff] [blame] | 94 | linux_bionic: { |
| 95 | cppflags: ["-DHAVE___CXA_THREAD_ATEXIT_IMPL"], |
| 96 | enabled: true, |
| 97 | }, |
Pirama Arumuga Nainar | 2dc3cf8 | 2018-08-08 10:30:41 -0700 | [diff] [blame] | 98 | windows: { |
| 99 | enabled: true, |
| 100 | cppflags: [ |
| 101 | "-D_LIBCPP_HAS_THREAD_API_WIN32", |
| 102 | "-D_LIBCXXABI_BUILDING_LIBRARY", |
| 103 | "-D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS", |
| 104 | "-D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS", |
| 105 | ], |
| 106 | exclude_srcs: [ |
| 107 | "src/cxa_thread_atexit.cpp", |
| 108 | |
| 109 | // Building stdlib_new_delete.cpp in libcxxabi causes |
| 110 | // multiple-definition errors against definitions in |
| 111 | // libcxx/src/new.cpp on Windows. This works on Linux and |
| 112 | // Android where the functions have 'weak' linkage and are |
| 113 | // discarded by the linker. |
| 114 | "src/stdlib_new_delete.cpp", |
| 115 | ], |
| 116 | }, |
| 117 | windows_x86: { |
| 118 | cppflags: [ |
| 119 | "-fsjlj-exceptions", |
| 120 | ], |
| 121 | } |
Dan Willemsen | a2140be | 2015-09-11 13:09:25 -0700 | [diff] [blame] | 122 | }, |
| 123 | |
| 124 | } |