Colin Cross | 36ee4ab | 2014-02-12 21:58:47 -0800 | [diff] [blame] | 1 | LOCAL_PATH:= $(call my-dir) |
| 2 | include $(CLEAR_VARS) |
| 3 | |
| 4 | LOCAL_SRC_FILES:= \ |
| 5 | debugger.cpp \ |
| 6 | dlfcn.cpp \ |
| 7 | linker.cpp \ |
| 8 | linker_environ.cpp \ |
| 9 | linker_phdr.cpp \ |
| 10 | rt.cpp \ |
| 11 | |
| 12 | LOCAL_SRC_FILES_arm := arch/arm/begin.S |
| 13 | LOCAL_SRC_FILES_arm64 := arch/arm64/begin.S |
| 14 | LOCAL_SRC_FILES_x86 := arch/x86/begin.c |
| 15 | LOCAL_SRC_FILES_x86_64 := arch/x86_64/begin.S |
| 16 | LOCAL_SRC_FILES_mips := arch/mips/begin.S |
| 17 | |
| 18 | LOCAL_LDFLAGS := \ |
| 19 | -shared \ |
| 20 | -Wl,-Bsymbolic \ |
| 21 | -Wl,--exclude-libs,ALL \ |
| 22 | |
| 23 | LOCAL_CFLAGS += \ |
| 24 | -fno-stack-protector \ |
| 25 | -Wstrict-overflow=5 \ |
| 26 | -fvisibility=hidden \ |
| 27 | -Wall -Wextra -Werror \ |
| 28 | |
| 29 | LOCAL_CONLYFLAGS += \ |
| 30 | -std=gnu99 \ |
| 31 | |
| 32 | LOCAL_CPPFLAGS += \ |
| 33 | -std=gnu++11 \ |
| 34 | |
| 35 | # We need to access Bionic private headers in the linker. |
| 36 | LOCAL_CFLAGS += -I$(LOCAL_PATH)/../libc/ |
| 37 | |
| 38 | # we don't want crtbegin.o (because we have begin.o), so unset it |
| 39 | # just for this module |
| 40 | LOCAL_NO_CRT := true |
| 41 | # TODO: split out the asflags. |
| 42 | LOCAL_ASFLAGS := $(LOCAL_CFLAGS) |
| 43 | |
| 44 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk $(LOCAL_PATH)/linker.mk $(LOCAL_PATH)/linker_executable.mk |
| 45 | |
| 46 | LOCAL_STATIC_LIBRARIES := libc_nomalloc |
| 47 | |
| 48 | LOCAL_FORCE_STATIC_EXECUTABLE := true # not necessary when not including BUILD_EXECUTABLE |
| 49 | |
| 50 | LOCAL_2ND_ARCH_VAR_PREFIX := $(linker_2nd_arch_var_prefix) |
| 51 | |
| 52 | ifeq ($(TARGET_IS_64_BIT)|$(linker_2nd_arch_var_prefix),true|) |
| 53 | LOCAL_MODULE := linker64 |
| 54 | else |
| 55 | LOCAL_MODULE := linker |
| 56 | endif |
| 57 | |
| 58 | include $(LOCAL_PATH)/linker_executable.mk |