1 LOCAL_PATH := $(call my-dir) 2 3 include $(CLEAR_VARS) 4 5 LOCAL_SRC_FILES:= \ 6 debugger.cpp \ 7 dlfcn.cpp \ 8 linker.cpp \ 9 linker_allocator.cpp \ 10 linker_environ.cpp \ 11 linker_libc_support.c \ 12 linker_phdr.cpp \ 13 rt.cpp \ 14 15 LOCAL_SRC_FILES_arm := arch/arm/begin.S 16 LOCAL_SRC_FILES_arm64 := arch/arm64/begin.S 17 LOCAL_SRC_FILES_x86 := arch/x86/begin.c 18 LOCAL_SRC_FILES_x86_64 := arch/x86_64/begin.S 19 LOCAL_SRC_FILES_mips := arch/mips/begin.S 20 LOCAL_SRC_FILES_mips64 := arch/mips64/begin.S 21 22 LOCAL_LDFLAGS := \ 23 -shared \ 24 -Wl,-Bsymbolic \ 25 -Wl,--exclude-libs,ALL \ 26 27 LOCAL_CFLAGS += \ 28 -fno-stack-protector \ 29 -Wstrict-overflow=5 \ 30 -fvisibility=hidden \ 31 -Wall -Wextra -Wunused -Werror \ 32 33 LOCAL_CONLYFLAGS += \ 34 -std=gnu99 \ 35 36 LOCAL_CPPFLAGS += \ 37 -std=gnu++11 \ 38 39 # We need to access Bionic private headers in the linker. 40 LOCAL_CFLAGS += -I$(LOCAL_PATH)/../libc/ 41 42 # we don't want crtbegin.o (because we have begin.o), so unset it 43 # just for this module 44 LOCAL_NO_CRT := true 45 # TODO: split out the asflags. 46 LOCAL_ASFLAGS := $(LOCAL_CFLAGS) 47 48 LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk $(LOCAL_PATH)/linker_executable.mk 49 50 LOCAL_STATIC_LIBRARIES := libc_nomalloc 51 52 LOCAL_FORCE_STATIC_EXECUTABLE := true # not necessary when not including BUILD_EXECUTABLE 53 54 LOCAL_2ND_ARCH_VAR_PREFIX := $(linker_2nd_arch_var_prefix) 55 56 LOCAL_MODULE := linker 57 LOCAL_MODULE_STEM_32 := linker 58 LOCAL_MODULE_STEM_64 := linker64 59 LOCAL_MULTILIB := both 60 61 # Leave the symbols in the shared library so that stack unwinders can produce 62 # meaningful name resolution. 63 LOCAL_STRIP_MODULE := keep_symbols 64 65 include $(LOCAL_PATH)/linker_executable.mk 66 ifdef TARGET_2ND_ARCH 67 LOCAL_2ND_ARCH_VAR_PREFIX := $(TARGET_2ND_ARCH_VAR_PREFIX) 68 OVERRIDE_BUILT_MODULE_PATH := 69 LOCAL_BUILT_MODULE := 70 LOCAL_INSTALLED_MODULE := 71 LOCAL_MODULE_STEM := 72 LOCAL_BUILT_MODULE_STEM := 73 LOCAL_INSTALLED_MODULE_STEM := 74 LOCAL_INTERMEDIATE_TARGETS := 75 include $(LOCAL_PATH)/linker_executable.mk 76 endif 77 78 include $(call first-makefiles-under,$(LOCAL_PATH)) 79