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, |
| 20 | clang: true, |
Colin Cross | 27edc0b | 2015-11-19 14:24:58 -0800 | [diff] [blame^] | 21 | srcs: [ |
| 22 | "src/abort_message.cpp", |
| 23 | "src/cxa_aux_runtime.cpp", |
| 24 | "src/cxa_default_handlers.cpp", |
| 25 | "src/cxa_demangle.cpp", |
| 26 | "src/cxa_exception.cpp", |
| 27 | "src/cxa_exception_storage.cpp", |
| 28 | "src/cxa_guard.cpp", |
| 29 | "src/cxa_handlers.cpp", |
| 30 | "src/cxa_new_delete.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/exception.cpp", |
| 37 | "src/private_typeinfo.cpp", |
| 38 | "src/stdexcept.cpp", |
| 39 | "src/typeinfo.cpp", |
| 40 | ], |
| 41 | include_dirs: ["external/libcxx/include"], |
| 42 | local_include_dirs: ["include"], |
| 43 | export_include_dirs: ["include"], |
| 44 | cppflags: [ |
| 45 | "-std=c++14", |
| 46 | "-fexceptions", |
| 47 | "-Wall", |
| 48 | "-Wextra", |
| 49 | "-Wno-unused-function", |
| 50 | "-Werror", |
| 51 | ], |
Dan Willemsen | a2140be | 2015-09-11 13:09:25 -0700 | [diff] [blame] | 52 | sanitize: ["never"], |
| 53 | stl: "none", |
| 54 | rtti: true, |
| 55 | arch: { |
| 56 | arm: { |
Colin Cross | 27edc0b | 2015-11-19 14:24:58 -0800 | [diff] [blame^] | 57 | include_dirs: ["external/libunwind_llvm/include"], |
Dan Willemsen | a2140be | 2015-09-11 13:09:25 -0700 | [diff] [blame] | 58 | // When src/cxa_exception.cpp is compiled with Clang assembler |
| 59 | // __cxa_end_cleanup_impl, although marked as used, was discarded |
| 60 | // since it is used only in embedded assembly code. |
| 61 | // This caused the following warning when linking libc++.so: |
| 62 | // libc++_static.a(cxa_exception.o)(.text.__cxa_end_cleanup+0x2): |
| 63 | // warning: relocation refers to discarded section |
| 64 | // See also http://llvm.org/bugs/show_bug.cgi?id=21292. |
| 65 | clang_cflags: ["-no-integrated-as"], |
| 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"], |
| 92 | cppflags: ["-integrated-as"], |
| 93 | }, |
| 94 | }, |
| 95 | |
| 96 | } |