am 62e6fe58
: Merge "Fix compilation of crtbegin.c and pthread_debug.cpp."
* commit '62e6fe58490da764efebffe71ebf6c647695802e': Fix compilation of crtbegin.c and pthread_debug.cpp.
This commit is contained in:
commit
63d56a00e9
@ -605,10 +605,16 @@ ifneq ($(BOARD_MALLOC_ALIGNMENT),)
|
|||||||
libc_common_cflags += -DMALLOC_ALIGNMENT=$(BOARD_MALLOC_ALIGNMENT)
|
libc_common_cflags += -DMALLOC_ALIGNMENT=$(BOARD_MALLOC_ALIGNMENT)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# crtbrand.c needs <stdint.h> and a #define for the platform SDK version.
|
||||||
|
libc_crt_target_cflags := \
|
||||||
|
-I$(LOCAL_PATH)/include \
|
||||||
|
-I$(LOCAL_PATH)/arch-$(TARGET_ARCH)/include \
|
||||||
|
-DPLATFORM_SDK_VERSION=$(PLATFORM_SDK_VERSION) \
|
||||||
|
|
||||||
ifeq ($(TARGET_ARCH),arm)
|
ifeq ($(TARGET_ARCH),arm)
|
||||||
libc_common_cflags += -DSOFTFLOAT
|
libc_common_cflags += -DSOFTFLOAT
|
||||||
libc_common_cflags += -fstrict-aliasing
|
libc_common_cflags += -fstrict-aliasing
|
||||||
libc_crt_target_cflags := -mthumb-interwork
|
libc_crt_target_cflags += -mthumb-interwork
|
||||||
endif # arm
|
endif # arm
|
||||||
|
|
||||||
ifeq ($(TARGET_ARCH),mips)
|
ifeq ($(TARGET_ARCH),mips)
|
||||||
@ -616,16 +622,16 @@ ifeq ($(TARGET_ARCH),mips)
|
|||||||
libc_common_cflags += -DSOFTFLOAT
|
libc_common_cflags += -DSOFTFLOAT
|
||||||
endif
|
endif
|
||||||
libc_common_cflags += -fstrict-aliasing
|
libc_common_cflags += -fstrict-aliasing
|
||||||
libc_crt_target_cflags := $(TARGET_GLOBAL_CFLAGS)
|
libc_crt_target_cflags += $(TARGET_GLOBAL_CFLAGS)
|
||||||
endif # mips
|
endif # mips
|
||||||
|
|
||||||
ifeq ($(TARGET_ARCH),x86)
|
ifeq ($(TARGET_ARCH),x86)
|
||||||
libc_crt_target_cflags := -m32
|
libc_crt_target_cflags += -m32
|
||||||
libc_crt_target_ldflags := -melf_i386
|
libc_crt_target_ldflags := -melf_i386
|
||||||
endif # x86
|
endif # x86
|
||||||
|
|
||||||
ifeq ($(TARGET_ARCH),x86_64)
|
ifeq ($(TARGET_ARCH),x86_64)
|
||||||
libc_crt_target_cflags := -m64
|
libc_crt_target_cflags += -m64
|
||||||
libc_crt_target_ldflags := -melf_x86_64
|
libc_crt_target_ldflags := -melf_x86_64
|
||||||
endif # x86_64
|
endif # x86_64
|
||||||
|
|
||||||
@ -636,12 +642,6 @@ else
|
|||||||
libc_common_cflags += -DANDROID_SMP=0
|
libc_common_cflags += -DANDROID_SMP=0
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# crtbrand.c needs <stdint.h> and a #define for the platform SDK version.
|
|
||||||
libc_crt_target_cflags += \
|
|
||||||
-I$(LOCAL_PATH)/include \
|
|
||||||
-I$(LOCAL_PATH)/arch-$(TARGET_ARCH)/include \
|
|
||||||
-DPLATFORM_SDK_VERSION=$(PLATFORM_SDK_VERSION) \
|
|
||||||
|
|
||||||
# Define some common conlyflags
|
# Define some common conlyflags
|
||||||
libc_common_conlyflags := \
|
libc_common_conlyflags := \
|
||||||
-std=gnu99
|
-std=gnu99
|
||||||
@ -907,7 +907,7 @@ include $(BUILD_STATIC_LIBRARY)
|
|||||||
# ========================================================
|
# ========================================================
|
||||||
# libc_bionic.a - home-grown C library code
|
# libc_bionic.a - home-grown C library code
|
||||||
# ========================================================
|
# ========================================================
|
||||||
#
|
|
||||||
include $(CLEAR_VARS)
|
include $(CLEAR_VARS)
|
||||||
|
|
||||||
LOCAL_SRC_FILES := $(libc_bionic_src_files)
|
LOCAL_SRC_FILES := $(libc_bionic_src_files)
|
||||||
@ -1026,8 +1026,10 @@ LOCAL_SRC_FILES := \
|
|||||||
$(libc_static_common_src_files) \
|
$(libc_static_common_src_files) \
|
||||||
bionic/dlmalloc.c \
|
bionic/dlmalloc.c \
|
||||||
bionic/malloc_debug_common.cpp \
|
bionic/malloc_debug_common.cpp \
|
||||||
|
bionic/debug_mapinfo.cpp \
|
||||||
|
bionic/debug_stacktrace.cpp \
|
||||||
bionic/pthread_debug.cpp \
|
bionic/pthread_debug.cpp \
|
||||||
bionic/libc_init_dynamic.cpp
|
bionic/libc_init_dynamic.cpp \
|
||||||
|
|
||||||
ifeq ($(TARGET_ARCH),arm)
|
ifeq ($(TARGET_ARCH),arm)
|
||||||
LOCAL_NO_CRT := true
|
LOCAL_NO_CRT := true
|
||||||
@ -1103,8 +1105,6 @@ include $(BUILD_SHARED_LIBRARY)
|
|||||||
# ========================================================
|
# ========================================================
|
||||||
# libc_malloc_debug_qemu.so
|
# libc_malloc_debug_qemu.so
|
||||||
# ========================================================
|
# ========================================================
|
||||||
#TODO: We do not build this library for now
|
|
||||||
ifneq ($(TARGET_ARCH),aarch64)
|
|
||||||
include $(CLEAR_VARS)
|
include $(CLEAR_VARS)
|
||||||
|
|
||||||
LOCAL_CFLAGS := \
|
LOCAL_CFLAGS := \
|
||||||
@ -1130,7 +1130,6 @@ LOCAL_MODULE_TAGS := eng debug
|
|||||||
|
|
||||||
include $(BUILD_SHARED_LIBRARY)
|
include $(BUILD_SHARED_LIBRARY)
|
||||||
|
|
||||||
endif #!aarch64
|
|
||||||
endif #!user
|
endif #!user
|
||||||
|
|
||||||
|
|
||||||
|
@ -91,6 +91,8 @@ the lock, so we actually do most of our deadlock prediction work after
|
|||||||
the lock has been acquired.
|
the lock has been acquired.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#if PTHREAD_DEBUG_ENABLED
|
||||||
|
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
// log functions
|
// log functions
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
@ -658,23 +660,6 @@ static MutexInfo* get_most_recently_locked() {
|
|||||||
|
|
||||||
/****************************************************************************/
|
/****************************************************************************/
|
||||||
|
|
||||||
/* pthread_debug_init() is called from libc_init_dynamic() just
|
|
||||||
* after system properties have been initialized
|
|
||||||
*/
|
|
||||||
|
|
||||||
extern "C" __LIBC_HIDDEN__ void pthread_debug_init() {
|
|
||||||
char env[PROP_VALUE_MAX];
|
|
||||||
if (__system_property_get("debug.libc.pthread", env)) {
|
|
||||||
int level = atoi(env);
|
|
||||||
if (level) {
|
|
||||||
LOGI("pthread deadlock detection level %d enabled for pid %d (%s)",
|
|
||||||
level, getpid(), __progname);
|
|
||||||
hashmap_init(&sMutexMap);
|
|
||||||
sPthreadDebugLevel = level;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* See if we were allowed to grab the lock at this time. We do it
|
* See if we were allowed to grab the lock at this time. We do it
|
||||||
* *after* acquiring the lock, rather than before, so that we can
|
* *after* acquiring the lock, rather than before, so that we can
|
||||||
@ -712,3 +697,21 @@ extern "C" __LIBC_HIDDEN__ void pthread_debug_mutex_unlock_check(pthread_mutex_t
|
|||||||
remove_most_recently_locked(object);
|
remove_most_recently_locked(object);
|
||||||
mutex_unlock_checked(object);
|
mutex_unlock_checked(object);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif // PTHREAD_DEBUG_ENABLED
|
||||||
|
|
||||||
|
// Called from libc_init_dynamic() just after system properties have been initialized.
|
||||||
|
extern "C" __LIBC_HIDDEN__ void pthread_debug_init() {
|
||||||
|
#if PTHREAD_DEBUG_ENABLED
|
||||||
|
char env[PROP_VALUE_MAX];
|
||||||
|
if (__system_property_get("debug.libc.pthread", env)) {
|
||||||
|
int level = atoi(env);
|
||||||
|
if (level) {
|
||||||
|
LOGI("pthread deadlock detection level %d enabled for pid %d (%s)",
|
||||||
|
level, getpid(), __progname);
|
||||||
|
hashmap_init(&sMutexMap);
|
||||||
|
sPthreadDebugLevel = level;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user