2014-04-01 20:41:36 +02:00
|
|
|
LOCAL_PATH := $(call my-dir)
|
2009-03-04 04:28:35 +01:00
|
|
|
|
2014-03-27 18:45:57 +01:00
|
|
|
include $(CLEAR_VARS)
|
|
|
|
|
|
|
|
LOCAL_SRC_FILES:= \
|
|
|
|
debugger.cpp \
|
|
|
|
dlfcn.cpp \
|
|
|
|
linker.cpp \
|
2014-05-06 01:49:04 +02:00
|
|
|
linker_allocator.cpp \
|
2014-03-27 18:45:57 +01:00
|
|
|
linker_environ.cpp \
|
2014-08-26 23:16:52 +02:00
|
|
|
linker_libc_support.c \
|
2014-03-27 18:45:57 +01:00
|
|
|
linker_phdr.cpp \
|
|
|
|
rt.cpp \
|
|
|
|
|
|
|
|
LOCAL_SRC_FILES_arm := arch/arm/begin.S
|
|
|
|
LOCAL_SRC_FILES_arm64 := arch/arm64/begin.S
|
|
|
|
LOCAL_SRC_FILES_x86 := arch/x86/begin.c
|
|
|
|
LOCAL_SRC_FILES_x86_64 := arch/x86_64/begin.S
|
2015-01-14 20:36:38 +01:00
|
|
|
LOCAL_SRC_FILES_mips := arch/mips/begin.S linker_mips.cpp
|
|
|
|
LOCAL_SRC_FILES_mips64 := arch/mips64/begin.S linker_mips.cpp
|
2014-03-27 18:45:57 +01:00
|
|
|
|
2015-01-22 23:05:15 +01:00
|
|
|
# -shared is used to overwrite the -Bstatic and -static
|
|
|
|
# flags triggered by LOCAL_FORCE_STATIC_EXECUTABLE.
|
|
|
|
# This dynamic linker is actually a shared object linked with static libraries.
|
2014-03-27 18:45:57 +01:00
|
|
|
LOCAL_LDFLAGS := \
|
|
|
|
-shared \
|
|
|
|
-Wl,-Bsymbolic \
|
|
|
|
-Wl,--exclude-libs,ALL \
|
|
|
|
|
|
|
|
LOCAL_CFLAGS += \
|
|
|
|
-fno-stack-protector \
|
|
|
|
-Wstrict-overflow=5 \
|
|
|
|
-fvisibility=hidden \
|
2014-06-04 00:22:34 +02:00
|
|
|
-Wall -Wextra -Wunused -Werror \
|
2014-03-27 18:45:57 +01:00
|
|
|
|
|
|
|
LOCAL_CONLYFLAGS += \
|
|
|
|
-std=gnu99 \
|
|
|
|
|
|
|
|
LOCAL_CPPFLAGS += \
|
|
|
|
-std=gnu++11 \
|
2015-01-23 01:04:25 +01:00
|
|
|
-Wold-style-cast \
|
2014-03-27 18:45:57 +01:00
|
|
|
|
2015-01-19 20:16:52 +01:00
|
|
|
ifeq ($(TARGET_IS_64_BIT),true)
|
|
|
|
LOCAL_CPPFLAGS += -DTARGET_IS_64_BIT
|
|
|
|
endif
|
|
|
|
|
2014-03-27 18:45:57 +01:00
|
|
|
# We need to access Bionic private headers in the linker.
|
|
|
|
LOCAL_CFLAGS += -I$(LOCAL_PATH)/../libc/
|
|
|
|
|
|
|
|
# we don't want crtbegin.o (because we have begin.o), so unset it
|
|
|
|
# just for this module
|
|
|
|
LOCAL_NO_CRT := true
|
|
|
|
# TODO: split out the asflags.
|
|
|
|
LOCAL_ASFLAGS := $(LOCAL_CFLAGS)
|
|
|
|
|
2014-09-06 00:42:12 +02:00
|
|
|
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
|
2014-03-27 18:45:57 +01:00
|
|
|
|
|
|
|
LOCAL_STATIC_LIBRARIES := libc_nomalloc
|
|
|
|
|
2014-09-06 00:42:12 +02:00
|
|
|
LOCAL_FORCE_STATIC_EXECUTABLE := true
|
2014-03-27 18:45:57 +01:00
|
|
|
|
|
|
|
LOCAL_MODULE := linker
|
|
|
|
LOCAL_MODULE_STEM_32 := linker
|
|
|
|
LOCAL_MODULE_STEM_64 := linker64
|
|
|
|
LOCAL_MULTILIB := both
|
2013-10-17 22:06:20 +02:00
|
|
|
|
2014-08-15 00:46:36 +02:00
|
|
|
# Leave the symbols in the shared library so that stack unwinders can produce
|
|
|
|
# meaningful name resolution.
|
|
|
|
LOCAL_STRIP_MODULE := keep_symbols
|
|
|
|
|
2014-09-06 00:42:12 +02:00
|
|
|
# Insert an extra objcopy step to add prefix to symbols.
|
|
|
|
# Note we are using "=" instead of ":=" to defer the evaluation,
|
|
|
|
# because LOCAL_2ND_ARCH_VAR_PREFIX or linked_module isn't set properly yet at this point.
|
|
|
|
LOCAL_POST_LINK_CMD = $(hide) $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_OBJCOPY) \
|
|
|
|
--prefix-symbols=__dl_ $(linked_module)
|
|
|
|
|
|
|
|
include $(BUILD_EXECUTABLE)
|
2014-05-06 01:49:04 +02:00
|
|
|
|
|
|
|
include $(call first-makefiles-under,$(LOCAL_PATH))
|