2016-07-13 02:20:18 +02:00
|
|
|
//
|
|
|
|
// Copyright (C) 2014 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: "libbacktrace_common",
|
|
|
|
|
|
|
|
cflags: [
|
|
|
|
"-Wall",
|
|
|
|
"-Werror",
|
|
|
|
],
|
|
|
|
|
|
|
|
target: {
|
|
|
|
darwin: {
|
|
|
|
enabled: false,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
libbacktrace_sources = [
|
|
|
|
"Backtrace.cpp",
|
|
|
|
"BacktraceCurrent.cpp",
|
|
|
|
"BacktracePtrace.cpp",
|
|
|
|
"ThreadEntry.cpp",
|
2017-07-27 18:29:18 +02:00
|
|
|
"UnwindStack.cpp",
|
|
|
|
"UnwindStackMap.cpp",
|
2016-07-13 02:20:18 +02:00
|
|
|
]
|
|
|
|
|
2017-04-11 20:22:43 +02:00
|
|
|
cc_library_headers {
|
|
|
|
name: "libbacktrace_headers",
|
2017-04-14 06:01:40 +02:00
|
|
|
vendor_available: true,
|
2018-04-27 14:48:43 +02:00
|
|
|
recovery_available: true,
|
2019-05-16 14:07:43 +02:00
|
|
|
native_bridge_supported: true,
|
2017-04-11 20:22:43 +02:00
|
|
|
export_include_dirs: ["include"],
|
|
|
|
}
|
|
|
|
|
2016-07-13 02:20:18 +02:00
|
|
|
cc_library {
|
|
|
|
name: "libbacktrace",
|
2017-08-23 06:25:21 +02:00
|
|
|
vendor_available: false,
|
2018-05-24 07:11:00 +02:00
|
|
|
recovery_available: true,
|
2017-07-31 08:41:10 +02:00
|
|
|
vndk: {
|
|
|
|
enabled: true,
|
|
|
|
support_system_process: true,
|
|
|
|
},
|
2016-07-13 02:20:18 +02:00
|
|
|
defaults: ["libbacktrace_common"],
|
|
|
|
host_supported: true,
|
|
|
|
|
2017-10-23 23:25:08 +02:00
|
|
|
cflags: [
|
|
|
|
"-Wexit-time-destructors",
|
|
|
|
],
|
|
|
|
|
2016-07-13 02:20:18 +02:00
|
|
|
srcs: [
|
|
|
|
"BacktraceMap.cpp",
|
|
|
|
],
|
|
|
|
|
2017-04-11 20:22:43 +02:00
|
|
|
export_include_dirs: ["include"],
|
|
|
|
|
2016-07-13 02:20:18 +02:00
|
|
|
target: {
|
|
|
|
darwin: {
|
|
|
|
enabled: true,
|
2018-02-16 23:52:26 +01:00
|
|
|
shared_libs: [
|
2018-02-17 02:58:14 +01:00
|
|
|
"libbase",
|
|
|
|
],
|
2016-07-13 02:20:18 +02:00
|
|
|
},
|
2017-10-03 23:17:31 +02:00
|
|
|
linux: {
|
2017-03-15 23:23:36 +01:00
|
|
|
srcs: libbacktrace_sources,
|
|
|
|
|
|
|
|
shared_libs: [
|
|
|
|
"libbase",
|
|
|
|
"liblog",
|
2017-07-27 18:29:18 +02:00
|
|
|
"libunwindstack",
|
2017-03-15 23:23:36 +01:00
|
|
|
],
|
|
|
|
|
2018-05-11 02:19:12 +02:00
|
|
|
static_libs: [
|
|
|
|
"libprocinfo",
|
|
|
|
],
|
2017-03-15 23:23:36 +01:00
|
|
|
},
|
2016-07-13 02:20:18 +02:00
|
|
|
android: {
|
2017-10-03 23:17:31 +02:00
|
|
|
static_libs: ["libasync_safe"],
|
2016-07-13 02:20:18 +02:00
|
|
|
},
|
2018-01-19 19:26:36 +01:00
|
|
|
vendor: {
|
2018-01-31 04:47:24 +01:00
|
|
|
cflags: ["-DNO_LIBDEXFILE_SUPPORT"],
|
2018-02-17 02:58:14 +01:00
|
|
|
},
|
2018-05-24 07:11:00 +02:00
|
|
|
recovery: {
|
|
|
|
cflags: ["-DNO_LIBDEXFILE_SUPPORT"],
|
|
|
|
},
|
2016-07-13 02:20:18 +02:00
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2018-06-30 01:05:35 +02:00
|
|
|
cc_test_library {
|
2016-07-13 02:20:18 +02:00
|
|
|
name: "libbacktrace_test",
|
|
|
|
defaults: ["libbacktrace_common"],
|
|
|
|
host_supported: true,
|
|
|
|
strip: {
|
|
|
|
none: true,
|
|
|
|
},
|
|
|
|
cflags: ["-O0"],
|
2017-03-23 22:55:01 +01:00
|
|
|
srcs: ["backtrace_testlib.cpp"],
|
2016-11-16 02:47:09 +01:00
|
|
|
|
2017-12-12 02:44:33 +01:00
|
|
|
shared_libs: [
|
2018-02-17 02:58:14 +01:00
|
|
|
"libunwindstack",
|
2016-12-15 02:24:46 +01:00
|
|
|
],
|
2018-06-30 01:05:35 +02:00
|
|
|
relative_install_path: "backtrace_test_libs",
|
|
|
|
|
|
|
|
target: {
|
|
|
|
linux_glibc: {
|
|
|
|
// This forces the creation of eh_frame with unwind information
|
|
|
|
// for host.
|
|
|
|
cflags: [
|
|
|
|
"-fcxx-exceptions"
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
2016-12-15 02:24:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
// The backtrace_test executable.
|
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
cc_test {
|
|
|
|
name: "backtrace_test",
|
2018-06-30 01:05:35 +02:00
|
|
|
isolated: true,
|
2016-12-15 02:24:46 +01:00
|
|
|
defaults: ["libbacktrace_common"],
|
|
|
|
host_supported: true,
|
|
|
|
srcs: [
|
|
|
|
"backtrace_test.cpp",
|
|
|
|
],
|
|
|
|
|
|
|
|
cflags: [
|
|
|
|
"-fno-builtin",
|
|
|
|
"-O0",
|
|
|
|
"-g",
|
|
|
|
],
|
|
|
|
|
|
|
|
shared_libs: [
|
|
|
|
"libbacktrace",
|
|
|
|
"libbase",
|
|
|
|
"liblog",
|
2017-07-27 18:29:18 +02:00
|
|
|
"libunwindstack",
|
2016-12-15 02:24:46 +01:00
|
|
|
],
|
|
|
|
|
|
|
|
group_static_libs: true,
|
|
|
|
|
2018-06-30 01:05:35 +02:00
|
|
|
// So that the dlopen can find the libbacktrace_test.so.
|
|
|
|
ldflags: [
|
|
|
|
"-Wl,--rpath,${ORIGIN}/../backtrace_test_libs",
|
|
|
|
],
|
2017-08-29 01:31:18 +02:00
|
|
|
|
2018-04-28 01:12:06 +02:00
|
|
|
test_suites: ["device-tests"],
|
2017-08-29 01:31:18 +02:00
|
|
|
data: [
|
|
|
|
"testdata/arm/*",
|
|
|
|
"testdata/arm64/*",
|
|
|
|
"testdata/x86/*",
|
|
|
|
"testdata/x86_64/*",
|
|
|
|
],
|
2018-05-03 19:06:45 +02:00
|
|
|
required: [
|
|
|
|
"libbacktrace_test",
|
|
|
|
],
|
2016-12-15 02:24:46 +01:00
|
|
|
}
|
2017-08-19 00:10:53 +02:00
|
|
|
|
|
|
|
cc_benchmark {
|
|
|
|
name: "backtrace_benchmarks",
|
|
|
|
defaults: ["libbacktrace_common"],
|
|
|
|
|
|
|
|
srcs: [
|
|
|
|
"backtrace_benchmarks.cpp",
|
2017-12-08 02:41:18 +01:00
|
|
|
"backtrace_read_benchmarks.cpp",
|
2017-08-19 00:10:53 +02:00
|
|
|
],
|
|
|
|
|
|
|
|
shared_libs: [
|
|
|
|
"libbacktrace",
|
|
|
|
"libbase",
|
2017-10-26 00:12:24 +02:00
|
|
|
"libunwindstack",
|
2017-08-19 00:10:53 +02:00
|
|
|
],
|
|
|
|
}
|