2014-01-30 10:13:33 +01: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.
|
|
|
|
#
|
2013-09-27 21:43:15 +02:00
|
|
|
|
2014-01-30 10:13:33 +01:00
|
|
|
LOCAL_PATH:= $(call my-dir)
|
2013-10-21 22:30:52 +02:00
|
|
|
|
2015-03-27 03:18:36 +01:00
|
|
|
libbacktrace_common_cflags := \
|
2013-10-21 22:30:52 +02:00
|
|
|
-Wall \
|
|
|
|
-Werror \
|
|
|
|
|
2015-03-27 03:18:36 +01:00
|
|
|
libbacktrace_common_conlyflags := \
|
2013-10-21 22:30:52 +02:00
|
|
|
-std=gnu99 \
|
|
|
|
|
2015-03-27 03:18:36 +01:00
|
|
|
libbacktrace_common_cppflags := \
|
2013-10-21 22:30:52 +02:00
|
|
|
-std=gnu++11 \
|
2015-09-22 06:46:57 +02:00
|
|
|
-I external/libunwind/include/tdep \
|
2013-10-21 22:30:52 +02:00
|
|
|
|
2015-03-31 18:39:20 +02:00
|
|
|
# The latest clang (r230699) does not allow SP/PC to be declared in inline asm lists.
|
|
|
|
libbacktrace_common_clang_cflags += \
|
|
|
|
-Wno-inline-asm
|
|
|
|
|
2014-01-30 10:13:33 +01:00
|
|
|
build_host := false
|
|
|
|
ifeq ($(HOST_OS),linux)
|
|
|
|
ifeq ($(HOST_ARCH),$(filter $(HOST_ARCH),x86 x86_64))
|
|
|
|
build_host := true
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2015-09-22 06:46:57 +02:00
|
|
|
LLVM_ROOT_PATH := external/llvm
|
|
|
|
include $(LLVM_ROOT_PATH)/llvm.mk
|
|
|
|
|
2014-01-30 10:13:33 +01:00
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
# The libbacktrace library.
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
libbacktrace_src_files := \
|
2015-03-27 03:18:36 +01:00
|
|
|
Backtrace.cpp \
|
|
|
|
BacktraceCurrent.cpp \
|
2014-01-30 10:13:33 +01:00
|
|
|
BacktraceMap.cpp \
|
2015-03-27 03:18:36 +01:00
|
|
|
BacktracePtrace.cpp \
|
2014-01-30 10:13:33 +01:00
|
|
|
thread_utils.c \
|
2015-03-27 03:18:36 +01:00
|
|
|
ThreadEntry.cpp \
|
2013-10-21 22:30:52 +02:00
|
|
|
UnwindCurrent.cpp \
|
2014-01-23 04:21:07 +01:00
|
|
|
UnwindMap.cpp \
|
2013-10-21 22:30:52 +02:00
|
|
|
UnwindPtrace.cpp \
|
2013-09-27 21:43:15 +02:00
|
|
|
|
2014-01-30 10:13:33 +01:00
|
|
|
libbacktrace_shared_libraries := \
|
2015-03-27 03:18:36 +01:00
|
|
|
libbase \
|
2014-01-30 10:13:33 +01:00
|
|
|
liblog \
|
2015-04-29 02:49:42 +02:00
|
|
|
libunwind \
|
2013-10-21 22:30:52 +02:00
|
|
|
|
2016-02-01 16:17:45 +01:00
|
|
|
libbacktrace_static_libraries := \
|
|
|
|
libcutils
|
|
|
|
|
2016-01-26 01:17:48 +01:00
|
|
|
module := libbacktrace
|
|
|
|
module_tag := optional
|
|
|
|
build_type := target
|
|
|
|
build_target := SHARED_LIBRARY
|
|
|
|
include $(LOCAL_PATH)/Android.build.mk
|
|
|
|
build_type := host
|
|
|
|
libbacktrace_multilib := both
|
|
|
|
include $(LOCAL_PATH)/Android.build.mk
|
2016-02-10 22:46:06 +01:00
|
|
|
|
|
|
|
libbacktrace_shared_libraries :=
|
|
|
|
|
2016-01-26 01:17:48 +01:00
|
|
|
libbacktrace_static_libraries := \
|
|
|
|
libbase \
|
|
|
|
liblog \
|
|
|
|
libunwind \
|
2016-02-10 22:46:06 +01:00
|
|
|
liblzma \
|
2016-01-26 01:17:48 +01:00
|
|
|
|
2016-02-10 22:46:06 +01:00
|
|
|
module := libbacktrace
|
|
|
|
build_type := target
|
2016-01-26 01:17:48 +01:00
|
|
|
build_target := STATIC_LIBRARY
|
|
|
|
include $(LOCAL_PATH)/Android.build.mk
|
2016-02-10 22:46:06 +01:00
|
|
|
build_type := host
|
|
|
|
libbacktrace_multilib := both
|
|
|
|
include $(LOCAL_PATH)/Android.build.mk
|
2016-01-26 01:17:48 +01:00
|
|
|
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
# The libbacktrace_offline shared library.
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
libbacktrace_offline_src_files := \
|
|
|
|
BacktraceOffline.cpp \
|
|
|
|
|
2016-03-19 02:46:08 +01:00
|
|
|
# Use shared llvm library on device to save space.
|
2016-01-26 01:17:48 +01:00
|
|
|
libbacktrace_offline_shared_libraries := \
|
|
|
|
libbacktrace \
|
2016-03-19 02:46:08 +01:00
|
|
|
libbase \
|
2016-01-26 01:17:48 +01:00
|
|
|
liblog \
|
|
|
|
libunwind \
|
2016-03-19 02:46:08 +01:00
|
|
|
libutils \
|
2015-09-22 06:46:57 +02:00
|
|
|
libLLVM \
|
|
|
|
|
2016-03-19 02:46:08 +01:00
|
|
|
libbacktrace_offline_static_libraries := \
|
|
|
|
libziparchive \
|
|
|
|
libz \
|
|
|
|
|
|
|
|
module := libbacktrace_offline
|
|
|
|
build_type := target
|
|
|
|
build_target := SHARED_LIBRARY
|
|
|
|
include $(LOCAL_PATH)/Android.build.mk
|
|
|
|
|
|
|
|
libbacktrace_offline_shared_libraries := \
|
|
|
|
libbacktrace \
|
|
|
|
libbase \
|
|
|
|
liblog \
|
|
|
|
libunwind \
|
|
|
|
libziparchive-host \
|
|
|
|
|
2015-09-22 06:46:57 +02:00
|
|
|
# Use static llvm libraries on host to remove dependency on 32-bit llvm shared library
|
|
|
|
# which is not included in the prebuilt.
|
2016-03-19 02:46:08 +01:00
|
|
|
libbacktrace_offline_static_libraries := \
|
2015-09-22 06:46:57 +02:00
|
|
|
libLLVMObject \
|
|
|
|
libLLVMBitReader \
|
|
|
|
libLLVMMC \
|
|
|
|
libLLVMMCParser \
|
|
|
|
libLLVMCore \
|
|
|
|
libLLVMSupport \
|
|
|
|
|
2016-01-26 01:17:48 +01:00
|
|
|
module := libbacktrace_offline
|
2014-01-30 10:13:33 +01:00
|
|
|
build_type := host
|
2014-11-12 00:15:21 +01:00
|
|
|
libbacktrace_multilib := both
|
2014-01-30 10:13:33 +01:00
|
|
|
include $(LOCAL_PATH)/Android.build.mk
|
|
|
|
|
2016-02-10 22:46:06 +01:00
|
|
|
libbacktrace_offline_shared_libraries :=
|
|
|
|
libbacktrace_offline_static_libraries := \
|
|
|
|
libbacktrace \
|
|
|
|
libbase \
|
|
|
|
libcutils \
|
|
|
|
liblog \
|
|
|
|
libunwind \
|
|
|
|
liblzma \
|
2016-03-19 02:46:08 +01:00
|
|
|
libziparchive \
|
|
|
|
libz \
|
2016-02-10 22:46:06 +01:00
|
|
|
libLLVMObject \
|
|
|
|
libLLVMBitReader \
|
|
|
|
libLLVMMC \
|
|
|
|
libLLVMMCParser \
|
|
|
|
libLLVMCore \
|
|
|
|
libLLVMSupport \
|
|
|
|
|
|
|
|
module := libbacktrace_offline
|
|
|
|
build_type := target
|
|
|
|
build_target := STATIC_LIBRARY
|
|
|
|
include $(LOCAL_PATH)/Android.build.mk
|
|
|
|
|
2014-01-30 10:13:33 +01:00
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
# The libbacktrace_test library needed by backtrace_test.
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
libbacktrace_test_cflags := \
|
2013-09-27 21:43:15 +02:00
|
|
|
-O0 \
|
|
|
|
|
2014-01-30 10:13:33 +01:00
|
|
|
libbacktrace_test_src_files := \
|
|
|
|
backtrace_testlib.c \
|
|
|
|
|
2015-09-22 06:46:57 +02:00
|
|
|
libbacktrace_test_strip_module := false
|
|
|
|
|
2014-01-30 10:13:33 +01:00
|
|
|
module := libbacktrace_test
|
|
|
|
module_tag := debug
|
|
|
|
build_type := target
|
|
|
|
build_target := SHARED_LIBRARY
|
2015-03-27 03:18:36 +01:00
|
|
|
libbacktrace_test_multilib := both
|
2014-01-30 10:13:33 +01:00
|
|
|
include $(LOCAL_PATH)/Android.build.mk
|
|
|
|
build_type := host
|
|
|
|
include $(LOCAL_PATH)/Android.build.mk
|
|
|
|
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
# The backtrace_test executable.
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
backtrace_test_cflags := \
|
2013-10-21 22:30:52 +02:00
|
|
|
-fno-builtin \
|
|
|
|
-O0 \
|
|
|
|
-g \
|
2014-01-15 01:44:31 +01:00
|
|
|
|
2014-01-30 10:13:33 +01:00
|
|
|
backtrace_test_cflags_target := \
|
2014-03-08 04:42:19 +01:00
|
|
|
-DENABLE_PSS_TESTS \
|
2013-10-21 22:30:52 +02:00
|
|
|
|
2014-01-30 10:13:33 +01:00
|
|
|
backtrace_test_src_files := \
|
2015-09-22 06:46:57 +02:00
|
|
|
backtrace_offline_test.cpp \
|
2014-01-30 10:13:33 +01:00
|
|
|
backtrace_test.cpp \
|
2014-03-08 04:42:19 +01:00
|
|
|
GetPss.cpp \
|
2014-01-30 10:13:33 +01:00
|
|
|
thread_utils.c \
|
2013-09-27 21:43:15 +02:00
|
|
|
|
2014-01-30 10:13:33 +01:00
|
|
|
backtrace_test_ldlibs_host := \
|
2014-05-08 00:36:05 +02:00
|
|
|
-lpthread \
|
2013-10-02 23:19:19 +02:00
|
|
|
-lrt \
|
|
|
|
|
2014-01-30 10:13:33 +01:00
|
|
|
backtrace_test_shared_libraries := \
|
|
|
|
libbacktrace_test \
|
|
|
|
libbacktrace \
|
2016-01-26 01:17:48 +01:00
|
|
|
libbacktrace_offline \
|
2015-05-09 00:44:46 +02:00
|
|
|
libbase \
|
2014-01-30 10:13:33 +01:00
|
|
|
libcutils \
|
2015-09-22 06:46:57 +02:00
|
|
|
libunwind \
|
2013-10-21 22:30:52 +02:00
|
|
|
|
2015-05-09 00:44:46 +02:00
|
|
|
backtrace_test_shared_libraries_target += \
|
|
|
|
libdl \
|
|
|
|
|
|
|
|
backtrace_test_ldlibs_host += \
|
|
|
|
-ldl \
|
2014-05-07 00:23:59 +02:00
|
|
|
|
2015-09-22 06:46:57 +02:00
|
|
|
backtrace_test_strip_module := false
|
|
|
|
|
2014-01-30 10:13:33 +01:00
|
|
|
module := backtrace_test
|
|
|
|
module_tag := debug
|
|
|
|
build_type := target
|
|
|
|
build_target := NATIVE_TEST
|
2015-03-27 03:18:36 +01:00
|
|
|
backtrace_test_multilib := both
|
2014-01-30 10:13:33 +01:00
|
|
|
include $(LOCAL_PATH)/Android.build.mk
|
|
|
|
build_type := host
|
|
|
|
include $(LOCAL_PATH)/Android.build.mk
|
2013-10-02 23:19:19 +02:00
|
|
|
|
2014-01-10 09:43:54 +01:00
|
|
|
#----------------------------------------------------------------------------
|
2014-01-30 10:13:33 +01:00
|
|
|
# Special truncated libbacktrace library for mac.
|
2014-01-10 09:43:54 +01:00
|
|
|
#----------------------------------------------------------------------------
|
2014-01-30 10:13:33 +01:00
|
|
|
ifeq ($(HOST_OS),darwin)
|
2014-01-10 09:43:54 +01:00
|
|
|
|
2013-09-27 21:43:15 +02:00
|
|
|
include $(CLEAR_VARS)
|
|
|
|
|
2014-01-30 10:13:33 +01:00
|
|
|
LOCAL_MODULE := libbacktrace
|
|
|
|
LOCAL_MODULE_TAGS := optional
|
2013-09-27 21:43:15 +02:00
|
|
|
|
|
|
|
LOCAL_SRC_FILES := \
|
2014-01-30 10:13:33 +01:00
|
|
|
BacktraceMap.cpp \
|
2013-10-21 22:30:52 +02:00
|
|
|
|
2014-11-13 23:54:10 +01:00
|
|
|
LOCAL_MULTILIB := both
|
|
|
|
|
2013-09-27 21:43:15 +02:00
|
|
|
include $(BUILD_HOST_SHARED_LIBRARY)
|
|
|
|
|
2014-01-30 10:13:33 +01:00
|
|
|
endif # HOST_OS-darwin
|