diff --git a/recipes-bsp/atf/atf-sunxi/Makefile-link-with-z-noexecstack-no-warn-rwx-segment.patch b/recipes-bsp/atf/atf-sunxi/Makefile-link-with-z-noexecstack-no-warn-rwx-segment.patch new file mode 100644 index 0000000..397279f --- /dev/null +++ b/recipes-bsp/atf/atf-sunxi/Makefile-link-with-z-noexecstack-no-warn-rwx-segment.patch @@ -0,0 +1,35 @@ +From 69d2c1ccb42942980064c12d3ea3904bac450feb Mon Sep 17 00:00:00 2001 +From: pbiel +Date: Thu, 23 Feb 2023 16:30:01 +0100 +Subject: [PATCH] Makefile: link with -z noexecstack --no-warn-rwx-segments + +--- + Makefile | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/Makefile b/Makefile +index 578083221..e70888cf2 100644 +--- a/Makefile ++++ b/Makefile +@@ -445,6 +445,8 @@ endif + + GCC_V_OUTPUT := $(shell $(CC) -v 2>&1) + ++TF_LDFLAGS += --no-warn-rwx-segment ++ + # LD = armlink + ifneq ($(findstring armlink,$(notdir $(LD))),) + TF_LDFLAGS += --diag_error=warning --lto_level=O1 +@@ -471,6 +473,9 @@ TF_LDFLAGS += $(subst --,-Xlinker --,$(TF_LDFLAGS_$(ARCH))) + + # LD = gcc-ld (ld) or llvm-ld (ld.lld) or other + else ++# With ld.bfd version 2.39 and newer new warnings are added. Skip those since we ++# are not loaded by a elf loader. ++TF_LDFLAGS += $(call ld_option, --no-warn-rwx-segments) + TF_LDFLAGS += -O1 + TF_LDFLAGS += --gc-sections + # ld.lld doesn't recognize the errata flags, +-- +2.34.1 + diff --git a/recipes-bsp/atf/atf-sunxi_git.bb b/recipes-bsp/atf/atf-sunxi_git.bb index 31ec0ac..bf48980 100644 --- a/recipes-bsp/atf/atf-sunxi_git.bb +++ b/recipes-bsp/atf/atf-sunxi_git.bb @@ -1,18 +1,27 @@ DESCRIPTION = "ARM Trusted Firmware Allwinner" LICENSE = "BSD-3-Clause" LIC_FILES_CHKSUM = "file://license.md;md5=829bdeb34c1d9044f393d5a16c068371" +LIC_FILES_CHKSUM:sun50i-h616 = "file://docs/license.rst;md5=b2c740efedc159745b9b31f88ff03dde" -SRC_URI = "git://github.com/apritzel/arm-trusted-firmware;nobranch=1;protocol=https" +SRC_URI = " \ + git://github.com/apritzel/arm-trusted-firmware;nobranch=1;protocol=https \ + file://0001-Use-same-type-as-in-declaration.patch \ +" SRCREV = "aa75c8da415158a94b82a430b2b40000778e851f" -SRC_URI:append = " file://0001-Use-same-type-as-in-declaration.patch" +SRC_URI:sun50i-h616 = " \ + git://github.com/ARM-software/arm-trusted-firmware;nobranch=1;protocol=https \ + file://Makefile-link-with-z-noexecstack-no-warn-rwx-segment.patch \ +" +SRCREV:sun50i-h616 = "ba12668a65f9b10bc18f3b49a71999ed5d32714a" S = "${WORKDIR}/git" B = "${WORKDIR}/build" -COMPATIBLE_MACHINE = "(sun50i)" +COMPATIBLE_MACHINE = "(sun50i|sun50i-h616)" PLATFORM:sun50i = "sun50iw1p1" +PLATFORM:sun50i-h616 = "sun50i_h616" LDFLAGS[unexport] = "1"