summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPraneeth Bajjuri <praneeth@ti.com>2021-06-25 20:09:06 -0500
committerYogesh Siraswar <yogeshs@ti.com>2021-06-28 11:21:31 +0000
commitb394c5febaef698dfc8eea0608fe8c42b45243e6 (patch)
treebcd25bc12ea130d3bce8358d34806b2592e5cb39
parent7c4f40e09b3c229bd79460d49abb1934f2057c0e (diff)
downloadmeta-ti-b394c5febaef698dfc8eea0608fe8c42b45243e6.tar.gz
optee-os: upgrade to upstream 3.12.0
Upgrade optee-os to upstream 3.12.0 on dunfell branch. upstream optee 3.13.0 tag has the following patches. f50962e3 ta_dev_kit.mk: make sure that libutils is linked second time 73196b58 link.mk: implement support for libnames-after-libgcc variable 36e784f6 libutils: provide empty __getauxval() implementation Hence removing from here. Signed-off-by: Praneeth Bajjuri <praneeth@ti.com> Signed-off-by: Yogesh Siraswar <yogeshs@ti.com>
-rw-r--r--recipes-security/optee/optee-os/0001-libutils-provide-empty-__getauxval-implementation.patch62
-rw-r--r--recipes-security/optee/optee-os/0002-link.mk-implement-support-for-libnames-after-libgcc-.patch55
-rw-r--r--recipes-security/optee/optee-os/0003-ta_dev_kit.mk-make-sure-that-libutils-is-linked-seco.patch44
-rw-r--r--recipes-security/optee/optee-os_%.bbappend7
4 files changed, 2 insertions, 166 deletions
diff --git a/recipes-security/optee/optee-os/0001-libutils-provide-empty-__getauxval-implementation.patch b/recipes-security/optee/optee-os/0001-libutils-provide-empty-__getauxval-implementation.patch
deleted file mode 100644
index 0120f5c2..00000000
--- a/recipes-security/optee/optee-os/0001-libutils-provide-empty-__getauxval-implementation.patch
+++ /dev/null
@@ -1,62 +0,0 @@
1Upstream-Status: Backport
2Signed-off-by: Ross Burton <ross.burton@arm.com>
3
4From 36e784f621bf5d5be9183beba35f39426277c110 Mon Sep 17 00:00:00 2001
5From: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
6Date: Tue, 13 Oct 2020 22:45:39 +0300
7Subject: [PATCH 1/3] libutils: provide empty __getauxval() implementation
8
9Never version of libgcc are built with LSE implementation in mind. To
10determine if LSE is available on platform it calls __getauxval(), so in
11some cases we can get undefined reference to __getauxval() error.
12
13Prominent case is libgcc_eh.a library, which is used by C++ TAs. Exception
14handler depends on atomic operations, so it tries to call
15init_have_lse_atomics() first. This function in turn calls __getauxval(),
16which causes linking error.
17
18In the future we can make __getauxval() to return actual platform
19capabilities.
20
21Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
22Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
23Reviewed-by: Jerome Forissier <jerome@forissier.org>
24---
25 lib/libutils/ext/arch/arm/auxval.c | 12 ++++++++++++
26 lib/libutils/ext/arch/arm/sub.mk | 1 +
27 2 files changed, 13 insertions(+)
28 create mode 100644 lib/libutils/ext/arch/arm/auxval.c
29
30diff --git a/lib/libutils/ext/arch/arm/auxval.c b/lib/libutils/ext/arch/arm/auxval.c
31new file mode 100644
32index 00000000..98bca850
33--- /dev/null
34+++ b/lib/libutils/ext/arch/arm/auxval.c
35@@ -0,0 +1,12 @@
36+// SPDX-License-Identifier: BSD-2-Clause
37+/*
38+ * Copyright (c) 2020, EPAM Systems
39+ */
40+
41+#include <compiler.h>
42+
43+unsigned long int __getauxval (unsigned long int type);
44+unsigned long int __getauxval (unsigned long int type __unused)
45+{
46+ return 0;
47+}
48diff --git a/lib/libutils/ext/arch/arm/sub.mk b/lib/libutils/ext/arch/arm/sub.mk
49index dc5eed67..2e779066 100644
50--- a/lib/libutils/ext/arch/arm/sub.mk
51+++ b/lib/libutils/ext/arch/arm/sub.mk
52@@ -3,6 +3,7 @@ srcs-$(CFG_ARM32_$(sm)) += aeabi_unwind.c
53 endif
54 srcs-$(CFG_ARM32_$(sm)) += atomic_a32.S
55 srcs-$(CFG_ARM64_$(sm)) += atomic_a64.S
56+srcs-y += auxval.c
57 ifneq ($(sm),ldelf) # TA, core
58 srcs-$(CFG_ARM32_$(sm)) += mcount_a32.S
59 srcs-$(CFG_ARM64_$(sm)) += mcount_a64.S
60--
612.25.1
62
diff --git a/recipes-security/optee/optee-os/0002-link.mk-implement-support-for-libnames-after-libgcc-.patch b/recipes-security/optee/optee-os/0002-link.mk-implement-support-for-libnames-after-libgcc-.patch
deleted file mode 100644
index 11296c8c..00000000
--- a/recipes-security/optee/optee-os/0002-link.mk-implement-support-for-libnames-after-libgcc-.patch
+++ /dev/null
@@ -1,55 +0,0 @@
1Upstream-Status: Backport
2Signed-off-by: Ross Burton <ross.burton@arm.com>
3
4From 73196b58ea6978ffa5e581738030f51c5789ef73 Mon Sep 17 00:00:00 2001
5From: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
6Date: Tue, 13 Oct 2020 22:54:13 +0300
7Subject: [PATCH 2/3] link.mk: implement support for libnames-after-libgcc
8 variable
9
10Newer versions of libgcc depend on external __getauxval() symbol, which is
11now provided by libutils. But libgcc is linked after libutils, so linker
12can't resolve that symbol. We can't include libgcc into linking group with
13libtutils, because libgcc provides symbols that conflict with libutil's
14ones, like __aeabi_idiv with friends for instance.
15
16So, to resolve libgcc dependency on libutils we need to link with libutils
17second time. To make things more generic, we will introduce
18$(libnames-after-libgcc) variable for libraries that should be linked after
19libgcc.
20
21Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
22Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
23Reviewed-by: Jerome Forissier <jerome@forissier.org>
24---
25 ta/arch/arm/link.mk | 6 +++++-
26 1 file changed, 5 insertions(+), 1 deletion(-)
27
28diff --git a/ta/arch/arm/link.mk b/ta/arch/arm/link.mk
29index 445c285d..3025acb1 100644
30--- a/ta/arch/arm/link.mk
31+++ b/ta/arch/arm/link.mk
32@@ -55,8 +55,11 @@ link-ldflags += --eh-frame-hdr
33 link-ldadd += $(libstdc++$(sm)) $(libgcc_eh$(sm))
34 endif
35 link-ldadd += --end-group
36-ldargs-$(user-ta-uuid).elf := $(link-ldflags) $(objs) $(link-ldadd) $(libgcc$(sm))
37
38+link-ldadd-after-libgcc += $(addprefix -l,$(libnames-after-libgcc))
39+
40+ldargs-$(user-ta-uuid).elf := $(link-ldflags) $(objs) $(link-ldadd) \
41+ $(libgcc$(sm)) $(link-ldadd-after-libgcc)
42
43 link-script-cppflags-$(sm) := \
44 $(filter-out $(CPPFLAGS_REMOVE) $(cppflags-remove), \
45@@ -76,6 +79,7 @@ $(link-script-pp$(sm)): $(link-script$(sm)) $(conf-file) $(link-script-pp-makefi
46 $(link-script-cppflags-$(sm)) $$< -o $$@
47
48 $(link-out-dir$(sm))/$(user-ta-uuid).elf: $(objs) $(libdeps) \
49+ $(libdeps-after-libgcc) \
50 $(link-script-pp$(sm)) \
51 $(dynlistdep) \
52 $(additional-link-deps)
53--
542.25.1
55
diff --git a/recipes-security/optee/optee-os/0003-ta_dev_kit.mk-make-sure-that-libutils-is-linked-seco.patch b/recipes-security/optee/optee-os/0003-ta_dev_kit.mk-make-sure-that-libutils-is-linked-seco.patch
deleted file mode 100644
index 88ba5f85..00000000
--- a/recipes-security/optee/optee-os/0003-ta_dev_kit.mk-make-sure-that-libutils-is-linked-seco.patch
+++ /dev/null
@@ -1,44 +0,0 @@
1Upstream-Status: Backport
2Signed-off-by: Ross Burton <ross.burton@arm.com>
3
4From f50962e3f56f0932662b2ffa10afe53339a335dd Mon Sep 17 00:00:00 2001
5From: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
6Date: Fri, 16 Oct 2020 16:36:08 +0300
7Subject: [PATCH 3/3] ta_dev_kit.mk: make sure that libutils is linked second
8 time
9
10libgcc depends on __getauxval symbol from libuils. As, generally libutils
11is linked before libgcc, we will get "unresolved symbol" error. To resolve
12this dependency we need to link libutils second time - after libgcc.
13
14Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
15Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
16Reviewed-by: Jerome Forissier <jerome@forissier.org>
17---
18 ta/mk/ta_dev_kit.mk | 10 ++++++++++
19 1 file changed, 10 insertions(+)
20
21diff --git a/ta/mk/ta_dev_kit.mk b/ta/mk/ta_dev_kit.mk
22index e28be677..d0e66317 100644
23--- a/ta/mk/ta_dev_kit.mk
24+++ b/ta/mk/ta_dev_kit.mk
25@@ -78,6 +78,16 @@ endif
26 libnames += dl
27 libdeps += $(ta-dev-kit-dir$(sm))/lib/libdl.a
28
29+# libutils provides __getauxval symbol which is needed by libgcc 10.x. We can't
30+# link libutils after libgcc, because libgcc will replace some symbols provided
31+# by libutils, which will cause further linking issues.
32+#
33+# But if we place libutils before libgcc, linker will not be able to resolve
34+# __getauxval. So we need to link with libutils twice: before and after libgcc.
35+# Hence it included both in $(libnames) and in $(libnames-after-libgcc)
36+libnames-after-libgcc += utils
37+libdeps-after-libgcc += $(ta-dev-kit-dir$(sm))/lib/libutils.a
38+
39 # Pass config variable (CFG_) from conf.mk on the command line
40 cppflags$(sm) += $(strip \
41 $(foreach var, $(filter CFG_%,$(.VARIABLES)), \
42--
432.25.1
44
diff --git a/recipes-security/optee/optee-os_%.bbappend b/recipes-security/optee/optee-os_%.bbappend
index 8072490f..c90d85ea 100644
--- a/recipes-security/optee/optee-os_%.bbappend
+++ b/recipes-security/optee/optee-os_%.bbappend
@@ -1,16 +1,13 @@
1FILESEXTRAPATHS_prepend_ti-soc := "${THISDIR}/${PN}:" 1FILESEXTRAPATHS_prepend_ti-soc := "${THISDIR}/${PN}:"
2 2
3PV_ti-soc = "3.11.0+git${SRCPV}" 3PV_ti-soc = "3.12.0+git${SRCPV}"
4 4
5SRCREV_ti-soc = "c4def2a8262a03244d9a88461699b9b8e43c6b55" 5SRCREV_ti-soc = "3d47a131bca1d9ed511bfd516aa5e70269e12c1d"
6 6
7SRC_URI_ti-soc = " \ 7SRC_URI_ti-soc = " \
8 git://github.com/OP-TEE/optee_os.git \ 8 git://github.com/OP-TEE/optee_os.git \
9 file://0006-allow-setting-sysroot-for-libgcc-lookup.patch \ 9 file://0006-allow-setting-sysroot-for-libgcc-lookup.patch \
10 file://0007-allow-setting-sysroot-for-clang.patch \ 10 file://0007-allow-setting-sysroot-for-clang.patch \
11 file://0001-libutils-provide-empty-__getauxval-implementation.patch \
12 file://0002-link.mk-implement-support-for-libnames-after-libgcc-.patch \
13 file://0003-ta_dev_kit.mk-make-sure-that-libutils-is-linked-seco.patch \
14" 11"
15 12
16do_compile_prepend_ti-soc() { 13do_compile_prepend_ti-soc() {