1LOCAL_PATH:= $(call my-dir) 2 3# 4# libdl 5# 6 7include $(CLEAR_VARS) 8 9# NOTE: --exclude-libs=libgcc.a makes sure that any symbols libdl.so pulls from 10# libgcc.a are made static to libdl.so. This in turn ensures that libraries that 11# a) pull symbols from libgcc.a and b) depend on libdl.so will not rely on libdl.so 12# to provide those symbols, but will instead pull them from libgcc.a. Specifically, 13# we use this property to make sure libc.so has its own copy of the code from 14# libgcc.a it uses. 15# 16# DO NOT REMOVE --exclude-libs! 17 18LOCAL_LDFLAGS := -Wl,--exclude-libs=libgcc.a 19 20# for x86, exclude libgcc_eh.a for the same reasons as above 21LOCAL_LDFLAGS_x86 := -Wl,--exclude-libs=libgcc_eh.a 22LOCAL_LDFLAGS_x86_64 := $(LOCAL_LDFLAGS_x86) 23 24LOCAL_LDFLAGS_arm += -Wl,--version-script=$(LOCAL_PATH)/libdl.arm.map 25LOCAL_LDFLAGS_arm64 += -Wl,--version-script=$(LOCAL_PATH)/libdl.arm64.map 26LOCAL_LDFLAGS_mips += -Wl,--version-script=$(LOCAL_PATH)/libdl.mips.map 27LOCAL_LDFLAGS_mips64 += -Wl,--version-script=$(LOCAL_PATH)/libdl.mips64.map 28LOCAL_LDFLAGS_x86 += -Wl,--version-script=$(LOCAL_PATH)/libdl.x86.map 29LOCAL_LDFLAGS_x86_64 += -Wl,--version-script=$(LOCAL_PATH)/libdl.x86_64.map 30 31LOCAL_SRC_FILES:= libdl.c 32LOCAL_CFLAGS := -Wall -Wextra -Wunused -Werror 33LOCAL_CXX_STL := none 34 35LOCAL_MODULE := libdl 36LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk \ 37 $(LOCAL_PATH)/libdl.arm.map \ 38 $(LOCAL_PATH)/libdl.arm64.map \ 39 $(LOCAL_PATH)/libdl.mips.map \ 40 $(LOCAL_PATH)/libdl.mips64.map \ 41 $(LOCAL_PATH)/libdl.x86.map \ 42 $(LOCAL_PATH)/libdl.x86_64.map \ 43 44# NOTE: libdl needs __aeabi_unwind_cpp_pr0 from libgcc.a but libgcc.a needs a 45# few symbols from libc. Using --no-undefined here results in having to link 46# against libc creating a circular dependency which is removed and we end up 47# with missing symbols. Since this library is just a bunch of stubs, we set 48# LOCAL_ALLOW_UNDEFINED_SYMBOLS to remove --no-undefined from the linker flags. 49LOCAL_ALLOW_UNDEFINED_SYMBOLS := true 50LOCAL_SYSTEM_SHARED_LIBRARIES := 51 52LOCAL_SANITIZE := never 53include $(BUILD_SHARED_LIBRARY) 54 55# A dummy libdl.a. Need for static executables using the LLVM unwinder. Most 56# functions default to failure, others use a sensible default (dl_iterate_phdr() 57# returns 0, as would happen if the user iterated over every phdr). 58include $(CLEAR_VARS) 59LOCAL_SRC_FILES:= libdl.c 60LOCAL_CFLAGS := -Wall -Wextra -Wunused -Werror 61LOCAL_CXX_STL := none 62 63LOCAL_MODULE := libdl 64LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk 65LOCAL_SANITIZE := never 66include $(BUILD_STATIC_LIBRARY) 67