diff options
author | Otavio Salvador <otavio@ossystems.com.br> | 2022-08-30 13:34:02 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-30 13:34:02 -0300 |
commit | 7ceaf47bebcbf061cb4b1339d8509a859a2790ce (patch) | |
tree | 085871ab77035718d3b9d14c6dedc3e931031c43 | |
parent | f6a57335f3ca920e7823c25c2dafe5c7ff154f15 (diff) | |
parent | ff4ee796e67ec3f8de3fa2bd591874dd9fe61999 (diff) | |
download | meta-freescale-7ceaf47bebcbf061cb4b1339d8509a859a2790ce.tar.gz |
Merge pull request #1189 from MaxKrummenacher/master
reworked: "imx-atf: fix build error with binutils 2.39"
-rw-r--r-- | recipes-bsp/imx-atf/imx-atf/rwx-segments.patch | 38 | ||||
-rw-r--r-- | recipes-bsp/imx-atf/imx-atf_2.6.bb | 12 |
2 files changed, 45 insertions, 5 deletions
diff --git a/recipes-bsp/imx-atf/imx-atf/rwx-segments.patch b/recipes-bsp/imx-atf/imx-atf/rwx-segments.patch new file mode 100644 index 00000000..a4518ec6 --- /dev/null +++ b/recipes-bsp/imx-atf/imx-atf/rwx-segments.patch | |||
@@ -0,0 +1,38 @@ | |||
1 | Binutils 2.39 now warns when a segment has RXW permissions[1]: | ||
2 | |||
3 | aarch64-none-elf-ld.bfd: warning: bl31.elf has a LOAD segment with RWX | ||
4 | permissions | ||
5 | |||
6 | However, TF-A passes --fatal-warnings to LD, so this is a build failure. | ||
7 | |||
8 | There is a ticket filed upstream[2], so until that is resolved just | ||
9 | remove --fatal-warnings. | ||
10 | |||
11 | [1] https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=ba951afb99912da01a6e8434126b8fac7aa75107 | ||
12 | [2] https://developer.trustedfirmware.org/T996 | ||
13 | |||
14 | Upstream-Status: Inappropriate | ||
15 | Signed-off-by: Ross Burton <ross.burton@arm.com> | ||
16 | |||
17 | diff --git a/Makefile b/Makefile | ||
18 | index 3941f8698..13bbac348 100644 | ||
19 | --- a/Makefile | ||
20 | +++ b/Makefile | ||
21 | @@ -418,7 +418,7 @@ TF_LDFLAGS += $(TF_LDFLAGS_$(ARCH)) | ||
22 | # LD = gcc (used when GCC LTO is enabled) | ||
23 | else ifneq ($(findstring gcc,$(notdir $(LD))),) | ||
24 | # Pass ld options with Wl or Xlinker switches | ||
25 | -TF_LDFLAGS += -Wl,--fatal-warnings -O1 | ||
26 | +TF_LDFLAGS += -O1 | ||
27 | TF_LDFLAGS += -Wl,--gc-sections | ||
28 | ifeq ($(ENABLE_LTO),1) | ||
29 | ifeq (${ARCH},aarch64) | ||
30 | @@ -435,7 +435,7 @@ TF_LDFLAGS += $(subst --,-Xlinker --,$(TF_LDFLAGS_$(ARCH))) | ||
31 | |||
32 | # LD = gcc-ld (ld) or llvm-ld (ld.lld) or other | ||
33 | else | ||
34 | -TF_LDFLAGS += --fatal-warnings -O1 | ||
35 | +TF_LDFLAGS += -O1 | ||
36 | TF_LDFLAGS += --gc-sections | ||
37 | # ld.lld doesn't recognize the errata flags, | ||
38 | # therefore don't add those in that case | ||
diff --git a/recipes-bsp/imx-atf/imx-atf_2.6.bb b/recipes-bsp/imx-atf/imx-atf_2.6.bb index 1df61cab..3f627150 100644 --- a/recipes-bsp/imx-atf/imx-atf_2.6.bb +++ b/recipes-bsp/imx-atf/imx-atf_2.6.bb | |||
@@ -7,8 +7,11 @@ LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/BSD-3-Clause;m | |||
7 | 7 | ||
8 | PV .= "+git${SRCPV}" | 8 | PV .= "+git${SRCPV}" |
9 | 9 | ||
10 | SRC_URI = "git://source.codeaurora.org/external/imx/imx-atf.git;protocol=https;branch=${SRCBRANCH} \ | 10 | SRC_URI = " \ |
11 | file://0001-Makefile-Suppress-array-bounds-error.patch" | 11 | git://source.codeaurora.org/external/imx/imx-atf.git;protocol=https;branch=${SRCBRANCH} \ |
12 | file://0001-Makefile-Suppress-array-bounds-error.patch \ | ||
13 | file://rwx-segments.patch \ | ||
14 | " | ||
12 | SRCBRANCH = "lf_v2.6" | 15 | SRCBRANCH = "lf_v2.6" |
13 | SRCREV = "c6a19b1a351308cc73443283f6aa56b2eff791b8" | 16 | SRCREV = "c6a19b1a351308cc73443283f6aa56b2eff791b8" |
14 | 17 | ||
@@ -29,9 +32,7 @@ EXTRA_OEMAKE += " \ | |||
29 | 32 | ||
30 | # Let the Makefile handle setting up the CFLAGS and LDFLAGS as it is a standalone application | 33 | # Let the Makefile handle setting up the CFLAGS and LDFLAGS as it is a standalone application |
31 | CFLAGS[unexport] = "1" | 34 | CFLAGS[unexport] = "1" |
32 | # Needed for binutils >= 2.39 to prevent build failure. | 35 | LDFLAGS[unexport] = "1" |
33 | # imx-atf links with ld, thus no '-Wl,' prefix | ||
34 | LDFLAGS = "--no-warn-rwx-segments" | ||
35 | AS[unexport] = "1" | 36 | AS[unexport] = "1" |
36 | LD[unexport] = "1" | 37 | LD[unexport] = "1" |
37 | 38 | ||
@@ -58,6 +59,7 @@ EXTRA_OEMAKE += 'IMX_BOOT_UART_BASE=${ATF_BOOT_UART_BASE}' | |||
58 | do_configure[noexec] = "1" | 59 | do_configure[noexec] = "1" |
59 | 60 | ||
60 | do_compile() { | 61 | do_compile() { |
62 | # Clear LDFLAGS to avoid the option -Wl recognize issue | ||
61 | oe_runmake bl31 | 63 | oe_runmake bl31 |
62 | if ${BUILD_OPTEE}; then | 64 | if ${BUILD_OPTEE}; then |
63 | oe_runmake clean BUILD_BASE=build-optee | 65 | oe_runmake clean BUILD_BASE=build-optee |