mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-18 02:24:18 +00:00
build: add --no-warn-rwx-segments
when linking with GCC
This flag is currently not included when linking with BFD via GCC. Without it, builds can fail when linking via GCC. Change-Id: Id37e05f6fb4eea4620861eb1bc8668c41f21ba20 Signed-off-by: Chris Kay <chris.kay@arm.com>
This commit is contained in:
parent
7fc4d77808
commit
86e489c190
2 changed files with 2 additions and 3 deletions
1
Makefile
1
Makefile
|
@ -354,6 +354,7 @@ ifneq ($(findstring armlink,$(notdir $(LD))),)
|
||||||
# LD = gcc (used when GCC LTO is enabled)
|
# LD = gcc (used when GCC LTO is enabled)
|
||||||
else ifneq ($(findstring gcc,$(notdir $(LD))),)
|
else ifneq ($(findstring gcc,$(notdir $(LD))),)
|
||||||
# Pass ld options with Wl or Xlinker switches
|
# Pass ld options with Wl or Xlinker switches
|
||||||
|
TF_LDFLAGS += $(call ld_option,-Xlinker --no-warn-rwx-segments)
|
||||||
TF_LDFLAGS += -Wl,--fatal-warnings -O1
|
TF_LDFLAGS += -Wl,--fatal-warnings -O1
|
||||||
TF_LDFLAGS += -Wl,--gc-sections
|
TF_LDFLAGS += -Wl,--gc-sections
|
||||||
|
|
||||||
|
|
|
@ -101,9 +101,7 @@ endef
|
||||||
|
|
||||||
# Convenience function to check for a given linker option. An call to
|
# Convenience function to check for a given linker option. An call to
|
||||||
# $(call ld_option, --no-XYZ) will return --no-XYZ if supported by the linker
|
# $(call ld_option, --no-XYZ) will return --no-XYZ if supported by the linker
|
||||||
define ld_option
|
ld_option = $(shell $(LD) $(1) -Wl,--version >/dev/null 2>&1 || $(LD) $(1) -v >/dev/null 2>&1 && echo $(1))
|
||||||
$(shell if $(LD) $(1) -v >/dev/null 2>&1; then echo $(1); fi )
|
|
||||||
endef
|
|
||||||
|
|
||||||
# Convenience function to check for a given compiler option. A call to
|
# Convenience function to check for a given compiler option. A call to
|
||||||
# $(call cc_option, --no-XYZ) will return --no-XYZ if supported by the compiler
|
# $(call cc_option, --no-XYZ) will return --no-XYZ if supported by the compiler
|
||||||
|
|
Loading…
Add table
Reference in a new issue