diff options
author | Praneeth Bajjuri <praneeth@ti.com> | 2021-06-25 20:09:06 -0500 |
---|---|---|
committer | Yogesh Siraswar <yogeshs@ti.com> | 2021-06-28 11:21:31 +0000 |
commit | b394c5febaef698dfc8eea0608fe8c42b45243e6 (patch) | |
tree | bcd25bc12ea130d3bce8358d34806b2592e5cb39 | |
parent | 7c4f40e09b3c229bd79460d49abb1934f2057c0e (diff) | |
download | meta-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>
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 @@ | |||
1 | Upstream-Status: Backport | ||
2 | Signed-off-by: Ross Burton <ross.burton@arm.com> | ||
3 | |||
4 | From 36e784f621bf5d5be9183beba35f39426277c110 Mon Sep 17 00:00:00 2001 | ||
5 | From: Volodymyr Babchuk <volodymyr_babchuk@epam.com> | ||
6 | Date: Tue, 13 Oct 2020 22:45:39 +0300 | ||
7 | Subject: [PATCH 1/3] libutils: provide empty __getauxval() implementation | ||
8 | |||
9 | Never version of libgcc are built with LSE implementation in mind. To | ||
10 | determine if LSE is available on platform it calls __getauxval(), so in | ||
11 | some cases we can get undefined reference to __getauxval() error. | ||
12 | |||
13 | Prominent case is libgcc_eh.a library, which is used by C++ TAs. Exception | ||
14 | handler depends on atomic operations, so it tries to call | ||
15 | init_have_lse_atomics() first. This function in turn calls __getauxval(), | ||
16 | which causes linking error. | ||
17 | |||
18 | In the future we can make __getauxval() to return actual platform | ||
19 | capabilities. | ||
20 | |||
21 | Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com> | ||
22 | Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> | ||
23 | Reviewed-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 | |||
30 | diff --git a/lib/libutils/ext/arch/arm/auxval.c b/lib/libutils/ext/arch/arm/auxval.c | ||
31 | new file mode 100644 | ||
32 | index 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 | +} | ||
48 | diff --git a/lib/libutils/ext/arch/arm/sub.mk b/lib/libutils/ext/arch/arm/sub.mk | ||
49 | index 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 | -- | ||
61 | 2.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 @@ | |||
1 | Upstream-Status: Backport | ||
2 | Signed-off-by: Ross Burton <ross.burton@arm.com> | ||
3 | |||
4 | From 73196b58ea6978ffa5e581738030f51c5789ef73 Mon Sep 17 00:00:00 2001 | ||
5 | From: Volodymyr Babchuk <volodymyr_babchuk@epam.com> | ||
6 | Date: Tue, 13 Oct 2020 22:54:13 +0300 | ||
7 | Subject: [PATCH 2/3] link.mk: implement support for libnames-after-libgcc | ||
8 | variable | ||
9 | |||
10 | Newer versions of libgcc depend on external __getauxval() symbol, which is | ||
11 | now provided by libutils. But libgcc is linked after libutils, so linker | ||
12 | can't resolve that symbol. We can't include libgcc into linking group with | ||
13 | libtutils, because libgcc provides symbols that conflict with libutil's | ||
14 | ones, like __aeabi_idiv with friends for instance. | ||
15 | |||
16 | So, to resolve libgcc dependency on libutils we need to link with libutils | ||
17 | second time. To make things more generic, we will introduce | ||
18 | $(libnames-after-libgcc) variable for libraries that should be linked after | ||
19 | libgcc. | ||
20 | |||
21 | Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com> | ||
22 | Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> | ||
23 | Reviewed-by: Jerome Forissier <jerome@forissier.org> | ||
24 | --- | ||
25 | ta/arch/arm/link.mk | 6 +++++- | ||
26 | 1 file changed, 5 insertions(+), 1 deletion(-) | ||
27 | |||
28 | diff --git a/ta/arch/arm/link.mk b/ta/arch/arm/link.mk | ||
29 | index 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 | -- | ||
54 | 2.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 @@ | |||
1 | Upstream-Status: Backport | ||
2 | Signed-off-by: Ross Burton <ross.burton@arm.com> | ||
3 | |||
4 | From f50962e3f56f0932662b2ffa10afe53339a335dd Mon Sep 17 00:00:00 2001 | ||
5 | From: Volodymyr Babchuk <volodymyr_babchuk@epam.com> | ||
6 | Date: Fri, 16 Oct 2020 16:36:08 +0300 | ||
7 | Subject: [PATCH 3/3] ta_dev_kit.mk: make sure that libutils is linked second | ||
8 | time | ||
9 | |||
10 | libgcc depends on __getauxval symbol from libuils. As, generally libutils | ||
11 | is linked before libgcc, we will get "unresolved symbol" error. To resolve | ||
12 | this dependency we need to link libutils second time - after libgcc. | ||
13 | |||
14 | Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com> | ||
15 | Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> | ||
16 | Reviewed-by: Jerome Forissier <jerome@forissier.org> | ||
17 | --- | ||
18 | ta/mk/ta_dev_kit.mk | 10 ++++++++++ | ||
19 | 1 file changed, 10 insertions(+) | ||
20 | |||
21 | diff --git a/ta/mk/ta_dev_kit.mk b/ta/mk/ta_dev_kit.mk | ||
22 | index 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 | -- | ||
43 | 2.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 @@ | |||
1 | FILESEXTRAPATHS_prepend_ti-soc := "${THISDIR}/${PN}:" | 1 | FILESEXTRAPATHS_prepend_ti-soc := "${THISDIR}/${PN}:" |
2 | 2 | ||
3 | PV_ti-soc = "3.11.0+git${SRCPV}" | 3 | PV_ti-soc = "3.12.0+git${SRCPV}" |
4 | 4 | ||
5 | SRCREV_ti-soc = "c4def2a8262a03244d9a88461699b9b8e43c6b55" | 5 | SRCREV_ti-soc = "3d47a131bca1d9ed511bfd516aa5e70269e12c1d" |
6 | 6 | ||
7 | SRC_URI_ti-soc = " \ | 7 | SRC_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 | ||
16 | do_compile_prepend_ti-soc() { | 13 | do_compile_prepend_ti-soc() { |