* commit '2c3b9a444f44402142f3ca37a91f529fc81fbfd3': Create a bare bones host libbacktrace on mac.
This commit is contained in:
commit
117e93a720
3 changed files with 35 additions and 17 deletions
|
|
@ -168,18 +168,15 @@ LOCAL_ADDITIONAL_DEPENDENCIES := \
|
||||||
include $(BUILD_NATIVE_TEST)
|
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
|
# The host libbacktrace library using libcorkscrew
|
||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
include $(CLEAR_VARS)
|
include $(CLEAR_VARS)
|
||||||
|
|
||||||
LOCAL_SRC_FILES += \
|
|
||||||
$(common_src) \
|
|
||||||
Corkscrew.cpp \
|
|
||||||
|
|
||||||
LOCAL_CFLAGS += \
|
LOCAL_CFLAGS += \
|
||||||
$(common_cflags) \
|
$(common_cflags) \
|
||||||
|
|
@ -187,21 +184,12 @@ LOCAL_CFLAGS += \
|
||||||
LOCAL_CONLYFLAGS += \
|
LOCAL_CONLYFLAGS += \
|
||||||
$(common_conlyflags) \
|
$(common_conlyflags) \
|
||||||
|
|
||||||
LOCAL_CPPFLAGS += \
|
|
||||||
$(common_cppflags) \
|
|
||||||
|
|
||||||
LOCAL_C_INCLUDES := \
|
LOCAL_C_INCLUDES := \
|
||||||
$(common_c_includes) \
|
$(common_c_includes) \
|
||||||
system/core/libcorkscrew \
|
|
||||||
|
|
||||||
LOCAL_SHARED_LIBRARIES := \
|
LOCAL_SHARED_LIBRARIES := \
|
||||||
libgccdemangle \
|
libgccdemangle \
|
||||||
liblog \
|
liblog \
|
||||||
libcorkscrew \
|
|
||||||
|
|
||||||
LOCAL_LDLIBS += \
|
|
||||||
-ldl \
|
|
||||||
-lrt \
|
|
||||||
|
|
||||||
LOCAL_MODULE := libbacktrace
|
LOCAL_MODULE := libbacktrace
|
||||||
LOCAL_MODULE_TAGS := optional
|
LOCAL_MODULE_TAGS := optional
|
||||||
|
|
@ -209,8 +197,37 @@ LOCAL_MODULE_TAGS := optional
|
||||||
LOCAL_ADDITIONAL_DEPENDENCIES := \
|
LOCAL_ADDITIONAL_DEPENDENCIES := \
|
||||||
$(LOCAL_PATH)/Android.mk
|
$(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 \
|
||||||
|
|
||||||
|
else
|
||||||
|
LOCAL_SRC_FILES += \
|
||||||
|
map_info.c \
|
||||||
|
|
||||||
|
endif
|
||||||
|
|
||||||
include $(BUILD_HOST_SHARED_LIBRARY)
|
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
|
# libbacktrace host test library, all optimizations turned off
|
||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
|
|
@ -263,4 +280,6 @@ LOCAL_ADDITIONAL_DEPENDENCIES := \
|
||||||
|
|
||||||
include $(BUILD_HOST_NATIVE_TEST)
|
include $(BUILD_HOST_NATIVE_TEST)
|
||||||
|
|
||||||
endif # HOST_OS-HOST_ARCH == linux-x86
|
endif # HOST_OS == linux
|
||||||
|
|
||||||
|
endif # HOST_ARCH == x86
|
||||||
|
|
|
||||||
|
|
@ -87,7 +87,7 @@ std::string Backtrace::GetFunctionName(uintptr_t pc, uintptr_t* offset) {
|
||||||
if (!func_name.empty()) {
|
if (!func_name.empty()) {
|
||||||
#if defined(__APPLE__)
|
#if defined(__APPLE__)
|
||||||
// Mac OS' __cxa_demangle demangles "f" as "float"; last tested on 10.7.
|
// Mac OS' __cxa_demangle demangles "f" as "float"; last tested on 10.7.
|
||||||
if (symbol_name[0] != '_') {
|
if (func_name[0] != '_') {
|
||||||
return func_name;
|
return func_name;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,6 @@
|
||||||
#define _LIBBACKTRACE_BACKTRACE_THREAD_H
|
#define _LIBBACKTRACE_BACKTRACE_THREAD_H
|
||||||
|
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
#include <pthread.h>
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#include "Backtrace.h"
|
#include "Backtrace.h"
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue