blob: b8834fb10e5cf0e53e799d924f7a1aa852487c42 [file] [log] [blame]
//
// Copyright (C) 2015 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
//
ubsan_rtl_files = [
"ubsan_diag.cc",
"ubsan_init.cc",
"ubsan_flags.cc",
"ubsan_handlers.cc",
"ubsan_value.cc",
]
ubsan_cxx_rtl_files = [
"ubsan_handlers_cxx.cc",
"ubsan_type_hash.cc",
"ubsan_type_hash_itanium.cc",
"ubsan_type_hash_win.cc",
]
ubsan_rtl_cppflags = [
"-fvisibility=hidden",
"-fno-exceptions",
"-std=c++11",
"-Wall",
"-Werror",
"-Wno-unused-parameter",
"-Wno-non-virtual-dtor",
]
ubsan_rtl_c_includes = ["external/compiler-rt/lib"]
cc_library_static {
name: "libubsan",
host_supported: true,
defaults: ["asan_arch_defaults"],
include_dirs: ubsan_rtl_c_includes,
cppflags: ubsan_rtl_cppflags,
srcs: ubsan_rtl_files,
sdk_version: "19",
stl: "none",
sanitize: {
never: true,
},
compile_multilib: "both",
target: {
host: {
cflags: ["-fno-rtti"],
},
},
}
//###############################################################################
// Host modules
cc_library_host_static {
name: "libubsan_standalone",
include_dirs: ubsan_rtl_c_includes,
cppflags: ubsan_rtl_cppflags + ["-fno-rtti"],
srcs: ubsan_rtl_files,
whole_static_libs: ["libsan"],
stl: "none",
sanitize: {
never: true,
},
compile_multilib: "both",
target: {
darwin: {
enabled: false,
},
},
}
cc_library_host_static {
name: "libubsan_cxx",
include_dirs: ubsan_rtl_c_includes,
cppflags: ubsan_rtl_cppflags,
srcs: ubsan_cxx_rtl_files,
sanitize: {
never: true,
},
compile_multilib: "both",
target: {
darwin: {
enabled: false,
},
},
}
cc_library_host_static {
name: "libubsan_standalone_cxx",
include_dirs: ubsan_rtl_c_includes,
cppflags: ubsan_rtl_cppflags,
srcs: ubsan_cxx_rtl_files,
sanitize: {
never: true,
},
compile_multilib: "both",
target: {
darwin: {
enabled: false,
},
},
}