summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libbacktrace/Android.mk47
-rw-r--r--libbacktrace/Backtrace.cpp2
-rw-r--r--libbacktrace/BacktraceThread.h1
3 files changed, 34 insertions, 16 deletions
diff --git a/libbacktrace/Android.mk b/libbacktrace/Android.mk
index a6b9c2b..8995fc1 100644
--- a/libbacktrace/Android.mk
+++ b/libbacktrace/Android.mk
@@ -168,18 +168,15 @@ LOCAL_ADDITIONAL_DEPENDENCIES := \
include $(BUILD_NATIVE_TEST)
#----------------------------------------------------------------------------
-# Only linux-x86 host versions of libbacktrace supported.
+# Only x86 host versions of libbacktrace supported.
#----------------------------------------------------------------------------
-ifeq ($(HOST_OS)-$(HOST_ARCH),linux-x86)
+ifeq ($(HOST_ARCH),x86)
#----------------------------------------------------------------------------
# The host libbacktrace library using libcorkscrew
#----------------------------------------------------------------------------
include $(CLEAR_VARS)
-LOCAL_SRC_FILES += \
- $(common_src) \
- Corkscrew.cpp \
LOCAL_CFLAGS += \
$(common_cflags) \
@@ -187,31 +184,51 @@ LOCAL_CFLAGS += \
LOCAL_CONLYFLAGS += \
$(common_conlyflags) \
-LOCAL_CPPFLAGS += \
- $(common_cppflags) \
-
LOCAL_C_INCLUDES := \
$(common_c_includes) \
- system/core/libcorkscrew \
LOCAL_SHARED_LIBRARIES := \
libgccdemangle \
liblog \
+
+LOCAL_MODULE := libbacktrace
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_ADDITIONAL_DEPENDENCIES := \
+ $(LOCAL_PATH)/Android.mk
+
+ifeq ($(HOST_OS),linux)
+LOCAL_SRC_FILES += \
+ $(common_src) \
+ Corkscrew.cpp \
+
+LOCAL_C_INCLUDES += \
+ system/core/libcorkscrew \
+
+LOCAL_SHARED_LIBRARIES := \
libcorkscrew \
+LOCAL_CPPFLAGS += \
+ $(common_cppflags) \
+
LOCAL_LDLIBS += \
-ldl \
-lrt \
-LOCAL_MODULE := libbacktrace
-LOCAL_MODULE_TAGS := optional
+else
+LOCAL_SRC_FILES += \
+ map_info.c \
-LOCAL_ADDITIONAL_DEPENDENCIES := \
- $(LOCAL_PATH)/Android.mk
+endif
include $(BUILD_HOST_SHARED_LIBRARY)
#----------------------------------------------------------------------------
+# The host test is only supported on linux.
+#----------------------------------------------------------------------------
+ifeq ($(HOST_OS),linux)
+
+#----------------------------------------------------------------------------
# libbacktrace host test library, all optimizations turned off
#----------------------------------------------------------------------------
include $(CLEAR_VARS)
@@ -263,4 +280,6 @@ LOCAL_ADDITIONAL_DEPENDENCIES := \
include $(BUILD_HOST_NATIVE_TEST)
-endif # HOST_OS-HOST_ARCH == linux-x86
+endif # HOST_OS == linux
+
+endif # HOST_ARCH == x86
diff --git a/libbacktrace/Backtrace.cpp b/libbacktrace/Backtrace.cpp
index fa85872..20667e0 100644
--- a/libbacktrace/Backtrace.cpp
+++ b/libbacktrace/Backtrace.cpp
@@ -87,7 +87,7 @@ std::string Backtrace::GetFunctionName(uintptr_t pc, uintptr_t* offset) {
if (!func_name.empty()) {
#if defined(__APPLE__)
// Mac OS' __cxa_demangle demangles "f" as "float"; last tested on 10.7.
- if (symbol_name[0] != '_') {
+ if (func_name[0] != '_') {
return func_name;
}
#endif
diff --git a/libbacktrace/BacktraceThread.h b/libbacktrace/BacktraceThread.h
index bcb56c9..a4b6ecb 100644
--- a/libbacktrace/BacktraceThread.h
+++ b/libbacktrace/BacktraceThread.h
@@ -18,7 +18,6 @@
#define _LIBBACKTRACE_BACKTRACE_THREAD_H
#include <inttypes.h>
-#include <pthread.h>
#include <sys/types.h>
#include "Backtrace.h"