diff options
author | Colin Cross <ccross@android.com> | 2016-04-07 13:27:37 -0700 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2016-05-04 11:22:23 -0700 |
commit | fbdb443fc5f02ecbd2ac52df5f60bd3d0ee3c10f (patch) | |
tree | 292d34a832968b7594968750d44dc40d230acff2 /lib/sanitizer_common | |
parent | 10a5e4fc4e91a23b87499066bc8eb4af888cc020 (diff) | |
download | compiler-rt-fbdb443fc5f02ecbd2ac52df5f60bd3d0ee3c10f.tar.gz |
Build sanitizer libraries
Change-Id: I4a67cc82f6d5aa80fdff286582ba84b68fe09e22
Diffstat (limited to 'lib/sanitizer_common')
-rw-r--r-- | lib/sanitizer_common/Android.bp | 96 | ||||
-rw-r--r-- | lib/sanitizer_common/tests/Android.bp | 107 |
2 files changed, 203 insertions, 0 deletions
diff --git a/lib/sanitizer_common/Android.bp b/lib/sanitizer_common/Android.bp new file mode 100644 index 000000000..0348d679b --- /dev/null +++ b/lib/sanitizer_common/Android.bp @@ -0,0 +1,96 @@ +// +// 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. +// +// + +//############################################################################### +// Host modules + +cc_library_host_static { + name: "libsan", + + include_dirs: ["external/compiler-rt/lib"], + cppflags: [ + "-fvisibility=hidden", + "-fno-exceptions", + "-std=c++11", + "-Wall", + "-Werror", + "-Wno-unused-parameter", + ], + srcs: [ + // rtl + "sanitizer_allocator.cc", + "sanitizer_common.cc", + "sanitizer_deadlock_detector1.cc", + "sanitizer_deadlock_detector2.cc", + "sanitizer_flags.cc", + "sanitizer_flag_parser.cc", + "sanitizer_libc.cc", + "sanitizer_libignore.cc", + "sanitizer_linux.cc", + "sanitizer_mac.cc", + "sanitizer_persistent_allocator.cc", + "sanitizer_platform_limits_linux.cc", + "sanitizer_platform_limits_posix.cc", + "sanitizer_posix.cc", + "sanitizer_printf.cc", + "sanitizer_procmaps_common.cc", + "sanitizer_procmaps_freebsd.cc", + "sanitizer_procmaps_linux.cc", + "sanitizer_procmaps_mac.cc", + "sanitizer_stackdepot.cc", + "sanitizer_stacktrace.cc", + "sanitizer_stacktrace_printer.cc", + "sanitizer_suppressions.cc", + "sanitizer_symbolizer.cc", + "sanitizer_symbolizer_libbacktrace.cc", + "sanitizer_symbolizer_win.cc", + "sanitizer_tls_get_addr.cc", + "sanitizer_thread_registry.cc", + "sanitizer_win.cc", + + // cdep + "sanitizer_common_libcdep.cc", + "sanitizer_coverage_libcdep.cc", + "sanitizer_coverage_mapping_libcdep.cc", + "sanitizer_linux_libcdep.cc", + "sanitizer_posix_libcdep.cc", + "sanitizer_stacktrace_libcdep.cc", + "sanitizer_stoptheworld_linux_libcdep.cc", + "sanitizer_symbolizer_libcdep.cc", + "sanitizer_symbolizer_posix_libcdep.cc", + "sanitizer_unwind_linux_libcdep.cc", + ], + stl: "none", + sanitize: { + never: true, + }, + compile_multilib: "both", + target: { + darwin: { + enabled: false, + }, + }, +} + +subdirs = ["tests"] + +// ANDROIDMK TRANSLATION ERROR: unsupported conditional +// ifndef SANITIZE_HOST +// ANDROIDMK TRANSLATION ERROR: unsupported include +// include $(LOCAL_PATH)/tests/Android.mk +// ANDROIDMK TRANSLATION ERROR: endif from unsupported contitional +// endif diff --git a/lib/sanitizer_common/tests/Android.bp b/lib/sanitizer_common/tests/Android.bp new file mode 100644 index 000000000..4547e6a98 --- /dev/null +++ b/lib/sanitizer_common/tests/Android.bp @@ -0,0 +1,107 @@ +// +// 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. +// +// + +cc_defaults { + name: "san_test_defaults", + + cppflags: [ + "-fvisibility=hidden", + "-fno-exceptions", + "-fno-rtti", + "-std=c++11", + "-Wall", + "-Werror", + "-Wno-unused-parameter", + "-Wno-non-virtual-dtor", + ], + + include_dirs: ["external/compiler-rt/lib"], +} + + +cc_test_host { + name: "san_test", + defaults: ["san_test_defaults"], + + srcs: [ + "sanitizer_allocator_test.cc", + "sanitizer_atomic_test.cc", + "sanitizer_bitvector_test.cc", + "sanitizer_bvgraph_test.cc", + "sanitizer_common_test.cc", + "sanitizer_deadlock_detector_test.cc", + "sanitizer_flags_test.cc", + "sanitizer_format_interceptor_test.cc", + "sanitizer_ioctl_test.cc", + "sanitizer_libc_test.cc", + "sanitizer_linux_test.cc", + "sanitizer_list_test.cc", + "sanitizer_mutex_test.cc", + "sanitizer_nolibc_test.cc", + "sanitizer_posix_test.cc", + "sanitizer_printf_test.cc", + "sanitizer_procmaps_test.cc", + "sanitizer_stackdepot_test.cc", + "sanitizer_stacktrace_printer_test.cc", + "sanitizer_stacktrace_test.cc", + "sanitizer_stoptheworld_test.cc", + "sanitizer_suppressions_test.cc", + "sanitizer_test_main.cc", + "sanitizer_thread_registry_test.cc", + ], + static_libs: ["libsan"], + host_ldlibs: [ + "-ldl", + "-lrt", + ], + sanitize: { + never: true, + }, + target: { + darwin: { + enabled: false, + }, + }, +} + +cc_binary_host { + name: "san_test-Nolibc", + defaults: ["san_test_defaults"], + + include_dirs: ["external/gtest/include"], + srcs: ["sanitizer_nolibc_test_main.cc"], + static_libs: [ + "libsan", + "libgtest_host", + ], + ldflags: [ + "-nostdlib", + "-Qunused-arguments", + ], + host_ldlibs: [ + "-ldl", + "-lrt", + ], + sanitize: { + never: true, + }, + target: { + darwin: { + enabled: false, + }, + }, +} |