Commit c2b8806f authored by Douglas Raillard's avatar Douglas Raillard
Browse files

Introduce TF_LDFLAGS



Use TF_LDFLAGS from the Makefiles, and still append LDFLAGS as well to
the compiler's invocation. This allows passing extra options from the
make command line using LDFLAGS.

Document new LDFLAGS Makefile option.

Change-Id: I88c5ac26ca12ac2b2d60a6f150ae027639991f27
Signed-off-by: default avatarDouglas Raillard <douglas.raillard@arm.com>
parent 6bf36249
...@@ -151,10 +151,9 @@ TF_CFLAGS += $(CPPFLAGS) $(TF_CFLAGS_$(ARCH)) \ ...@@ -151,10 +151,9 @@ TF_CFLAGS += $(CPPFLAGS) $(TF_CFLAGS_$(ARCH)) \
-ffreestanding -fno-builtin -Wall -std=gnu99 \ -ffreestanding -fno-builtin -Wall -std=gnu99 \
-Os -ffunction-sections -fdata-sections -Os -ffunction-sections -fdata-sections
LDFLAGS += $(LDFLAGS_$(ARCH)) TF_LDFLAGS += --fatal-warnings -O1
LDFLAGS += --fatal-warnings -O1 TF_LDFLAGS += --gc-sections
LDFLAGS += --gc-sections TF_LDFLAGS += $(TF_LDFLAGS_$(ARCH))
################################################################################ ################################################################################
# Common sources and include directories # Common sources and include directories
......
...@@ -385,6 +385,9 @@ performed. ...@@ -385,6 +385,9 @@ performed.
AArch64 and facilitates the loading of `SP_MIN` and BL33 as AArch32 executable AArch64 and facilitates the loading of `SP_MIN` and BL33 as AArch32 executable
images. images.
* `LDFLAGS`: Extra user options appended to the linkers' command line in
addition to the one set by the build system.
* `LOAD_IMAGE_V2`: Boolean option to enable support for new version (v2) of * `LOAD_IMAGE_V2`: Boolean option to enable support for new version (v2) of
image loading, which provides more flexibility and scalability around what image loading, which provides more flexibility and scalability around what
images are loaded and executed during boot. Default is 0. images are loaded and executed during boot. Default is 0.
......
...@@ -145,10 +145,10 @@ $(eval $(call add_define,ERRATA_A57_833471)) ...@@ -145,10 +145,10 @@ $(eval $(call add_define,ERRATA_A57_833471))
# Errata build flags # Errata build flags
ifneq (${ERRATA_A53_843419},0) ifneq (${ERRATA_A53_843419},0)
LDFLAGS_aarch64 += --fix-cortex-a53-843419 TF_LDFLAGS_aarch64 += --fix-cortex-a53-843419
endif endif
ifneq (${ERRATA_A53_835769},0) ifneq (${ERRATA_A53_835769},0)
TF_CFLAGS_aarch64 += -mfix-cortex-a53-835769 TF_CFLAGS_aarch64 += -mfix-cortex-a53-835769
LDFLAGS_aarch64 += --fix-cortex-a53-835769 TF_LDFLAGS_aarch64 += --fix-cortex-a53-835769
endif endif
...@@ -313,8 +313,8 @@ else ...@@ -313,8 +313,8 @@ else
const char version_string[] = "${VERSION_STRING}";' | \ const char version_string[] = "${VERSION_STRING}";' | \
$$(CC) $$(TF_CFLAGS) $$(CFLAGS) -xc -c - -o $(BUILD_DIR)/build_message.o $$(CC) $$(TF_CFLAGS) $$(CFLAGS) -xc -c - -o $(BUILD_DIR)/build_message.o
endif endif
$$(Q)$$(LD) -o $$@ $$(LDFLAGS) -Map=$(MAPFILE) --script $(LINKERFILE) \ $$(Q)$$(LD) -o $$@ $$(TF_LDFLAGS) $$(LDFLAGS) -Map=$(MAPFILE) \
$(BUILD_DIR)/build_message.o $(OBJS) --script $(LINKERFILE) $(BUILD_DIR)/build_message.o $(OBJS)
$(DUMP): $(ELF) $(DUMP): $(ELF)
@echo " OD $$@" @echo " OD $$@"
......
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