linker: use LOCAL_MULTILIB := both style to build linker64

Use LOCAL_MODULE_STEM_32 and LOCAL_MODULE_STEM_64 to build
linker and linker64.  Set LOCAL_MULTILIB := both for consistency
with other rules of this type, although LOCAL_MULTILIB := both is
only consumed by executable.mk which is skipped by
linker_executable.mk.  Duplicate the necessary new parts of
executable.mk.

Change-Id: I888e87cf125cfbcfdee6a55b6377d8bc5ce402ea
This commit is contained in:
Colin Cross 2014-03-27 10:45:57 -07:00
parent bc475bc8d1
commit 406a75d371
2 changed files with 65 additions and 62 deletions

View file

@ -1,9 +1,70 @@
LOCAL_PATH:= $(call my-dir) LOCAL_PATH:= $(call my-dir)
linker_2nd_arch_var_prefix := LOCAL_PATH:= $(call my-dir)
include $(LOCAL_PATH)/linker.mk include $(CLEAR_VARS)
LOCAL_SRC_FILES:= \
debugger.cpp \
dlfcn.cpp \
linker.cpp \
linker_environ.cpp \
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
LOCAL_SRC_FILES_mips := arch/mips/begin.S
LOCAL_LDFLAGS := \
-shared \
-Wl,-Bsymbolic \
-Wl,--exclude-libs,ALL \
LOCAL_CFLAGS += \
-fno-stack-protector \
-Wstrict-overflow=5 \
-fvisibility=hidden \
-Wall -Wextra -Werror \
LOCAL_CONLYFLAGS += \
-std=gnu99 \
LOCAL_CPPFLAGS += \
-std=gnu++11 \
# 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)
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk $(LOCAL_PATH)/linker_executable.mk
LOCAL_STATIC_LIBRARIES := libc_nomalloc
LOCAL_FORCE_STATIC_EXECUTABLE := true # not necessary when not including BUILD_EXECUTABLE
LOCAL_2ND_ARCH_VAR_PREFIX := $(linker_2nd_arch_var_prefix)
LOCAL_MODULE := linker
LOCAL_MODULE_STEM_32 := linker
LOCAL_MODULE_STEM_64 := linker64
LOCAL_MULTILIB := both
include $(LOCAL_PATH)/linker_executable.mk
ifdef TARGET_2ND_ARCH ifdef TARGET_2ND_ARCH
linker_2nd_arch_var_prefix := $(TARGET_2ND_ARCH_VAR_PREFIX) LOCAL_2ND_ARCH_VAR_PREFIX := $(TARGET_2ND_ARCH_VAR_PREFIX)
include $(LOCAL_PATH)/linker.mk OVERRIDE_BUILT_MODULE_PATH :=
LOCAL_BUILT_MODULE :=
LOCAL_INSTALLED_MODULE :=
LOCAL_MODULE_STEM :=
LOCAL_BUILT_MODULE_STEM :=
LOCAL_INSTALLED_MODULE_STEM :=
LOCAL_INTERMEDIATE_TARGETS :=
include $(LOCAL_PATH)/linker_executable.mk
endif endif

View file

@ -1,58 +0,0 @@
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES:= \
debugger.cpp \
dlfcn.cpp \
linker.cpp \
linker_environ.cpp \
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
LOCAL_SRC_FILES_mips := arch/mips/begin.S
LOCAL_LDFLAGS := \
-shared \
-Wl,-Bsymbolic \
-Wl,--exclude-libs,ALL \
LOCAL_CFLAGS += \
-fno-stack-protector \
-Wstrict-overflow=5 \
-fvisibility=hidden \
-Wall -Wextra -Werror \
LOCAL_CONLYFLAGS += \
-std=gnu99 \
LOCAL_CPPFLAGS += \
-std=gnu++11 \
# 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)
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk $(LOCAL_PATH)/linker.mk $(LOCAL_PATH)/linker_executable.mk
LOCAL_STATIC_LIBRARIES := libc_nomalloc
LOCAL_FORCE_STATIC_EXECUTABLE := true # not necessary when not including BUILD_EXECUTABLE
LOCAL_2ND_ARCH_VAR_PREFIX := $(linker_2nd_arch_var_prefix)
ifeq ($(TARGET_IS_64_BIT)|$(linker_2nd_arch_var_prefix),true|)
LOCAL_MODULE := linker64
else
LOCAL_MODULE := linker
endif
include $(LOCAL_PATH)/linker_executable.mk