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 17cc_library_static { 18 name: "libc++abi", 19 host_supported: true, 20 vendor_available: true, 21 recovery_available: true, 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", 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", 36 "src/fallback_malloc.cpp", 37 "src/private_typeinfo.cpp", 38 "src/stdlib_exception.cpp", 39 "src/stdlib_new_delete.cpp", 40 "src/stdlib_stdexcept.cpp", 41 "src/stdlib_typeinfo.cpp", 42 ], 43 include_dirs: ["external/libcxx/include"], 44 local_include_dirs: ["include"], 45 export_include_dirs: ["include"], 46 cflags: [ 47 "-Wall", 48 "-Werror", 49 ], 50 cppflags: [ 51 "-std=c++14", 52 "-fexceptions", 53 "-Wextra", 54 "-Wno-unused-function", 55 "-Wno-implicit-fallthrough", 56 // src/cxa_demangle.cpp:2591 -Wimplicit-fallthrough 57 ], 58 sanitize: { 59 never: true, 60 }, 61 stl: "none", 62 rtti: true, 63 arch: { 64 arm: { 65 include_dirs: ["external/libunwind_llvm/include"], 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"], 91 cflags: ["-integrated-as", "-D_LIBCPP_DISABLE_AVAILABILITY"], 92 cppflags: ["-integrated-as"], 93 }, 94 linux_bionic: { 95 cppflags: ["-DHAVE___CXA_THREAD_ATEXIT_IMPL"], 96 enabled: true, 97 }, 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 } 122 }, 123 124} 125