Skip to content

Commit

Permalink
export dynamic symbols for leak test
Browse files Browse the repository at this point in the history
  • Loading branch information
Meiyou Chen committed Jun 2, 2021
1 parent 3aa298f commit d0659e6
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions Android.mk
Original file line number Diff line number Diff line change
@@ -1,37 +1,40 @@
LOCAL_PATH := $(call my-dir)

SNAP_C_FLAGS := -Wno-error
SNAP_CFLAGS := -Wno-error
SNAP_TEST_LDFLAGS := -Wl,--export-dynamic

include $(CLEAR_VARS)
LOCAL_MODULE := heapsnap
LOCAL_SRC_FILES := src/inject.c src/process_util.c src/ptrace_util.c
LOCAL_C_INCLUDES := $(LOCAL_PATH)/include/
LOCAL_SHARED_LIBRARIES := liblog libdl
LOCAL_CFLAGS := $(SNAP_C_FLAGS)
LOCAL_CFLAGS := $(SNAP_CFLAGS)
LOCAL_CFLAGS += -DPLATFORM_SDK_VERSION=$(PLATFORM_SDK_VERSION)
include $(BUILD_EXECUTABLE)

include $(CLEAR_VARS)
LOCAL_MODULE := leak_test
LOCAL_SRC_FILES := src/leak_test.c
LOCAL_C_INCLUDES := $(LOCAL_PATH)/include/
LOCAL_CFLAGS := $(SNAP_C_FLAGS)
LOCAL_CFLAGS := $(SNAP_CFLAGS)
LOCAL_LDFLAGS := $(SNAP_TEST_LDFLAGS)
include $(BUILD_EXECUTABLE)

include $(CLEAR_VARS)
LOCAL_MODULE := leak_builtin
LOCAL_SRC_FILES := src/leak_builtin.c
LOCAL_C_INCLUDES := $(LOCAL_PATH)/include/
LOCAL_SHARED_LIBRARIES := libheapsnap
LOCAL_CFLAGS := $(SNAP_C_FLAGS)
LOCAL_CFLAGS := $(SNAP_CFLAGS)
LOCAL_LDFLAGS := $(SNAP_TEST_LDFLAGS)
include $(BUILD_EXECUTABLE)

include $(CLEAR_VARS)
LOCAL_SRC_FILES := src/libheapsnap.cpp
LOCAL_C_INCLUDES := $(LOCAL_PATH)/include/
LOCAL_MODULE:= libheapsnap
LOCAL_SHARED_LIBRARIES := liblog libdl
LOCAL_CFLAGS := $(SNAP_C_FLAGS)
LOCAL_CFLAGS := $(SNAP_CFLAGS)
LOCAL_CFLAGS += -DPLATFORM_SDK_VERSION=$(PLATFORM_SDK_VERSION)

ifeq (1,$(strip $(shell expr $(PLATFORM_SDK_VERSION) \< 23)))
Expand Down Expand Up @@ -60,7 +63,7 @@ LOCAL_MODULE := heapsnap.32
LOCAL_SRC_FILES := src/inject.c src/process_util.c src/ptrace_util.c
LOCAL_C_INCLUDES := $(LOCAL_PATH)/include/
LOCAL_SHARED_LIBRARIES := liblog libdl
LOCAL_CFLAGS := $(SNAP_C_FLAGS)
LOCAL_CFLAGS := $(SNAP_CFLAGS)
LOCAL_CFLAGS += -DPLATFORM_SDK_VERSION=$(PLATFORM_SDK_VERSION)
include $(BUILD_EXECUTABLE)

Expand All @@ -69,7 +72,8 @@ LOCAL_MULTILIB := 32
LOCAL_MODULE := leak_test.32
LOCAL_SRC_FILES := src/leak_test.c
LOCAL_C_INCLUDES := $(LOCAL_PATH)/include/
LOCAL_CFLAGS := $(SNAP_C_FLAGS)
LOCAL_CFLAGS := $(SNAP_CFLAGS)
LOCAL_LDFLAGS := $(SNAP_TEST_LDFLAGS)
include $(BUILD_EXECUTABLE)

include $(CLEAR_VARS)
Expand All @@ -78,7 +82,8 @@ LOCAL_MODULE := leak_builtin.32
LOCAL_SRC_FILES := src/leak_builtin.c
LOCAL_C_INCLUDES := $(LOCAL_PATH)/include/
LOCAL_SHARED_LIBRARIES := libheapsnap
LOCAL_CFLAGS := $(SNAP_C_FLAGS)
LOCAL_CFLAGS := $(SNAP_CFLAGS)
LOCAL_LDFLAGS := $(SNAP_TEST_LDFLAGS)
include $(BUILD_EXECUTABLE)

endif

0 comments on commit d0659e6

Please sign in to comment.