Commit 2adee763 authored by Roberto Vargas's avatar Roberto Vargas
Browse files

Allow overriding the linker



This patch allows the user to override the value of the LD Makefile
variable. This feature can be used to force the use of the new Clang
linker.

Change-Id: I97ffeb18e48fa75346702a479d7dc1e8abcb3621
Signed-off-by: default avatarRoberto Vargas <roberto.vargas@arm.com>
parent ad925094
...@@ -119,7 +119,7 @@ CC := ${CROSS_COMPILE}gcc ...@@ -119,7 +119,7 @@ CC := ${CROSS_COMPILE}gcc
CPP := ${CROSS_COMPILE}cpp CPP := ${CROSS_COMPILE}cpp
AS := ${CROSS_COMPILE}gcc AS := ${CROSS_COMPILE}gcc
AR := ${CROSS_COMPILE}ar AR := ${CROSS_COMPILE}ar
LD := ${CROSS_COMPILE}ld LINKER := ${CROSS_COMPILE}ld
OC := ${CROSS_COMPILE}objcopy OC := ${CROSS_COMPILE}objcopy
OD := ${CROSS_COMPILE}objdump OD := ${CROSS_COMPILE}objdump
NM := ${CROSS_COMPILE}nm NM := ${CROSS_COMPILE}nm
...@@ -128,8 +128,8 @@ DTC := dtc ...@@ -128,8 +128,8 @@ DTC := dtc
# Use ${LD}.bfd instead if it exists (as absolute path or together with $PATH). # Use ${LD}.bfd instead if it exists (as absolute path or together with $PATH).
ifneq ($(strip $(wildcard ${LD}.bfd) \ ifneq ($(strip $(wildcard ${LD}.bfd) \
$(foreach dir,$(subst :, ,${PATH}),$(wildcard ${dir}/${LD}.bfd))),) $(foreach dir,$(subst :, ,${PATH}),$(wildcard ${dir}/${LINKER}.bfd))),)
LD := ${LD}.bfd LINKER := ${LINKER}.bfd
endif endif
ifeq (${ARM_ARCH_MAJOR},7) ifeq (${ARM_ARCH_MAJOR},7)
...@@ -143,12 +143,15 @@ endif ...@@ -143,12 +143,15 @@ endif
ifeq ($(notdir $(CC)),armclang) ifeq ($(notdir $(CC)),armclang)
TF_CFLAGS_aarch32 = -target arm-arm-none-eabi $(march32-directive) TF_CFLAGS_aarch32 = -target arm-arm-none-eabi $(march32-directive)
TF_CFLAGS_aarch64 = -target aarch64-arm-none-eabi -march=armv8-a TF_CFLAGS_aarch64 = -target aarch64-arm-none-eabi -march=armv8-a
LD = $(LINKER)
else ifneq ($(findstring clang,$(notdir $(CC))),) else ifneq ($(findstring clang,$(notdir $(CC))),)
TF_CFLAGS_aarch32 = $(target32-directive) TF_CFLAGS_aarch32 = $(target32-directive)
TF_CFLAGS_aarch64 = -target aarch64-elf TF_CFLAGS_aarch64 = -target aarch64-elf
LD = $(LINKER)
else else
TF_CFLAGS_aarch32 = $(march32-directive) TF_CFLAGS_aarch32 = $(march32-directive)
TF_CFLAGS_aarch64 = -march=armv8-a TF_CFLAGS_aarch64 = -march=armv8-a
LD = $(LINKER)
endif endif
TF_CFLAGS_aarch32 += -mno-unaligned-access TF_CFLAGS_aarch32 += -mno-unaligned-access
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment