summaryrefslogtreecommitdiffstats
path: root/recipes-security/optee-imx
diff options
context:
space:
mode:
authorAndrey Zhizhikin <andrey.z@gmail.com>2022-08-26 13:07:25 +0000
committerAndrey Zhizhikin <andrey.z@gmail.com>2022-08-26 13:19:41 +0000
commit42a054f5e3d18bdf0092dd29eff5980ba9af8db1 (patch)
tree58123abd7852fa8056cfe320fff977b0ae691d32 /recipes-security/optee-imx
parentd984fbeb31f473a86f6d5670e5aa31bdda82b7e7 (diff)
downloadmeta-freescale-42a054f5e3d18bdf0092dd29eff5980ba9af8db1.tar.gz
optee-os: fix build with binutils 2.39
binutils 2.39 started to produce warning on RWX LOAD segments, which breaks the linking process of optee-os. Upstream optee-os package has patch ac425901 ("arm/optee-os: backport RWX permission error patch") [1] integrated, which has been backported in OP-TEE from PR #5475 [2] targeting master in upstream. Port upstream optee-os commit into NXP fork of optee-os. Link: [1]: https://github.com/jonmason/meta-arm/commit/ac4259011f4c8cec01191828014487ccc5de73ca Link: [2]: https://github.com/OP-TEE/optee_os/pull/5474 Signed-off-by: Andrey Zhizhikin <andrey.z@gmail.com> Cc: Tom Hochstein <tom.hochstein@nxp.com>
Diffstat (limited to 'recipes-security/optee-imx')
-rw-r--r--recipes-security/optee-imx/optee-os/0008-no-warn-rwx-segments.patch64
-rw-r--r--recipes-security/optee-imx/optee-os_3.17.0.imx.bb4
2 files changed, 68 insertions, 0 deletions
diff --git a/recipes-security/optee-imx/optee-os/0008-no-warn-rwx-segments.patch b/recipes-security/optee-imx/optee-os/0008-no-warn-rwx-segments.patch
new file mode 100644
index 00000000..1dd70b31
--- /dev/null
+++ b/recipes-security/optee-imx/optee-os/0008-no-warn-rwx-segments.patch
@@ -0,0 +1,64 @@
1Signed-off-by: Anton Antonov <Anton.Antonov@arm.com>
2Upstream-Status: Backport [https://github.com/OP-TEE/optee_os/pull/5474]
3
4From 0b8a917fa51a366806edc0f04b88cd23b24098c4 Mon Sep 17 00:00:00 2001
5From: Jerome Forissier <jerome.forissier@linaro.org>
6Date: Fri, 5 Aug 2022 09:48:03 +0200
7Subject: [PATCH] core: link: add --no-warn-rwx-segments
8
9binutils ld.bfd generates one RWX LOAD segment by merging several sections
10with mixed R/W/X attributes (.text, .rodata, .data). After version 2.38 it
11also warns by default when that happens [1], which breaks the build due to
12--fatal-warnings. The RWX segment is not a problem for the TEE core, since
13that information is not used to set memory permissions. Therefore, silence
14the warning.
15
16Link: [1] https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=ba951afb99912da01a6e8434126b8fac7aa75107
17Link: https://sourceware.org/bugzilla/show_bug.cgi?id=29448
18Reported-by: Dominique Martinet <dominique.martinet@atmark-techno.com>
19Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
20Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
21---
22 core/arch/arm/kernel/link.mk | 8 ++++++--
23 1 file changed, 6 insertions(+), 2 deletions(-)
24
25diff --git a/core/arch/arm/kernel/link.mk b/core/arch/arm/kernel/link.mk
26index 7eed333a32..c39d43cbfc 100644
27--- a/core/arch/arm/kernel/link.mk
28+++ b/core/arch/arm/kernel/link.mk
29@@ -31,6 +31,7 @@ link-ldflags += -T $(link-script-pp) -Map=$(link-out-dir)/tee.map
30 link-ldflags += --sort-section=alignment
31 link-ldflags += --fatal-warnings
32 link-ldflags += --gc-sections
33+link-ldflags += $(call ld-option,--no-warn-rwx-segments)
34
35 link-ldadd = $(LDADD)
36 link-ldadd += $(ldflags-external)
37@@ -55,6 +56,7 @@ link-script-cppflags := \
38 $(cppflagscore))
39
40 ldargs-all_objs := -T $(link-script-dummy) --no-check-sections \
41+ $(call ld-option,--no-warn-rwx-segments) \
42 $(link-objs) $(link-ldadd) $(libgcccore)
43 cleanfiles += $(link-out-dir)/all_objs.o
44 $(link-out-dir)/all_objs.o: $(objs) $(libdeps) $(MAKEFILE_LIST)
45@@ -67,7 +69,8 @@ $(link-out-dir)/unpaged_entries.txt: $(link-out-dir)/all_objs.o
46 $(q)$(NMcore) $< | \
47 $(AWK) '/ ____keep_pager/ { printf "-u%s ", $$3 }' > $@
48
49-unpaged-ldargs = -T $(link-script-dummy) --no-check-sections --gc-sections
50+unpaged-ldargs := -T $(link-script-dummy) --no-check-sections --gc-sections \
51+ $(call ld-option,--no-warn-rwx-segments)
52 unpaged-ldadd := $(objs) $(link-ldadd) $(libgcccore)
53 cleanfiles += $(link-out-dir)/unpaged.o
54 $(link-out-dir)/unpaged.o: $(link-out-dir)/unpaged_entries.txt
55@@ -95,7 +98,8 @@ $(link-out-dir)/init_entries.txt: $(link-out-dir)/all_objs.o
56 $(q)$(NMcore) $< | \
57 $(AWK) '/ ____keep_init/ { printf "-u%s ", $$3 }' > $@
58
59-init-ldargs := -T $(link-script-dummy) --no-check-sections --gc-sections
60+init-ldargs := -T $(link-script-dummy) --no-check-sections --gc-sections \
61+ $(call ld-option,--no-warn-rwx-segments)
62 init-ldadd := $(link-objs-init) $(link-out-dir)/version.o $(link-ldadd) \
63 $(libgcccore)
64 cleanfiles += $(link-out-dir)/init.o
diff --git a/recipes-security/optee-imx/optee-os_3.17.0.imx.bb b/recipes-security/optee-imx/optee-os_3.17.0.imx.bb
index 6e34eb9a..93e0ff6e 100644
--- a/recipes-security/optee-imx/optee-os_3.17.0.imx.bb
+++ b/recipes-security/optee-imx/optee-os_3.17.0.imx.bb
@@ -12,6 +12,10 @@ SRC_URI = "git://source.codeaurora.org/external/imx/imx-optee-os.git;protocol=ht
12SRCBRANCH = "lf-5.15.32_2.0.0" 12SRCBRANCH = "lf-5.15.32_2.0.0"
13SRCREV = "984996422c25c99ebfc5194c1bb393028605bb0c" 13SRCREV = "984996422c25c99ebfc5194c1bb393028605bb0c"
14 14
15SRC_URI:append = " \
16 file://0008-no-warn-rwx-segments.patch \
17 "
18
15S = "${WORKDIR}/git" 19S = "${WORKDIR}/git"
16 20
17inherit deploy python3native autotools features_check 21inherit deploy python3native autotools features_check