Android.mk revision ae5c64413bf72bc18d7fc81e1f5761824bc01f49
1LOCAL_PATH:= $(call my-dir) 2include $(CLEAR_VARS) 3 4LOCAL_SRC_FILES:= \ 5 arch/$(TARGET_ARCH)/begin.S \ 6 debugger.c \ 7 dlfcn.c \ 8 linker.cpp \ 9 linker_environ.c \ 10 linker_format.c \ 11 linker_phdr.c \ 12 rt.c 13 14LOCAL_LDFLAGS := -shared 15 16LOCAL_CFLAGS += -fno-stack-protector \ 17 -Wstrict-overflow=5 \ 18 -fvisibility=hidden \ 19 -std=gnu99 \ 20 -Wall -Wextra 21 22# Set LINKER_DEBUG to either 1 or 0 23# 24LOCAL_CFLAGS += -DLINKER_DEBUG=0 25 26# We need to access Bionic private headers in the linker... 27LOCAL_CFLAGS += -I$(LOCAL_PATH)/../libc/ 28 29# ...one of which is <private/bionic_tls.h>, for which we 30# need HAVE_ARM_TLS_REGISTER. 31ifeq ($(TARGET_ARCH)-$(ARCH_ARM_HAVE_TLS_REGISTER),arm-true) 32 LOCAL_CFLAGS += -DHAVE_ARM_TLS_REGISTER 33endif 34 35ifeq ($(TARGET_ARCH),arm) 36 LOCAL_CFLAGS += -DANDROID_ARM_LINKER 37endif 38 39ifeq ($(TARGET_ARCH),x86) 40 LOCAL_CFLAGS += -DANDROID_X86_LINKER 41endif 42 43ifeq ($(TARGET_ARCH),mips) 44 LOCAL_CFLAGS += -DANDROID_MIPS_LINKER 45endif 46 47LOCAL_MODULE:= linker 48LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk 49 50LOCAL_STATIC_LIBRARIES := libc_nomalloc 51 52#LOCAL_FORCE_STATIC_EXECUTABLE := true # not necessary when not including BUILD_EXECUTABLE 53 54# 55# include $(BUILD_EXECUTABLE) 56# 57# Instead of including $(BUILD_EXECUTABLE), we execute the steps to create an executable by 58# hand, as we want to insert an extra step that is not supported by the build system, and 59# is probably specific the linker only, so there's no need to modify the build system for 60# the purpose. 61 62LOCAL_MODULE_CLASS := EXECUTABLES 63LOCAL_MODULE_SUFFIX := $(TARGET_EXECUTABLE_SUFFIX) 64 65# we don't want crtbegin.o (because we have begin.o), so unset it 66# just for this module 67LOCAL_NO_CRT := true 68 69include $(BUILD_SYSTEM)/dynamic_binary.mk 70 71$(linked_module): $(TARGET_CRTBEGIN_STATIC_O) $(all_objects) $(all_libraries) $(TARGET_CRTEND_O) 72 $(transform-o-to-static-executable) 73 @echo "target PrefixSymbols: $(PRIVATE_MODULE) ($@)" 74 $(hide) $(TARGET_OBJCOPY) --prefix-symbols=__dl_ $@ 75 76# 77# end of BUILD_EXECUTABLE hack 78# 79