trusted-firmware-a: work around RWX permission error on segment
PATCH v2 1/1 trusted-firmware-a: work around RWX permission error on segment
Binutils 2.39 now warns when a segment has RXW permissions[1]:
aarch64-none-elf-ld.bfd: warning: bl31.elf has a LOAD segment with RWX permissions
However, TF-A passes --fatal-warnings to LD, so this is a build failure.
There is a ticket filed upstream[2], so until that is resolved we can disable this warning.
[1] https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=ba951afb99912da01a6e8434126b8fac7aa75107
[2] https://developer.trustedfirmware.org/T996
Adapted from the above patch[3] in meta-arm, but we cannot use that patch as we are on an older SRCREV and the Makefile has changed.
---
v2: Changed syntax on SRC_URI:append:k3 based on comments.
.../files/rwx-segments-ti.patch | 45 +++++++++++++++++++ .../trusted-firmware-a_%.bbappend | 3 ++ 2 files changed, 48 insertions(+) create mode 100644 meta-ti-bsp/recipes-bsp/trusted-firmware-a/files/rwx-segments-ti.patch
meta-ti-bsp/recipes-bsp/trusted-firmware-a/files/rwx-segments-ti.patch new file +45 -0
@@ -0,0 +1,45 @@ +Binutils 2.39 now warns when a segment has RXW permissions[1]: + +aarch64-none-elf-ld.bfd: warning: bl31.elf has a LOAD segment with RWX +permissions + +However, TF-A passes --fatal-warnings to LD, so this is a build failure. + +There is a ticket filed upstream[2], so until that is resolved just +remove --fatal-warnings. + +[1] https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=ba951afb99912da01a6e8434126b8fac7aa75107 +[2] https://developer.trustedfirmware.org/T996 + +Upstream-Status: Inappropriate +Signed-off-by: Ross Burton <[email protected]> + + +Adapted from the above patch in meta-arm, but we cannot use that patch as +we are on an older SRCREV and the Makefile has changed. + +Signed-off-by: Ryan Eatmon <[email protected]> + + +diff --git a/Makefile b/Makefile +index 3941f8698..13bbac348 100644 +--- a/Makefile ++++ b/Makefile +@@ -421,7 +421,7 @@ TF_LDFLAGS += $(TF_LDFLAGS_$(ARCH)) + # LD = gcc (used when GCC LTO is enabled) + else ifneq ($(findstring gcc,$(notdir $(LD))),) + # Pass ld options with Wl or Xlinker switches +-TF_LDFLAGS += -Wl,--fatal-warnings -O1 ++TF_LDFLAGS += -O1 + TF_LDFLAGS += -Wl,--gc-sections + ifeq ($(ENABLE_LTO),1) + ifeq (${ARCH},aarch64) +@@ -439,7 +439,7 @@ TF_LDFLAGS += $(subst --,-Xlinker --,$(TF_LDFLAGS_$(ARCH))) + + # LD = gcc-ld (ld) or llvm-ld (ld.lld) or other + else +-TF_LDFLAGS += --fatal-warnings -O1 ++TF_LDFLAGS += -O1 + TF_LDFLAGS += --gc-sections + # ld.lld doesn't recognize the errata flags, + # therefore don't add those in that case
meta-ti-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a_%.bbappend +3 -0
@@ -6,6 +6,9 @@ TFA_BUILD_TARGET:k3 = "all" TFA_INSTALL_TARGET:k3 = "bl31" TFA_SPD:k3 = "opteed" +SRC_URI:append:k3 = "file://rwx-segments-ti.patch" +FILESEXTRAPATHS:prepend := "${THISDIR}/files:" + EXTRA_OEMAKE:append:k3 = "${@ ' K3_USART=' + d.getVar('TFA_K3_USART') if d.getVar('TFA_K3_USART') else ''}" EXTRA_OEMAKE:append:k3 = "${@ ' K3_PM_SYSTEM_SUSPEND=' + d.getVar('TFA_K3_SYSTEM_SUSPEND') if d.getVar('TFA_K3_SYSTEM_SUSPEND') else ''}"
Signature · 1 line
2.17.1
Quoted 86 lines · Ryan Eatmon via lists.yoctoproject.org
Binutils 2.39 now warns when a segment has RXW permissions[1]:
aarch64-none-elf-ld.bfd: warning: bl31.elf has a LOAD segment with RWX permissions
However, TF-A passes --fatal-warnings to LD, so this is a build failure.
There is a ticket filed upstream[2], so until that is resolved we can disable this warning.
[1] https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=ba951afb99912da01a6e8434126b8fac7aa75107
[2] https://developer.trustedfirmware.org/T996Signed-off-by Ross Burton <[email protected]>Signed-off-by Jon Mason <[email protected]>Adapted from the above patch[3] in meta-arm, but we cannot use that patch as we are on an older SRCREV and the
Makefilehas changed.Signed-off-by Ryan Eatmon <[email protected]>---
v2: Changed syntax on SRC_URI:append:k3 based on comments..../files/rwx-segments-ti.patch | 45 +++++++++++++++++++ .../trusted-firmware-a_%.bbappend | 3 ++ 2 files changed, 48 insertions(+) create mode 100644 meta-ti-bsp/recipes-bsp/trusted-firmware-a/files/rwx-segments-ti.patchmeta-ti-bsp/recipes-bsp/trusted-firmware-a/files/rwx-segments-ti.patch new file +45
-0@@ -0,0 +1,45 @@ +Binutils 2.39 now warns when a segment has RXW permissions[1]: + +aarch64-none-elf-ld.bfd: warning: bl31.elf has a LOAD segment with RWX +permissions + +However, TF-A passes --fatal-warnings to LD, so this is a build failure. + +There is a ticket filed upstream[2], so until that is resolved just +remove --fatal-warnings. + +[1] https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=ba951afb99912da01a6e8434126b8fac7aa75107 +[2] https://developer.trustedfirmware.org/T996 + +Upstream-Status: Inappropriate +Signed-off-by: Ross Burton <[email protected]> + + +Adapted from the above patch in meta-arm, but we cannot use that patch as +we are on an older SRCREV and the Makefile has changed. + +Signed-off-by: Ryan Eatmon <[email protected]> + + +diff --git a/Makefile b/Makefile +index 3941f8698..13bbac348 100644 +--- a/Makefile ++++ b/Makefile +@@ -421,7 +421,7 @@ TF_LDFLAGS += $(TF_LDFLAGS_$(ARCH)) + # LD = gcc (used when GCC LTO is enabled) + else ifneq ($(findstring gcc,$(notdir $(LD))),) + # Pass ld options with Wl or Xlinker switches +-TF_LDFLAGS += -Wl,--fatal-warnings -O1 ++TF_LDFLAGS += -O1 + TF_LDFLAGS += -Wl,--gc-sections + ifeq ($(ENABLE_LTO),1) + ifeq (${ARCH},aarch64) +@@ -439,7 +439,7 @@ TF_LDFLAGS += $(subst --,-Xlinker --,$(TF_LDFLAGS_$(ARCH))) + + # LD = gcc-ld (ld) or llvm-ld (ld.lld) or other + else +-TF_LDFLAGS += --fatal-warnings -O1 ++TF_LDFLAGS += -O1 + TF_LDFLAGS += --gc-sections + # ld.lld doesn't recognize the errata flags, + # therefore don't add those in that casemeta-ti-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a_%.bbappend +0
-0
meta-ti-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a_%.bbappend TFA_BUILD_TARGET:k3 = "all" · line 9
Quoted 4 lines
meta-ti-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a_%.bbappend +1
-0@@ -6,6 +6,9 @@ TFA_BUILD_TARGET:k3 = "all" TFA_INSTALL_TARGET:k3 = "bl31" TFA_SPD:k3 = "opteed" +SRC_URI:append:k3 = "file://rwx-segments-ti.patch"
Missing a leading space.
Check the Note here:
https://docs.yoctoproject.org/bitbake/bitbake-user-manual/bitbake-user-manual-metadata.html#appending-and-prepending-override-style-syntax
Quoted 4 lines
meta-ti-bsp/recipes-bsp/trusted-firmware-a/trusted-firmware-a_%.bbappend +2
-0+FILESEXTRAPATHS:prepend := "${THISDIR}/files:" + EXTRA_OEMAKE:append:k3 = "${@ ' K3_USART=' + d.getVar('TFA_K3_USART') if d.getVar('TFA_K3_USART') else ''}" EXTRA_OEMAKE:append:k3 = "${@ ' K3_PM_SYSTEM_SUSPEND=' + d.getVar('TFA_K3_SYSTEM_SUSPEND') if d.getVar('TFA_K3_SYSTEM_SUSPEND') else ''}"