All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arm/optee: version uplift 3.11.0 -> 3.14.0
@ 2021-07-20 10:07 Sumit Garg
  2021-07-20 14:42 ` [meta-arm] " Jon Mason
  2021-07-23 19:06 ` Ross Burton
  0 siblings, 2 replies; 11+ messages in thread
From: Sumit Garg @ 2021-07-20 10:07 UTC (permalink / raw)
  To: meta-arm; +Cc: jon.mason, ross.burton, Sumit Garg

Brief description of changes:
- Version uplift 3.11.0 -> 3.14.0.
- Removed OP-TEE patches that has already been accepted upstream.
- Added support for tee-supplicant plugin framework testing.

Tested on qemuarm64_secureboot:
$ xtest -l 15
$ optee-examples_*

Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
---
 .../optee/optee-client_3.11.0.bb              |   3 -
 .../optee/optee-client_3.14.0.bb              |   3 +
 .../recipes-security/optee/optee-examples.inc |   9 +-
 .../0001-make-Pass-ldflags-during-link.patch  | 103 ------------------
 ...efault-cross-compiler-environment-se.patch |  84 ++++++++++++++
 ...nable-plugins-installation-in-rootfs.patch |  39 +++++++
 .../optee/optee-examples_3.11.0.bb            |   4 -
 .../optee/optee-examples_3.14.0.bb            |   4 +
 ...ide-empty-__getauxval-implementation.patch |  62 -----------
 ...t-support-for-libnames-after-libgcc-.patch |  55 ----------
 ...ke-sure-that-libutils-is-linked-seco.patch |  44 --------
 .../recipes-security/optee/optee-os_3.11.0.bb |  11 --
 .../recipes-security/optee/optee-os_3.14.0.bb |   8 ++
 .../recipes-security/optee/optee-test.inc     |  15 +--
 ...Adjust-order-of-including-compiler.h.patch |  64 -----------
 ...ake-remove-Wno-unsafe-loop-for-clang.patch |  31 ------
 ...e-remove-Wmissing-noreturn-for-clang.patch |  31 ------
 .../optee/optee-test_3.11.0.bb                |   3 -
 .../optee/optee-test_3.14.0.bb                |   3 +
 19 files changed, 154 insertions(+), 422 deletions(-)
 delete mode 100644 meta-arm/recipes-security/optee/optee-client_3.11.0.bb
 create mode 100644 meta-arm/recipes-security/optee/optee-client_3.14.0.bb
 delete mode 100644 meta-arm/recipes-security/optee/optee-examples/0001-make-Pass-ldflags-during-link.patch
 create mode 100644 meta-arm/recipes-security/optee/optee-examples/0001-plugins-Honour-default-cross-compiler-environment-se.patch
 create mode 100644 meta-arm/recipes-security/optee/optee-examples/0002-Makefile-Enable-plugins-installation-in-rootfs.patch
 delete mode 100644 meta-arm/recipes-security/optee/optee-examples_3.11.0.bb
 create mode 100644 meta-arm/recipes-security/optee/optee-examples_3.14.0.bb
 delete mode 100644 meta-arm/recipes-security/optee/optee-os/0001-libutils-provide-empty-__getauxval-implementation.patch
 delete mode 100644 meta-arm/recipes-security/optee/optee-os/0002-link.mk-implement-support-for-libnames-after-libgcc-.patch
 delete mode 100644 meta-arm/recipes-security/optee/optee-os/0003-ta_dev_kit.mk-make-sure-that-libutils-is-linked-seco.patch
 delete mode 100644 meta-arm/recipes-security/optee/optee-os_3.11.0.bb
 create mode 100644 meta-arm/recipes-security/optee/optee-os_3.14.0.bb
 delete mode 100644 meta-arm/recipes-security/optee/optee-test/0001-host-xtest-Adjust-order-of-including-compiler.h.patch
 delete mode 100644 meta-arm/recipes-security/optee/optee-test/0002-make-remove-Wno-unsafe-loop-for-clang.patch
 delete mode 100644 meta-arm/recipes-security/optee/optee-test/0003-make-remove-Wmissing-noreturn-for-clang.patch
 delete mode 100644 meta-arm/recipes-security/optee/optee-test_3.11.0.bb
 create mode 100644 meta-arm/recipes-security/optee/optee-test_3.14.0.bb

diff --git a/meta-arm/recipes-security/optee/optee-client_3.11.0.bb b/meta-arm/recipes-security/optee/optee-client_3.11.0.bb
deleted file mode 100644
index f765d12..0000000
--- a/meta-arm/recipes-security/optee/optee-client_3.11.0.bb
+++ /dev/null
@@ -1,3 +0,0 @@
-require optee-client.inc
-
-SRCREV = "c0c925384c1d7e3558d27d2708857482952d7907"
diff --git a/meta-arm/recipes-security/optee/optee-client_3.14.0.bb b/meta-arm/recipes-security/optee/optee-client_3.14.0.bb
new file mode 100644
index 0000000..be78b88
--- /dev/null
+++ b/meta-arm/recipes-security/optee/optee-client_3.14.0.bb
@@ -0,0 +1,3 @@
+require optee-client.inc
+
+SRCREV = "06e1b32f6a7028e039c625b07cfc25fda0c17d53"
diff --git a/meta-arm/recipes-security/optee/optee-examples.inc b/meta-arm/recipes-security/optee/optee-examples.inc
index 81c31bc..f2e53f3 100644
--- a/meta-arm/recipes-security/optee/optee-examples.inc
+++ b/meta-arm/recipes-security/optee/optee-examples.inc
@@ -12,7 +12,8 @@ inherit python3native
 require optee.inc
 
 SRC_URI = "git://github.com/linaro-swg/optee_examples.git \
-           file://0001-make-Pass-ldflags-during-link.patch \
+           file://0001-plugins-Honour-default-cross-compiler-environment-se.patch \
+           file://0002-Makefile-Enable-plugins-installation-in-rootfs.patch \
           "
 
 EXTRA_OEMAKE += "TA_DEV_KIT_DIR=${TA_DEV_KIT_DIR} \
@@ -32,11 +33,15 @@ do_compile[cleandirs] = "${B}"
 do_install () {
     mkdir -p ${D}${nonarch_base_libdir}/optee_armtz
     mkdir -p ${D}${bindir}
+    mkdir -p ${D}${libdir}/tee-supplicant/plugins
     install -D -p -m0755 ${B}/ca/* ${D}${bindir}
     install -D -p -m0444 ${B}/ta/* ${D}${nonarch_base_libdir}/optee_armtz
+    install -D -p -m0444 ${B}/plugins/* ${D}${libdir}/tee-supplicant/plugins
 }
 
-FILES_${PN} += "${nonarch_base_libdir}/optee_armtz/"
+FILES_${PN} += "${nonarch_base_libdir}/optee_armtz/ \
+                ${libdir}/tee-supplicant/plugins/ \
+               "
 
 # Imports machine specific configs from staging to build
 PACKAGE_ARCH = "${MACHINE_ARCH}"
diff --git a/meta-arm/recipes-security/optee/optee-examples/0001-make-Pass-ldflags-during-link.patch b/meta-arm/recipes-security/optee/optee-examples/0001-make-Pass-ldflags-during-link.patch
deleted file mode 100644
index 84202ef..0000000
--- a/meta-arm/recipes-security/optee/optee-examples/0001-make-Pass-ldflags-during-link.patch
+++ /dev/null
@@ -1,103 +0,0 @@
-From 29ae21de41f2fbab6dbecbbf408826b28de82df1 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Tue, 1 Sep 2020 21:09:56 -0700
-Subject: [PATCH] make: Pass ldflags during link
-
-OpenEmbeeded needs to pass essential linker flags to set correct flags
-for gnu_hash among others which sets the linking straight
-using LDFLAGS varible here means, we can affect the linker flags
-from build environment
-
-Upstream-Status: Submitted [https://github.com/linaro-swg/optee_examples/pull/85]
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
- acipher/host/Makefile        | 2 +-
- aes/host/Makefile            | 2 +-
- hello_world/host/Makefile    | 2 +-
- hotp/host/Makefile           | 2 +-
- random/host/Makefile         | 2 +-
- secure_storage/host/Makefile | 2 +-
- 6 files changed, 6 insertions(+), 6 deletions(-)
-
-diff --git a/acipher/host/Makefile b/acipher/host/Makefile
-index 8f4bc8a..c2cabef 100644
---- a/acipher/host/Makefile
-+++ b/acipher/host/Makefile
-@@ -18,7 +18,7 @@ BINARY = optee_example_acipher
- all: $(BINARY)
- 
- $(BINARY): $(OBJS)
--	$(CC) -o $@ $< $(LDADD)
-+	$(CC) -o $@ $< $(LDFLAGS) $(LDADD)
- 
- .PHONY: clean
- clean:
-diff --git a/aes/host/Makefile b/aes/host/Makefile
-index dfeb4e8..f61c71b 100644
---- a/aes/host/Makefile
-+++ b/aes/host/Makefile
-@@ -18,7 +18,7 @@ BINARY = optee_example_aes
- all: $(BINARY)
- 
- $(BINARY): $(OBJS)
--	$(CC) -o $@ $< $(LDADD)
-+	$(CC) -o $@ $< $(LDFLAGS) $(LDADD)
- 
- .PHONY: clean
- clean:
-diff --git a/hello_world/host/Makefile b/hello_world/host/Makefile
-index c4c8239..69cf42c 100644
---- a/hello_world/host/Makefile
-+++ b/hello_world/host/Makefile
-@@ -18,7 +18,7 @@ BINARY = optee_example_hello_world
- all: $(BINARY)
- 
- $(BINARY): $(OBJS)
--	$(CC) -o $@ $< $(LDADD)
-+	$(CC) -o $@ $< $(LDFLAGS) $(LDADD)
- 
- .PHONY: clean
- clean:
-diff --git a/hotp/host/Makefile b/hotp/host/Makefile
-index cb7fd19..e7f013f 100644
---- a/hotp/host/Makefile
-+++ b/hotp/host/Makefile
-@@ -18,7 +18,7 @@ BINARY = optee_example_hotp
- all: $(BINARY)
- 
- $(BINARY): $(OBJS)
--	$(CC) -o $@ $< $(LDADD)
-+	$(CC) -o $@ $< $(LDFLAGS) $(LDADD)
- 
- .PHONY: clean
- clean:
-diff --git a/random/host/Makefile b/random/host/Makefile
-index fd407d9..9377f7a 100644
---- a/random/host/Makefile
-+++ b/random/host/Makefile
-@@ -18,7 +18,7 @@ BINARY = optee_example_random
- all: $(BINARY)
- 
- $(BINARY): $(OBJS)
--	$(CC) -o $@ $< $(LDADD)
-+	$(CC) -o $@ $< $(LDFLAGS) $(LDADD)
- 
- .PHONY: clean
- clean:
-diff --git a/secure_storage/host/Makefile b/secure_storage/host/Makefile
-index 29bfb87..b3265ae 100644
---- a/secure_storage/host/Makefile
-+++ b/secure_storage/host/Makefile
-@@ -18,7 +18,7 @@ BINARY = optee_example_secure_storage
- all: $(BINARY)
- 
- $(BINARY): $(OBJS)
--	$(CC) -o $@ $< $(LDADD)
-+	$(CC) -o $@ $< $(LDFLAGS) $(LDADD)
- 
- .PHONY: clean
- clean:
--- 
-2.28.0
-
diff --git a/meta-arm/recipes-security/optee/optee-examples/0001-plugins-Honour-default-cross-compiler-environment-se.patch b/meta-arm/recipes-security/optee/optee-examples/0001-plugins-Honour-default-cross-compiler-environment-se.patch
new file mode 100644
index 0000000..033e48c
--- /dev/null
+++ b/meta-arm/recipes-security/optee/optee-examples/0001-plugins-Honour-default-cross-compiler-environment-se.patch
@@ -0,0 +1,84 @@
+From 79c826c249001700007a6dffe80c3d61ff4428ef Mon Sep 17 00:00:00 2001
+From: Sumit Garg <sumit.garg@linaro.org>
+Date: Tue, 20 Jul 2021 13:54:30 +0530
+Subject: [PATCH 1/2] plugins: Honour default cross compiler environment setup
+
+Honour default $(CC), $(CFLAGS) and $(LDFLAGS) variables. Without this
+plugins example fails to build for OE/Yocto.
+
+Upstream-Status: Submitted [https://github.com/linaro-swg/optee_examples/pull/87]
+
+Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
+---
+ plugins/Makefile        |  2 +-
+ plugins/host/Makefile   |  2 +-
+ plugins/syslog/Makefile | 16 ++++++++++++----
+ 3 files changed, 14 insertions(+), 6 deletions(-)
+
+diff --git a/plugins/Makefile b/plugins/Makefile
+index 2372b38..ea472b4 100644
+--- a/plugins/Makefile
++++ b/plugins/Makefile
+@@ -8,7 +8,7 @@ TA_CROSS_COMPILE ?= $(CROSS_COMPILE)
+ all:
+ 	$(MAKE) -C host CROSS_COMPILE="$(HOST_CROSS_COMPILE)" --no-builtin-variables
+ 	$(MAKE) -C ta CROSS_COMPILE="$(TA_CROSS_COMPILE)" LDFLAGS=""
+-	$(MAKE) -C syslog CROSS_COMPILE="$(HOST_CROSS_COMPILE)"
++	$(MAKE) -C syslog CROSS_COMPILE="$(HOST_CROSS_COMPILE)" --no-builtin-variables
+ 
+ .PHONY: clean
+ clean:
+diff --git a/plugins/host/Makefile b/plugins/host/Makefile
+index 7285104..76244c7 100644
+--- a/plugins/host/Makefile
++++ b/plugins/host/Makefile
+@@ -20,7 +20,7 @@ BINARY = optee_example_plugins
+ all: $(BINARY)
+ 
+ $(BINARY): $(OBJS)
+-	$(CC) -o $@ $< $(LDADD)
++	$(CC) $(LDFLAGS) -o $@ $< $(LDADD)
+ 
+ .PHONY: clean
+ clean:
+diff --git a/plugins/syslog/Makefile b/plugins/syslog/Makefile
+index 62d916a..71f5f92 100644
+--- a/plugins/syslog/Makefile
++++ b/plugins/syslog/Makefile
+@@ -1,3 +1,11 @@
++CC      ?= $(CROSS_COMPILE)gcc
++LD      ?= $(CROSS_COMPILE)ld
++AR      ?= $(CROSS_COMPILE)ar
++NM      ?= $(CROSS_COMPILE)nm
++OBJCOPY ?= $(CROSS_COMPILE)objcopy
++OBJDUMP ?= $(CROSS_COMPILE)objdump
++READELF ?= $(CROSS_COMPILE)readelf
++
+ PLUGIN_UUID = 96bcf744-4f72-4866-bf1d-8634fd9c65e5
+ 
+ PLUGIN			= $(PLUGIN_UUID).plugin
+@@ -6,17 +14,17 @@ PLUGIN_OBJ		= $(patsubst %.c, %.o, $(PLUGIN_SRS))
+ PLUGIN_INCLUDES_DIR	= $(CURDIR) $(TEEC_EXPORT)/include
+ 
+ PLUGIN_INCLUDES		= $(addprefix -I, $(PLUGIN_INCLUDES_DIR))
+-PLUGIN_CCFLAGS		= -Wall -fPIC
+-PLUGIN_LDFLAGS		= -shared
++PLUGIN_CCFLAGS		= $(CFLAGS) -Wall -fPIC
++PLUGIN_LDFLAGS		= $(LDFLAGS) -shared
+ 
+ .PHONY: all
+ all: $(PLUGIN)
+ 
+ $(PLUGIN): $(PLUGIN_OBJ)
+-	$(CROSS_COMPILE)gcc $(PLUGIN_LDFLAGS) $(PLUGIN_OBJ) -o $@
++	$(CC) $(PLUGIN_LDFLAGS) $(PLUGIN_OBJ) -o $@
+ 
+ %.o: %.c
+-	$(CROSS_COMPILE)gcc $(PLUGIN_CCFLAGS) $(PLUGIN_INCLUDES) -c $*.c -o $*.o
++	$(CC) $(PLUGIN_CCFLAGS) $(PLUGIN_INCLUDES) -c $*.c -o $*.o
+ 
+ .PHONY: clean
+ clean:
+-- 
+2.25.1
+
diff --git a/meta-arm/recipes-security/optee/optee-examples/0002-Makefile-Enable-plugins-installation-in-rootfs.patch b/meta-arm/recipes-security/optee/optee-examples/0002-Makefile-Enable-plugins-installation-in-rootfs.patch
new file mode 100644
index 0000000..8d1d60a
--- /dev/null
+++ b/meta-arm/recipes-security/optee/optee-examples/0002-Makefile-Enable-plugins-installation-in-rootfs.patch
@@ -0,0 +1,39 @@
+From a865f2e25e178fc2c4617eb1faf79ac922d02ffd Mon Sep 17 00:00:00 2001
+From: Sumit Garg <sumit.garg@linaro.org>
+Date: Tue, 20 Jul 2021 14:20:10 +0530
+Subject: [PATCH 2/2] Makefile: Enable plugins installation in rootfs
+
+Upstream-Status: Submitted [https://github.com/linaro-swg/optee_examples/pull/87]
+
+Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
+---
+ Makefile | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/Makefile b/Makefile
+index a275842..b3f16aa 100644
+--- a/Makefile
++++ b/Makefile
+@@ -25,14 +25,19 @@ prepare-for-rootfs: examples
+ 	@mkdir -p $(OUTPUT_DIR)
+ 	@mkdir -p $(OUTPUT_DIR)/ta
+ 	@mkdir -p $(OUTPUT_DIR)/ca
++	@mkdir -p $(OUTPUT_DIR)/plugins
+ 	@for example in $(EXAMPLE_LIST); do \
+ 		if [ -e $$example/host/optee_example_$$example ]; then \
+ 			cp -p $$example/host/optee_example_$$example $(OUTPUT_DIR)/ca/; \
+ 		fi; \
+ 		cp -pr $$example/ta/*.ta $(OUTPUT_DIR)/ta/; \
++		if [ $$example == plugins ]; then \
++			cp -p plugins/syslog/*.plugin $(OUTPUT_DIR)/plugins/; \
++		fi; \
+ 	done
+ 
+ prepare-for-rootfs-clean:
+ 	@rm -rf $(OUTPUT_DIR)/ta
+ 	@rm -rf $(OUTPUT_DIR)/ca
++	@rm -rf $(OUTPUT_DIR)/plugins
+ 	@rmdir --ignore-fail-on-non-empty $(OUTPUT_DIR) || test ! -e $(OUTPUT_DIR)
+-- 
+2.25.1
+
diff --git a/meta-arm/recipes-security/optee/optee-examples_3.11.0.bb b/meta-arm/recipes-security/optee/optee-examples_3.11.0.bb
deleted file mode 100644
index 72473ed..0000000
--- a/meta-arm/recipes-security/optee/optee-examples_3.11.0.bb
+++ /dev/null
@@ -1,4 +0,0 @@
-require optee-examples.inc
-
-SRCREV = "9a7dc598591990349d88b4dba3a37aadd6851295"
-
diff --git a/meta-arm/recipes-security/optee/optee-examples_3.14.0.bb b/meta-arm/recipes-security/optee/optee-examples_3.14.0.bb
new file mode 100644
index 0000000..f2b5f7d
--- /dev/null
+++ b/meta-arm/recipes-security/optee/optee-examples_3.14.0.bb
@@ -0,0 +1,4 @@
+require optee-examples.inc
+
+SRCREV = "e9c870525af8f7e7fccf575a0ca5394ce55adcec"
+
diff --git a/meta-arm/recipes-security/optee/optee-os/0001-libutils-provide-empty-__getauxval-implementation.patch b/meta-arm/recipes-security/optee/optee-os/0001-libutils-provide-empty-__getauxval-implementation.patch
deleted file mode 100644
index 0120f5c..0000000
--- a/meta-arm/recipes-security/optee/optee-os/0001-libutils-provide-empty-__getauxval-implementation.patch
+++ /dev/null
@@ -1,62 +0,0 @@
-Upstream-Status: Backport
-Signed-off-by: Ross Burton <ross.burton@arm.com>
-
-From 36e784f621bf5d5be9183beba35f39426277c110 Mon Sep 17 00:00:00 2001
-From: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
-Date: Tue, 13 Oct 2020 22:45:39 +0300
-Subject: [PATCH 1/3] libutils: provide empty __getauxval() implementation
-
-Never version of libgcc are built with LSE implementation in mind. To
-determine if LSE is available on platform it calls __getauxval(), so in
-some cases we can get undefined reference to __getauxval() error.
-
-Prominent case is libgcc_eh.a library, which is used by C++ TAs. Exception
-handler depends on atomic operations, so it tries to call
-init_have_lse_atomics() first. This function in turn calls __getauxval(),
-which causes linking error.
-
-In the future we can make __getauxval() to return actual platform
-capabilities.
-
-Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
-Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
-Reviewed-by: Jerome Forissier <jerome@forissier.org>
----
- lib/libutils/ext/arch/arm/auxval.c | 12 ++++++++++++
- lib/libutils/ext/arch/arm/sub.mk   |  1 +
- 2 files changed, 13 insertions(+)
- create mode 100644 lib/libutils/ext/arch/arm/auxval.c
-
-diff --git a/lib/libutils/ext/arch/arm/auxval.c b/lib/libutils/ext/arch/arm/auxval.c
-new file mode 100644
-index 00000000..98bca850
---- /dev/null
-+++ b/lib/libutils/ext/arch/arm/auxval.c
-@@ -0,0 +1,12 @@
-+// SPDX-License-Identifier: BSD-2-Clause
-+/*
-+ * Copyright (c) 2020, EPAM Systems
-+ */
-+
-+#include <compiler.h>
-+
-+unsigned long int __getauxval (unsigned long int type);
-+unsigned long int __getauxval (unsigned long int type __unused)
-+{
-+	return 0;
-+}
-diff --git a/lib/libutils/ext/arch/arm/sub.mk b/lib/libutils/ext/arch/arm/sub.mk
-index dc5eed67..2e779066 100644
---- a/lib/libutils/ext/arch/arm/sub.mk
-+++ b/lib/libutils/ext/arch/arm/sub.mk
-@@ -3,6 +3,7 @@ srcs-$(CFG_ARM32_$(sm)) += aeabi_unwind.c
- endif
- srcs-$(CFG_ARM32_$(sm)) += atomic_a32.S
- srcs-$(CFG_ARM64_$(sm)) += atomic_a64.S
-+srcs-y += auxval.c
- ifneq ($(sm),ldelf) # TA, core
- srcs-$(CFG_ARM32_$(sm)) += mcount_a32.S
- srcs-$(CFG_ARM64_$(sm)) += mcount_a64.S
--- 
-2.25.1
-
diff --git a/meta-arm/recipes-security/optee/optee-os/0002-link.mk-implement-support-for-libnames-after-libgcc-.patch b/meta-arm/recipes-security/optee/optee-os/0002-link.mk-implement-support-for-libnames-after-libgcc-.patch
deleted file mode 100644
index 11296c8..0000000
--- a/meta-arm/recipes-security/optee/optee-os/0002-link.mk-implement-support-for-libnames-after-libgcc-.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-Upstream-Status: Backport
-Signed-off-by: Ross Burton <ross.burton@arm.com>
-
-From 73196b58ea6978ffa5e581738030f51c5789ef73 Mon Sep 17 00:00:00 2001
-From: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
-Date: Tue, 13 Oct 2020 22:54:13 +0300
-Subject: [PATCH 2/3] link.mk: implement support for libnames-after-libgcc
- variable
-
-Newer versions of libgcc depend on external __getauxval() symbol, which is
-now provided by libutils. But libgcc is linked after libutils, so linker
-can't resolve that symbol. We can't include libgcc into linking group with
-libtutils, because libgcc provides symbols that conflict with libutil's
-ones, like __aeabi_idiv with friends for instance.
-
-So, to resolve libgcc dependency on libutils we need to link with libutils
-second time. To make things more generic, we will introduce
-$(libnames-after-libgcc) variable for libraries that should be linked after
-libgcc.
-
-Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
-Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
-Reviewed-by: Jerome Forissier <jerome@forissier.org>
----
- ta/arch/arm/link.mk | 6 +++++-
- 1 file changed, 5 insertions(+), 1 deletion(-)
-
-diff --git a/ta/arch/arm/link.mk b/ta/arch/arm/link.mk
-index 445c285d..3025acb1 100644
---- a/ta/arch/arm/link.mk
-+++ b/ta/arch/arm/link.mk
-@@ -55,8 +55,11 @@ link-ldflags += --eh-frame-hdr
- link-ldadd += $(libstdc++$(sm)) $(libgcc_eh$(sm))
- endif
- link-ldadd += --end-group
--ldargs-$(user-ta-uuid).elf := $(link-ldflags) $(objs) $(link-ldadd) $(libgcc$(sm))
- 
-+link-ldadd-after-libgcc += $(addprefix -l,$(libnames-after-libgcc))
-+
-+ldargs-$(user-ta-uuid).elf := $(link-ldflags) $(objs) $(link-ldadd) \
-+				$(libgcc$(sm)) $(link-ldadd-after-libgcc)
- 
- link-script-cppflags-$(sm) := \
- 	$(filter-out $(CPPFLAGS_REMOVE) $(cppflags-remove), \
-@@ -76,6 +79,7 @@ $(link-script-pp$(sm)): $(link-script$(sm)) $(conf-file) $(link-script-pp-makefi
- 		$(link-script-cppflags-$(sm)) $$< -o $$@
- 
- $(link-out-dir$(sm))/$(user-ta-uuid).elf: $(objs) $(libdeps) \
-+					  $(libdeps-after-libgcc) \
- 					  $(link-script-pp$(sm)) \
- 					  $(dynlistdep) \
- 					  $(additional-link-deps)
--- 
-2.25.1
-
diff --git a/meta-arm/recipes-security/optee/optee-os/0003-ta_dev_kit.mk-make-sure-that-libutils-is-linked-seco.patch b/meta-arm/recipes-security/optee/optee-os/0003-ta_dev_kit.mk-make-sure-that-libutils-is-linked-seco.patch
deleted file mode 100644
index 88ba5f8..0000000
--- a/meta-arm/recipes-security/optee/optee-os/0003-ta_dev_kit.mk-make-sure-that-libutils-is-linked-seco.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-Upstream-Status: Backport
-Signed-off-by: Ross Burton <ross.burton@arm.com>
-
-From f50962e3f56f0932662b2ffa10afe53339a335dd Mon Sep 17 00:00:00 2001
-From: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
-Date: Fri, 16 Oct 2020 16:36:08 +0300
-Subject: [PATCH 3/3] ta_dev_kit.mk: make sure that libutils is linked second
- time
-
-libgcc depends on __getauxval symbol from libuils. As, generally libutils
-is linked before libgcc, we will get "unresolved symbol" error. To resolve
-this dependency we need to link libutils second time - after libgcc.
-
-Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
-Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
-Reviewed-by: Jerome Forissier <jerome@forissier.org>
----
- ta/mk/ta_dev_kit.mk | 10 ++++++++++
- 1 file changed, 10 insertions(+)
-
-diff --git a/ta/mk/ta_dev_kit.mk b/ta/mk/ta_dev_kit.mk
-index e28be677..d0e66317 100644
---- a/ta/mk/ta_dev_kit.mk
-+++ b/ta/mk/ta_dev_kit.mk
-@@ -78,6 +78,16 @@ endif
- libnames += dl
- libdeps += $(ta-dev-kit-dir$(sm))/lib/libdl.a
- 
-+# libutils provides __getauxval symbol which is needed by libgcc 10.x. We can't
-+# link libutils after libgcc, because libgcc will replace some symbols provided
-+# by libutils, which will cause further linking issues.
-+#
-+# But if we place libutils before libgcc, linker will not be able to resolve
-+# __getauxval. So we need to link with libutils twice: before and after libgcc.
-+# Hence it included both in $(libnames) and in $(libnames-after-libgcc)
-+libnames-after-libgcc += utils
-+libdeps-after-libgcc += $(ta-dev-kit-dir$(sm))/lib/libutils.a
-+
- # Pass config variable (CFG_) from conf.mk on the command line
- cppflags$(sm) += $(strip \
- 	$(foreach var, $(filter CFG_%,$(.VARIABLES)), \
--- 
-2.25.1
-
diff --git a/meta-arm/recipes-security/optee/optee-os_3.11.0.bb b/meta-arm/recipes-security/optee/optee-os_3.11.0.bb
deleted file mode 100644
index 13b3dc6..0000000
--- a/meta-arm/recipes-security/optee/optee-os_3.11.0.bb
+++ /dev/null
@@ -1,11 +0,0 @@
-require optee-os.inc
-
-SRCREV = "c4def2a8262a03244d9a88461699b9b8e43c6b55"
-
-SRC_URI_append = " \
-    file://0006-allow-setting-sysroot-for-libgcc-lookup.patch \
-    file://0007-allow-setting-sysroot-for-clang.patch \
-    file://0001-libutils-provide-empty-__getauxval-implementation.patch \
-    file://0002-link.mk-implement-support-for-libnames-after-libgcc-.patch \
-    file://0003-ta_dev_kit.mk-make-sure-that-libutils-is-linked-seco.patch \
-"
diff --git a/meta-arm/recipes-security/optee/optee-os_3.14.0.bb b/meta-arm/recipes-security/optee/optee-os_3.14.0.bb
new file mode 100644
index 0000000..3289e2c
--- /dev/null
+++ b/meta-arm/recipes-security/optee/optee-os_3.14.0.bb
@@ -0,0 +1,8 @@
+require optee-os.inc
+
+SRCREV = "d21befa5e53eae9db469eba1685f5aa5c6f92c2f"
+
+SRC_URI_append = " \
+    file://0006-allow-setting-sysroot-for-libgcc-lookup.patch \
+    file://0007-allow-setting-sysroot-for-clang.patch \
+"
diff --git a/meta-arm/recipes-security/optee/optee-test.inc b/meta-arm/recipes-security/optee/optee-test.inc
index f09b9d2..bcbcc06 100644
--- a/meta-arm/recipes-security/optee/optee-test.inc
+++ b/meta-arm/recipes-security/optee/optee-test.inc
@@ -8,17 +8,9 @@ LIC_FILES_CHKSUM = "file://${S}/LICENSE.md;md5=daa2bcccc666345ab8940aab1315a4fa"
 inherit python3native ptest
 require optee.inc
 
-# Linking fails on musl due to C++/threads
-# https://github.com/OP-TEE/optee_test/issues/458#issuecomment-720540834
-# When upgraded we should be able to remove this limitation
-COMPATIBLE_HOST_libc-musl = 'null'
-
 DEPENDS = "optee-client optee-os python3-pycryptodome-native"
 
 SRC_URI = "git://github.com/OP-TEE/optee_test.git \
-           file://0001-host-xtest-Adjust-order-of-including-compiler.h.patch \
-           file://0002-make-remove-Wno-unsafe-loop-for-clang.patch \ 
-           file://0003-make-remove-Wmissing-noreturn-for-clang.patch \
            file://run-ptest \
           "
 
@@ -36,6 +28,7 @@ do_compile() {
     # Top level makefile doesn't seem to handle parallel make gracefully
     oe_runmake xtest
     oe_runmake ta
+    oe_runmake test_plugin
 }
 do_compile[cleandirs] = "${B}"
 
@@ -46,9 +39,13 @@ do_install () {
     # default TEEC_LOAD_PATH is /lib
     mkdir -p ${D}${nonarch_base_libdir}/optee_armtz/
     install -D -p -m0444 ${B}/ta/*/*.ta ${D}${nonarch_base_libdir}/optee_armtz/
+    mkdir -p ${D}${libdir}/tee-supplicant/plugins
+    install -D -p -m0444 ${B}/supp_plugin/*.plugin ${D}${libdir}/tee-supplicant/plugins/
 }
 
-FILES_${PN} += "${nonarch_base_libdir}/optee_armtz/"
+FILES_${PN} += "${nonarch_base_libdir}/optee_armtz/ \
+                ${libdir}/tee-supplicant/plugins/ \
+               "
 
 # Imports machine specific configs from staging to build
 PACKAGE_ARCH = "${MACHINE_ARCH}"
diff --git a/meta-arm/recipes-security/optee/optee-test/0001-host-xtest-Adjust-order-of-including-compiler.h.patch b/meta-arm/recipes-security/optee/optee-test/0001-host-xtest-Adjust-order-of-including-compiler.h.patch
deleted file mode 100644
index 3c500d7..0000000
--- a/meta-arm/recipes-security/optee/optee-test/0001-host-xtest-Adjust-order-of-including-compiler.h.patch
+++ /dev/null
@@ -1,64 +0,0 @@
-From fc95b3ccbbfd336797ae2cfd6dd4dc58644e146f Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Sat, 30 May 2020 17:52:18 -0700
-Subject: [PATCH] host/xtest: Adjust order of including compiler.h
-
-compiler.h defines some defines which violate libc namespace e.g.
-__unused, this works ok with glibc but fails in awkward ways with musl
-the reason is musl uses __unused in its internal structures and this
-define in compiler.h conflicts with system headers causing errors like
-
-recipe-sysroot/usr/include/bits/stat.h:17:19: error: expected identifier or '(' before '[' token unsigned __unused[2];
-                   ^
-including compiler.h afer sys/stat.h fixes the problem.
-
-Upstream-Status: Pending [https://github.com/OP-TEE/optee_test/issues/453]
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
- host/xtest/install_ta.c | 2 +-
- host/xtest/stats.c      | 2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/host/xtest/install_ta.c b/host/xtest/install_ta.c
-index 09a4c6d..6f7bb5c 100644
---- a/host/xtest/install_ta.c
-+++ b/host/xtest/install_ta.c
-@@ -4,7 +4,6 @@
-  * SPDX-License-Identifier: BSD-2-Clause
-  */
- 
--#include <compiler.h>
- #include <dirent.h>
- #include <err.h>
- #include <errno.h>
-@@ -20,6 +19,7 @@
- #include <sys/types.h>
- #include <tee_client_api.h>
- #include <unistd.h>
-+#include <compiler.h>
- 
- #include "install_ta.h"
- #include "xtest_helpers.h"
-diff --git a/host/xtest/stats.c b/host/xtest/stats.c
-index 96b0b5f..db9bf25 100644
---- a/host/xtest/stats.c
-+++ b/host/xtest/stats.c
-@@ -3,7 +3,6 @@
-  * Copyright (c) 2019, Linaro Limited
-  */
- 
--#include <compiler.h>
- #include <dirent.h>
- #include <err.h>
- #include <errno.h>
-@@ -18,6 +17,7 @@
- #include <sys/types.h>
- #include <tee_client_api.h>
- #include <unistd.h>
-+#include <compiler.h>
- #include "xtest_test.h"
- #include "stats.h"
- 
--- 
-2.26.2
-
diff --git a/meta-arm/recipes-security/optee/optee-test/0002-make-remove-Wno-unsafe-loop-for-clang.patch b/meta-arm/recipes-security/optee/optee-test/0002-make-remove-Wno-unsafe-loop-for-clang.patch
deleted file mode 100644
index 17dd7d8..0000000
--- a/meta-arm/recipes-security/optee/optee-test/0002-make-remove-Wno-unsafe-loop-for-clang.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From 438533ce9da1df0b7c7914e64b39ffdc1da1ab79 Mon Sep 17 00:00:00 2001
-From: Brett Warren <brett.warran@arm.com>
-Date: Thu, 8 Oct 2020 10:03:25 +0100
-Subject: [PATCH] make: remove -Wmissing-noreturn for clang
-
-When compiling when clang, -Wmissing-noreturn causes an error because
-of non-compliant code. This option is removed to workaround this.
-
-Upstream-Status: Pending [https://github.com/OP-TEE/optee_test/issues/452]
-Changed-Id: 71cb511904547d790d1ea98f93bf8e5a6afcb36d
-Signed-off-by: Brett Warren <brett.warren@arm.com>
----
- host/xtest/Makefile | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/host/xtest/Makefile b/host/xtest/Makefile
-index 3c206b0..96746de 100644
---- a/host/xtest/Makefile
-+++ b/host/xtest/Makefile
-@@ -169,7 +169,7 @@ CFLAGS += -Wall -Wcast-align -Werror \
- 	  -Werror-implicit-function-declaration -Wextra -Wfloat-equal \
- 	  -Wformat-nonliteral -Wformat-security -Wformat=2 -Winit-self \
- 	  -Wmissing-declarations -Wmissing-format-attribute \
--	  -Wmissing-include-dirs -Wmissing-noreturn \
-+	  -Wmissing-include-dirs \
- 	  -Wmissing-prototypes -Wnested-externs -Wpointer-arith \
- 	  -Wshadow -Wstrict-prototypes -Wswitch-default \
- 	  -Wwrite-strings \
--- 
-2.17.1
-
diff --git a/meta-arm/recipes-security/optee/optee-test/0003-make-remove-Wmissing-noreturn-for-clang.patch b/meta-arm/recipes-security/optee/optee-test/0003-make-remove-Wmissing-noreturn-for-clang.patch
deleted file mode 100644
index bbc303f..0000000
--- a/meta-arm/recipes-security/optee/optee-test/0003-make-remove-Wmissing-noreturn-for-clang.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From ed5a9d9f7a3e9e14ca0e8aea59008124ee0e5f96 Mon Sep 17 00:00:00 2001
-From: Brett Warren <brett.warren@arm.com>
-Date: Thu, 8 Oct 2020 10:20:52 +0100
-Subject: [PATCH] make: remove -Wno-unsafe-loop for clang
-
-When compiling with clang, the -Wno-unsafe-loop-optimizations option
-throws an error because clang doesn't recognise it. This option is
-removed to workaround this.
-
-Upstream-Status: Pending [https://github.com/OP-TEE/optee_test/issues/452]
-Change-Id: 5fe0892c73208aaffac8c9995cb3275936fb1ba6
-Signed-off-by: Brett Warren <brett.warren@arm.com>
----
- host/xtest/Makefile | 1 -
- 1 file changed, 1 deletion(-)
-
-diff --git a/host/xtest/Makefile b/host/xtest/Makefile
-index 96746de..73731d0 100644
---- a/host/xtest/Makefile
-+++ b/host/xtest/Makefile
-@@ -174,7 +174,6 @@ CFLAGS += -Wall -Wcast-align -Werror \
- 	  -Wshadow -Wstrict-prototypes -Wswitch-default \
- 	  -Wwrite-strings \
- 	  -Wno-declaration-after-statement \
--	  -Wno-unsafe-loop-optimizations \
- 	  -Wno-missing-field-initializers -Wno-format-zero-length
- endif
- 
--- 
-2.17.1
-
diff --git a/meta-arm/recipes-security/optee/optee-test_3.11.0.bb b/meta-arm/recipes-security/optee/optee-test_3.11.0.bb
deleted file mode 100644
index 0f8b5b0..0000000
--- a/meta-arm/recipes-security/optee/optee-test_3.11.0.bb
+++ /dev/null
@@ -1,3 +0,0 @@
-require optee-test.inc
-
-SRCREV = "159e295d5cc3ad2275ab15fe544620f6604d4ba4"
diff --git a/meta-arm/recipes-security/optee/optee-test_3.14.0.bb b/meta-arm/recipes-security/optee/optee-test_3.14.0.bb
new file mode 100644
index 0000000..6367c27
--- /dev/null
+++ b/meta-arm/recipes-security/optee/optee-test_3.14.0.bb
@@ -0,0 +1,3 @@
+require optee-test.inc
+
+SRCREV = "f2eb88affbb7f028561b4fd5cbd049d5d704f741"
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [meta-arm] [PATCH] arm/optee: version uplift 3.11.0 -> 3.14.0
  2021-07-20 10:07 [PATCH] arm/optee: version uplift 3.11.0 -> 3.14.0 Sumit Garg
@ 2021-07-20 14:42 ` Jon Mason
  2021-07-22  8:00   ` Sumit Garg
  2021-07-23 19:06 ` Ross Burton
  1 sibling, 1 reply; 11+ messages in thread
From: Jon Mason @ 2021-07-20 14:42 UTC (permalink / raw)
  To: Sumit Garg; +Cc: meta-arm, jon.mason, ross.burton

On Tue, Jul 20, 2021 at 03:37:01PM +0530, Sumit Garg wrote:
> Brief description of changes:
> - Version uplift 3.11.0 -> 3.14.0.
> - Removed OP-TEE patches that has already been accepted upstream.
> - Added support for tee-supplicant plugin framework testing.
> 
> Tested on qemuarm64_secureboot:
> $ xtest -l 15
> $ optee-examples_*


Unfortunately, TC0 is using the 3.11 version.  So, it breaks when
applying this patch.  Can you rework this patch to keep the old
version around?

Thanks,
Jon

> 
> Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
> ---
>  .../optee/optee-client_3.11.0.bb              |   3 -
>  .../optee/optee-client_3.14.0.bb              |   3 +
>  .../recipes-security/optee/optee-examples.inc |   9 +-
>  .../0001-make-Pass-ldflags-during-link.patch  | 103 ------------------
>  ...efault-cross-compiler-environment-se.patch |  84 ++++++++++++++
>  ...nable-plugins-installation-in-rootfs.patch |  39 +++++++
>  .../optee/optee-examples_3.11.0.bb            |   4 -
>  .../optee/optee-examples_3.14.0.bb            |   4 +
>  ...ide-empty-__getauxval-implementation.patch |  62 -----------
>  ...t-support-for-libnames-after-libgcc-.patch |  55 ----------
>  ...ke-sure-that-libutils-is-linked-seco.patch |  44 --------
>  .../recipes-security/optee/optee-os_3.11.0.bb |  11 --
>  .../recipes-security/optee/optee-os_3.14.0.bb |   8 ++
>  .../recipes-security/optee/optee-test.inc     |  15 +--
>  ...Adjust-order-of-including-compiler.h.patch |  64 -----------
>  ...ake-remove-Wno-unsafe-loop-for-clang.patch |  31 ------
>  ...e-remove-Wmissing-noreturn-for-clang.patch |  31 ------
>  .../optee/optee-test_3.11.0.bb                |   3 -
>  .../optee/optee-test_3.14.0.bb                |   3 +
>  19 files changed, 154 insertions(+), 422 deletions(-)
>  delete mode 100644 meta-arm/recipes-security/optee/optee-client_3.11.0.bb
>  create mode 100644 meta-arm/recipes-security/optee/optee-client_3.14.0.bb
>  delete mode 100644 meta-arm/recipes-security/optee/optee-examples/0001-make-Pass-ldflags-during-link.patch
>  create mode 100644 meta-arm/recipes-security/optee/optee-examples/0001-plugins-Honour-default-cross-compiler-environment-se.patch
>  create mode 100644 meta-arm/recipes-security/optee/optee-examples/0002-Makefile-Enable-plugins-installation-in-rootfs.patch
>  delete mode 100644 meta-arm/recipes-security/optee/optee-examples_3.11.0.bb
>  create mode 100644 meta-arm/recipes-security/optee/optee-examples_3.14.0.bb
>  delete mode 100644 meta-arm/recipes-security/optee/optee-os/0001-libutils-provide-empty-__getauxval-implementation.patch
>  delete mode 100644 meta-arm/recipes-security/optee/optee-os/0002-link.mk-implement-support-for-libnames-after-libgcc-.patch
>  delete mode 100644 meta-arm/recipes-security/optee/optee-os/0003-ta_dev_kit.mk-make-sure-that-libutils-is-linked-seco.patch
>  delete mode 100644 meta-arm/recipes-security/optee/optee-os_3.11.0.bb
>  create mode 100644 meta-arm/recipes-security/optee/optee-os_3.14.0.bb
>  delete mode 100644 meta-arm/recipes-security/optee/optee-test/0001-host-xtest-Adjust-order-of-including-compiler.h.patch
>  delete mode 100644 meta-arm/recipes-security/optee/optee-test/0002-make-remove-Wno-unsafe-loop-for-clang.patch
>  delete mode 100644 meta-arm/recipes-security/optee/optee-test/0003-make-remove-Wmissing-noreturn-for-clang.patch
>  delete mode 100644 meta-arm/recipes-security/optee/optee-test_3.11.0.bb
>  create mode 100644 meta-arm/recipes-security/optee/optee-test_3.14.0.bb
> 
> diff --git a/meta-arm/recipes-security/optee/optee-client_3.11.0.bb b/meta-arm/recipes-security/optee/optee-client_3.11.0.bb
> deleted file mode 100644
> index f765d12..0000000
> --- a/meta-arm/recipes-security/optee/optee-client_3.11.0.bb
> +++ /dev/null
> @@ -1,3 +0,0 @@
> -require optee-client.inc
> -
> -SRCREV = "c0c925384c1d7e3558d27d2708857482952d7907"
> diff --git a/meta-arm/recipes-security/optee/optee-client_3.14.0.bb b/meta-arm/recipes-security/optee/optee-client_3.14.0.bb
> new file mode 100644
> index 0000000..be78b88
> --- /dev/null
> +++ b/meta-arm/recipes-security/optee/optee-client_3.14.0.bb
> @@ -0,0 +1,3 @@
> +require optee-client.inc
> +
> +SRCREV = "06e1b32f6a7028e039c625b07cfc25fda0c17d53"
> diff --git a/meta-arm/recipes-security/optee/optee-examples.inc b/meta-arm/recipes-security/optee/optee-examples.inc
> index 81c31bc..f2e53f3 100644
> --- a/meta-arm/recipes-security/optee/optee-examples.inc
> +++ b/meta-arm/recipes-security/optee/optee-examples.inc
> @@ -12,7 +12,8 @@ inherit python3native
>  require optee.inc
>  
>  SRC_URI = "git://github.com/linaro-swg/optee_examples.git \
> -           file://0001-make-Pass-ldflags-during-link.patch \
> +           file://0001-plugins-Honour-default-cross-compiler-environment-se.patch \
> +           file://0002-Makefile-Enable-plugins-installation-in-rootfs.patch \
>            "
>  
>  EXTRA_OEMAKE += "TA_DEV_KIT_DIR=${TA_DEV_KIT_DIR} \
> @@ -32,11 +33,15 @@ do_compile[cleandirs] = "${B}"
>  do_install () {
>      mkdir -p ${D}${nonarch_base_libdir}/optee_armtz
>      mkdir -p ${D}${bindir}
> +    mkdir -p ${D}${libdir}/tee-supplicant/plugins
>      install -D -p -m0755 ${B}/ca/* ${D}${bindir}
>      install -D -p -m0444 ${B}/ta/* ${D}${nonarch_base_libdir}/optee_armtz
> +    install -D -p -m0444 ${B}/plugins/* ${D}${libdir}/tee-supplicant/plugins
>  }
>  
> -FILES_${PN} += "${nonarch_base_libdir}/optee_armtz/"
> +FILES_${PN} += "${nonarch_base_libdir}/optee_armtz/ \
> +                ${libdir}/tee-supplicant/plugins/ \
> +               "
>  
>  # Imports machine specific configs from staging to build
>  PACKAGE_ARCH = "${MACHINE_ARCH}"
> diff --git a/meta-arm/recipes-security/optee/optee-examples/0001-make-Pass-ldflags-during-link.patch b/meta-arm/recipes-security/optee/optee-examples/0001-make-Pass-ldflags-during-link.patch
> deleted file mode 100644
> index 84202ef..0000000
> --- a/meta-arm/recipes-security/optee/optee-examples/0001-make-Pass-ldflags-during-link.patch
> +++ /dev/null
> @@ -1,103 +0,0 @@
> -From 29ae21de41f2fbab6dbecbbf408826b28de82df1 Mon Sep 17 00:00:00 2001
> -From: Khem Raj <raj.khem@gmail.com>
> -Date: Tue, 1 Sep 2020 21:09:56 -0700
> -Subject: [PATCH] make: Pass ldflags during link
> -
> -OpenEmbeeded needs to pass essential linker flags to set correct flags
> -for gnu_hash among others which sets the linking straight
> -using LDFLAGS varible here means, we can affect the linker flags
> -from build environment
> -
> -Upstream-Status: Submitted [https://github.com/linaro-swg/optee_examples/pull/85]
> -
> -Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ----
> - acipher/host/Makefile        | 2 +-
> - aes/host/Makefile            | 2 +-
> - hello_world/host/Makefile    | 2 +-
> - hotp/host/Makefile           | 2 +-
> - random/host/Makefile         | 2 +-
> - secure_storage/host/Makefile | 2 +-
> - 6 files changed, 6 insertions(+), 6 deletions(-)
> -
> -diff --git a/acipher/host/Makefile b/acipher/host/Makefile
> -index 8f4bc8a..c2cabef 100644
> ---- a/acipher/host/Makefile
> -+++ b/acipher/host/Makefile
> -@@ -18,7 +18,7 @@ BINARY = optee_example_acipher
> - all: $(BINARY)
> - 
> - $(BINARY): $(OBJS)
> --	$(CC) -o $@ $< $(LDADD)
> -+	$(CC) -o $@ $< $(LDFLAGS) $(LDADD)
> - 
> - .PHONY: clean
> - clean:
> -diff --git a/aes/host/Makefile b/aes/host/Makefile
> -index dfeb4e8..f61c71b 100644
> ---- a/aes/host/Makefile
> -+++ b/aes/host/Makefile
> -@@ -18,7 +18,7 @@ BINARY = optee_example_aes
> - all: $(BINARY)
> - 
> - $(BINARY): $(OBJS)
> --	$(CC) -o $@ $< $(LDADD)
> -+	$(CC) -o $@ $< $(LDFLAGS) $(LDADD)
> - 
> - .PHONY: clean
> - clean:
> -diff --git a/hello_world/host/Makefile b/hello_world/host/Makefile
> -index c4c8239..69cf42c 100644
> ---- a/hello_world/host/Makefile
> -+++ b/hello_world/host/Makefile
> -@@ -18,7 +18,7 @@ BINARY = optee_example_hello_world
> - all: $(BINARY)
> - 
> - $(BINARY): $(OBJS)
> --	$(CC) -o $@ $< $(LDADD)
> -+	$(CC) -o $@ $< $(LDFLAGS) $(LDADD)
> - 
> - .PHONY: clean
> - clean:
> -diff --git a/hotp/host/Makefile b/hotp/host/Makefile
> -index cb7fd19..e7f013f 100644
> ---- a/hotp/host/Makefile
> -+++ b/hotp/host/Makefile
> -@@ -18,7 +18,7 @@ BINARY = optee_example_hotp
> - all: $(BINARY)
> - 
> - $(BINARY): $(OBJS)
> --	$(CC) -o $@ $< $(LDADD)
> -+	$(CC) -o $@ $< $(LDFLAGS) $(LDADD)
> - 
> - .PHONY: clean
> - clean:
> -diff --git a/random/host/Makefile b/random/host/Makefile
> -index fd407d9..9377f7a 100644
> ---- a/random/host/Makefile
> -+++ b/random/host/Makefile
> -@@ -18,7 +18,7 @@ BINARY = optee_example_random
> - all: $(BINARY)
> - 
> - $(BINARY): $(OBJS)
> --	$(CC) -o $@ $< $(LDADD)
> -+	$(CC) -o $@ $< $(LDFLAGS) $(LDADD)
> - 
> - .PHONY: clean
> - clean:
> -diff --git a/secure_storage/host/Makefile b/secure_storage/host/Makefile
> -index 29bfb87..b3265ae 100644
> ---- a/secure_storage/host/Makefile
> -+++ b/secure_storage/host/Makefile
> -@@ -18,7 +18,7 @@ BINARY = optee_example_secure_storage
> - all: $(BINARY)
> - 
> - $(BINARY): $(OBJS)
> --	$(CC) -o $@ $< $(LDADD)
> -+	$(CC) -o $@ $< $(LDFLAGS) $(LDADD)
> - 
> - .PHONY: clean
> - clean:
> --- 
> -2.28.0
> -
> diff --git a/meta-arm/recipes-security/optee/optee-examples/0001-plugins-Honour-default-cross-compiler-environment-se.patch b/meta-arm/recipes-security/optee/optee-examples/0001-plugins-Honour-default-cross-compiler-environment-se.patch
> new file mode 100644
> index 0000000..033e48c
> --- /dev/null
> +++ b/meta-arm/recipes-security/optee/optee-examples/0001-plugins-Honour-default-cross-compiler-environment-se.patch
> @@ -0,0 +1,84 @@
> +From 79c826c249001700007a6dffe80c3d61ff4428ef Mon Sep 17 00:00:00 2001
> +From: Sumit Garg <sumit.garg@linaro.org>
> +Date: Tue, 20 Jul 2021 13:54:30 +0530
> +Subject: [PATCH 1/2] plugins: Honour default cross compiler environment setup
> +
> +Honour default $(CC), $(CFLAGS) and $(LDFLAGS) variables. Without this
> +plugins example fails to build for OE/Yocto.
> +
> +Upstream-Status: Submitted [https://github.com/linaro-swg/optee_examples/pull/87]
> +
> +Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
> +---
> + plugins/Makefile        |  2 +-
> + plugins/host/Makefile   |  2 +-
> + plugins/syslog/Makefile | 16 ++++++++++++----
> + 3 files changed, 14 insertions(+), 6 deletions(-)
> +
> +diff --git a/plugins/Makefile b/plugins/Makefile
> +index 2372b38..ea472b4 100644
> +--- a/plugins/Makefile
> ++++ b/plugins/Makefile
> +@@ -8,7 +8,7 @@ TA_CROSS_COMPILE ?= $(CROSS_COMPILE)
> + all:
> + 	$(MAKE) -C host CROSS_COMPILE="$(HOST_CROSS_COMPILE)" --no-builtin-variables
> + 	$(MAKE) -C ta CROSS_COMPILE="$(TA_CROSS_COMPILE)" LDFLAGS=""
> +-	$(MAKE) -C syslog CROSS_COMPILE="$(HOST_CROSS_COMPILE)"
> ++	$(MAKE) -C syslog CROSS_COMPILE="$(HOST_CROSS_COMPILE)" --no-builtin-variables
> + 
> + .PHONY: clean
> + clean:
> +diff --git a/plugins/host/Makefile b/plugins/host/Makefile
> +index 7285104..76244c7 100644
> +--- a/plugins/host/Makefile
> ++++ b/plugins/host/Makefile
> +@@ -20,7 +20,7 @@ BINARY = optee_example_plugins
> + all: $(BINARY)
> + 
> + $(BINARY): $(OBJS)
> +-	$(CC) -o $@ $< $(LDADD)
> ++	$(CC) $(LDFLAGS) -o $@ $< $(LDADD)
> + 
> + .PHONY: clean
> + clean:
> +diff --git a/plugins/syslog/Makefile b/plugins/syslog/Makefile
> +index 62d916a..71f5f92 100644
> +--- a/plugins/syslog/Makefile
> ++++ b/plugins/syslog/Makefile
> +@@ -1,3 +1,11 @@
> ++CC      ?= $(CROSS_COMPILE)gcc
> ++LD      ?= $(CROSS_COMPILE)ld
> ++AR      ?= $(CROSS_COMPILE)ar
> ++NM      ?= $(CROSS_COMPILE)nm
> ++OBJCOPY ?= $(CROSS_COMPILE)objcopy
> ++OBJDUMP ?= $(CROSS_COMPILE)objdump
> ++READELF ?= $(CROSS_COMPILE)readelf
> ++
> + PLUGIN_UUID = 96bcf744-4f72-4866-bf1d-8634fd9c65e5
> + 
> + PLUGIN			= $(PLUGIN_UUID).plugin
> +@@ -6,17 +14,17 @@ PLUGIN_OBJ		= $(patsubst %.c, %.o, $(PLUGIN_SRS))
> + PLUGIN_INCLUDES_DIR	= $(CURDIR) $(TEEC_EXPORT)/include
> + 
> + PLUGIN_INCLUDES		= $(addprefix -I, $(PLUGIN_INCLUDES_DIR))
> +-PLUGIN_CCFLAGS		= -Wall -fPIC
> +-PLUGIN_LDFLAGS		= -shared
> ++PLUGIN_CCFLAGS		= $(CFLAGS) -Wall -fPIC
> ++PLUGIN_LDFLAGS		= $(LDFLAGS) -shared
> + 
> + .PHONY: all
> + all: $(PLUGIN)
> + 
> + $(PLUGIN): $(PLUGIN_OBJ)
> +-	$(CROSS_COMPILE)gcc $(PLUGIN_LDFLAGS) $(PLUGIN_OBJ) -o $@
> ++	$(CC) $(PLUGIN_LDFLAGS) $(PLUGIN_OBJ) -o $@
> + 
> + %.o: %.c
> +-	$(CROSS_COMPILE)gcc $(PLUGIN_CCFLAGS) $(PLUGIN_INCLUDES) -c $*.c -o $*.o
> ++	$(CC) $(PLUGIN_CCFLAGS) $(PLUGIN_INCLUDES) -c $*.c -o $*.o
> + 
> + .PHONY: clean
> + clean:
> +-- 
> +2.25.1
> +
> diff --git a/meta-arm/recipes-security/optee/optee-examples/0002-Makefile-Enable-plugins-installation-in-rootfs.patch b/meta-arm/recipes-security/optee/optee-examples/0002-Makefile-Enable-plugins-installation-in-rootfs.patch
> new file mode 100644
> index 0000000..8d1d60a
> --- /dev/null
> +++ b/meta-arm/recipes-security/optee/optee-examples/0002-Makefile-Enable-plugins-installation-in-rootfs.patch
> @@ -0,0 +1,39 @@
> +From a865f2e25e178fc2c4617eb1faf79ac922d02ffd Mon Sep 17 00:00:00 2001
> +From: Sumit Garg <sumit.garg@linaro.org>
> +Date: Tue, 20 Jul 2021 14:20:10 +0530
> +Subject: [PATCH 2/2] Makefile: Enable plugins installation in rootfs
> +
> +Upstream-Status: Submitted [https://github.com/linaro-swg/optee_examples/pull/87]
> +
> +Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
> +---
> + Makefile | 5 +++++
> + 1 file changed, 5 insertions(+)
> +
> +diff --git a/Makefile b/Makefile
> +index a275842..b3f16aa 100644
> +--- a/Makefile
> ++++ b/Makefile
> +@@ -25,14 +25,19 @@ prepare-for-rootfs: examples
> + 	@mkdir -p $(OUTPUT_DIR)
> + 	@mkdir -p $(OUTPUT_DIR)/ta
> + 	@mkdir -p $(OUTPUT_DIR)/ca
> ++	@mkdir -p $(OUTPUT_DIR)/plugins
> + 	@for example in $(EXAMPLE_LIST); do \
> + 		if [ -e $$example/host/optee_example_$$example ]; then \
> + 			cp -p $$example/host/optee_example_$$example $(OUTPUT_DIR)/ca/; \
> + 		fi; \
> + 		cp -pr $$example/ta/*.ta $(OUTPUT_DIR)/ta/; \
> ++		if [ $$example == plugins ]; then \
> ++			cp -p plugins/syslog/*.plugin $(OUTPUT_DIR)/plugins/; \
> ++		fi; \
> + 	done
> + 
> + prepare-for-rootfs-clean:
> + 	@rm -rf $(OUTPUT_DIR)/ta
> + 	@rm -rf $(OUTPUT_DIR)/ca
> ++	@rm -rf $(OUTPUT_DIR)/plugins
> + 	@rmdir --ignore-fail-on-non-empty $(OUTPUT_DIR) || test ! -e $(OUTPUT_DIR)
> +-- 
> +2.25.1
> +
> diff --git a/meta-arm/recipes-security/optee/optee-examples_3.11.0.bb b/meta-arm/recipes-security/optee/optee-examples_3.11.0.bb
> deleted file mode 100644
> index 72473ed..0000000
> --- a/meta-arm/recipes-security/optee/optee-examples_3.11.0.bb
> +++ /dev/null
> @@ -1,4 +0,0 @@
> -require optee-examples.inc
> -
> -SRCREV = "9a7dc598591990349d88b4dba3a37aadd6851295"
> -
> diff --git a/meta-arm/recipes-security/optee/optee-examples_3.14.0.bb b/meta-arm/recipes-security/optee/optee-examples_3.14.0.bb
> new file mode 100644
> index 0000000..f2b5f7d
> --- /dev/null
> +++ b/meta-arm/recipes-security/optee/optee-examples_3.14.0.bb
> @@ -0,0 +1,4 @@
> +require optee-examples.inc
> +
> +SRCREV = "e9c870525af8f7e7fccf575a0ca5394ce55adcec"
> +
> diff --git a/meta-arm/recipes-security/optee/optee-os/0001-libutils-provide-empty-__getauxval-implementation.patch b/meta-arm/recipes-security/optee/optee-os/0001-libutils-provide-empty-__getauxval-implementation.patch
> deleted file mode 100644
> index 0120f5c..0000000
> --- a/meta-arm/recipes-security/optee/optee-os/0001-libutils-provide-empty-__getauxval-implementation.patch
> +++ /dev/null
> @@ -1,62 +0,0 @@
> -Upstream-Status: Backport
> -Signed-off-by: Ross Burton <ross.burton@arm.com>
> -
> -From 36e784f621bf5d5be9183beba35f39426277c110 Mon Sep 17 00:00:00 2001
> -From: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
> -Date: Tue, 13 Oct 2020 22:45:39 +0300
> -Subject: [PATCH 1/3] libutils: provide empty __getauxval() implementation
> -
> -Never version of libgcc are built with LSE implementation in mind. To
> -determine if LSE is available on platform it calls __getauxval(), so in
> -some cases we can get undefined reference to __getauxval() error.
> -
> -Prominent case is libgcc_eh.a library, which is used by C++ TAs. Exception
> -handler depends on atomic operations, so it tries to call
> -init_have_lse_atomics() first. This function in turn calls __getauxval(),
> -which causes linking error.
> -
> -In the future we can make __getauxval() to return actual platform
> -capabilities.
> -
> -Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
> -Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
> -Reviewed-by: Jerome Forissier <jerome@forissier.org>
> ----
> - lib/libutils/ext/arch/arm/auxval.c | 12 ++++++++++++
> - lib/libutils/ext/arch/arm/sub.mk   |  1 +
> - 2 files changed, 13 insertions(+)
> - create mode 100644 lib/libutils/ext/arch/arm/auxval.c
> -
> -diff --git a/lib/libutils/ext/arch/arm/auxval.c b/lib/libutils/ext/arch/arm/auxval.c
> -new file mode 100644
> -index 00000000..98bca850
> ---- /dev/null
> -+++ b/lib/libutils/ext/arch/arm/auxval.c
> -@@ -0,0 +1,12 @@
> -+// SPDX-License-Identifier: BSD-2-Clause
> -+/*
> -+ * Copyright (c) 2020, EPAM Systems
> -+ */
> -+
> -+#include <compiler.h>
> -+
> -+unsigned long int __getauxval (unsigned long int type);
> -+unsigned long int __getauxval (unsigned long int type __unused)
> -+{
> -+	return 0;
> -+}
> -diff --git a/lib/libutils/ext/arch/arm/sub.mk b/lib/libutils/ext/arch/arm/sub.mk
> -index dc5eed67..2e779066 100644
> ---- a/lib/libutils/ext/arch/arm/sub.mk
> -+++ b/lib/libutils/ext/arch/arm/sub.mk
> -@@ -3,6 +3,7 @@ srcs-$(CFG_ARM32_$(sm)) += aeabi_unwind.c
> - endif
> - srcs-$(CFG_ARM32_$(sm)) += atomic_a32.S
> - srcs-$(CFG_ARM64_$(sm)) += atomic_a64.S
> -+srcs-y += auxval.c
> - ifneq ($(sm),ldelf) # TA, core
> - srcs-$(CFG_ARM32_$(sm)) += mcount_a32.S
> - srcs-$(CFG_ARM64_$(sm)) += mcount_a64.S
> --- 
> -2.25.1
> -
> diff --git a/meta-arm/recipes-security/optee/optee-os/0002-link.mk-implement-support-for-libnames-after-libgcc-.patch b/meta-arm/recipes-security/optee/optee-os/0002-link.mk-implement-support-for-libnames-after-libgcc-.patch
> deleted file mode 100644
> index 11296c8..0000000
> --- a/meta-arm/recipes-security/optee/optee-os/0002-link.mk-implement-support-for-libnames-after-libgcc-.patch
> +++ /dev/null
> @@ -1,55 +0,0 @@
> -Upstream-Status: Backport
> -Signed-off-by: Ross Burton <ross.burton@arm.com>
> -
> -From 73196b58ea6978ffa5e581738030f51c5789ef73 Mon Sep 17 00:00:00 2001
> -From: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
> -Date: Tue, 13 Oct 2020 22:54:13 +0300
> -Subject: [PATCH 2/3] link.mk: implement support for libnames-after-libgcc
> - variable
> -
> -Newer versions of libgcc depend on external __getauxval() symbol, which is
> -now provided by libutils. But libgcc is linked after libutils, so linker
> -can't resolve that symbol. We can't include libgcc into linking group with
> -libtutils, because libgcc provides symbols that conflict with libutil's
> -ones, like __aeabi_idiv with friends for instance.
> -
> -So, to resolve libgcc dependency on libutils we need to link with libutils
> -second time. To make things more generic, we will introduce
> -$(libnames-after-libgcc) variable for libraries that should be linked after
> -libgcc.
> -
> -Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
> -Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
> -Reviewed-by: Jerome Forissier <jerome@forissier.org>
> ----
> - ta/arch/arm/link.mk | 6 +++++-
> - 1 file changed, 5 insertions(+), 1 deletion(-)
> -
> -diff --git a/ta/arch/arm/link.mk b/ta/arch/arm/link.mk
> -index 445c285d..3025acb1 100644
> ---- a/ta/arch/arm/link.mk
> -+++ b/ta/arch/arm/link.mk
> -@@ -55,8 +55,11 @@ link-ldflags += --eh-frame-hdr
> - link-ldadd += $(libstdc++$(sm)) $(libgcc_eh$(sm))
> - endif
> - link-ldadd += --end-group
> --ldargs-$(user-ta-uuid).elf := $(link-ldflags) $(objs) $(link-ldadd) $(libgcc$(sm))
> - 
> -+link-ldadd-after-libgcc += $(addprefix -l,$(libnames-after-libgcc))
> -+
> -+ldargs-$(user-ta-uuid).elf := $(link-ldflags) $(objs) $(link-ldadd) \
> -+				$(libgcc$(sm)) $(link-ldadd-after-libgcc)
> - 
> - link-script-cppflags-$(sm) := \
> - 	$(filter-out $(CPPFLAGS_REMOVE) $(cppflags-remove), \
> -@@ -76,6 +79,7 @@ $(link-script-pp$(sm)): $(link-script$(sm)) $(conf-file) $(link-script-pp-makefi
> - 		$(link-script-cppflags-$(sm)) $$< -o $$@
> - 
> - $(link-out-dir$(sm))/$(user-ta-uuid).elf: $(objs) $(libdeps) \
> -+					  $(libdeps-after-libgcc) \
> - 					  $(link-script-pp$(sm)) \
> - 					  $(dynlistdep) \
> - 					  $(additional-link-deps)
> --- 
> -2.25.1
> -
> diff --git a/meta-arm/recipes-security/optee/optee-os/0003-ta_dev_kit.mk-make-sure-that-libutils-is-linked-seco.patch b/meta-arm/recipes-security/optee/optee-os/0003-ta_dev_kit.mk-make-sure-that-libutils-is-linked-seco.patch
> deleted file mode 100644
> index 88ba5f8..0000000
> --- a/meta-arm/recipes-security/optee/optee-os/0003-ta_dev_kit.mk-make-sure-that-libutils-is-linked-seco.patch
> +++ /dev/null
> @@ -1,44 +0,0 @@
> -Upstream-Status: Backport
> -Signed-off-by: Ross Burton <ross.burton@arm.com>
> -
> -From f50962e3f56f0932662b2ffa10afe53339a335dd Mon Sep 17 00:00:00 2001
> -From: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
> -Date: Fri, 16 Oct 2020 16:36:08 +0300
> -Subject: [PATCH 3/3] ta_dev_kit.mk: make sure that libutils is linked second
> - time
> -
> -libgcc depends on __getauxval symbol from libuils. As, generally libutils
> -is linked before libgcc, we will get "unresolved symbol" error. To resolve
> -this dependency we need to link libutils second time - after libgcc.
> -
> -Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
> -Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
> -Reviewed-by: Jerome Forissier <jerome@forissier.org>
> ----
> - ta/mk/ta_dev_kit.mk | 10 ++++++++++
> - 1 file changed, 10 insertions(+)
> -
> -diff --git a/ta/mk/ta_dev_kit.mk b/ta/mk/ta_dev_kit.mk
> -index e28be677..d0e66317 100644
> ---- a/ta/mk/ta_dev_kit.mk
> -+++ b/ta/mk/ta_dev_kit.mk
> -@@ -78,6 +78,16 @@ endif
> - libnames += dl
> - libdeps += $(ta-dev-kit-dir$(sm))/lib/libdl.a
> - 
> -+# libutils provides __getauxval symbol which is needed by libgcc 10.x. We can't
> -+# link libutils after libgcc, because libgcc will replace some symbols provided
> -+# by libutils, which will cause further linking issues.
> -+#
> -+# But if we place libutils before libgcc, linker will not be able to resolve
> -+# __getauxval. So we need to link with libutils twice: before and after libgcc.
> -+# Hence it included both in $(libnames) and in $(libnames-after-libgcc)
> -+libnames-after-libgcc += utils
> -+libdeps-after-libgcc += $(ta-dev-kit-dir$(sm))/lib/libutils.a
> -+
> - # Pass config variable (CFG_) from conf.mk on the command line
> - cppflags$(sm) += $(strip \
> - 	$(foreach var, $(filter CFG_%,$(.VARIABLES)), \
> --- 
> -2.25.1
> -
> diff --git a/meta-arm/recipes-security/optee/optee-os_3.11.0.bb b/meta-arm/recipes-security/optee/optee-os_3.11.0.bb
> deleted file mode 100644
> index 13b3dc6..0000000
> --- a/meta-arm/recipes-security/optee/optee-os_3.11.0.bb
> +++ /dev/null
> @@ -1,11 +0,0 @@
> -require optee-os.inc
> -
> -SRCREV = "c4def2a8262a03244d9a88461699b9b8e43c6b55"
> -
> -SRC_URI_append = " \
> -    file://0006-allow-setting-sysroot-for-libgcc-lookup.patch \
> -    file://0007-allow-setting-sysroot-for-clang.patch \
> -    file://0001-libutils-provide-empty-__getauxval-implementation.patch \
> -    file://0002-link.mk-implement-support-for-libnames-after-libgcc-.patch \
> -    file://0003-ta_dev_kit.mk-make-sure-that-libutils-is-linked-seco.patch \
> -"
> diff --git a/meta-arm/recipes-security/optee/optee-os_3.14.0.bb b/meta-arm/recipes-security/optee/optee-os_3.14.0.bb
> new file mode 100644
> index 0000000..3289e2c
> --- /dev/null
> +++ b/meta-arm/recipes-security/optee/optee-os_3.14.0.bb
> @@ -0,0 +1,8 @@
> +require optee-os.inc
> +
> +SRCREV = "d21befa5e53eae9db469eba1685f5aa5c6f92c2f"
> +
> +SRC_URI_append = " \
> +    file://0006-allow-setting-sysroot-for-libgcc-lookup.patch \
> +    file://0007-allow-setting-sysroot-for-clang.patch \
> +"
> diff --git a/meta-arm/recipes-security/optee/optee-test.inc b/meta-arm/recipes-security/optee/optee-test.inc
> index f09b9d2..bcbcc06 100644
> --- a/meta-arm/recipes-security/optee/optee-test.inc
> +++ b/meta-arm/recipes-security/optee/optee-test.inc
> @@ -8,17 +8,9 @@ LIC_FILES_CHKSUM = "file://${S}/LICENSE.md;md5=daa2bcccc666345ab8940aab1315a4fa"
>  inherit python3native ptest
>  require optee.inc
>  
> -# Linking fails on musl due to C++/threads
> -# https://github.com/OP-TEE/optee_test/issues/458#issuecomment-720540834
> -# When upgraded we should be able to remove this limitation
> -COMPATIBLE_HOST_libc-musl = 'null'
> -
>  DEPENDS = "optee-client optee-os python3-pycryptodome-native"
>  
>  SRC_URI = "git://github.com/OP-TEE/optee_test.git \
> -           file://0001-host-xtest-Adjust-order-of-including-compiler.h.patch \
> -           file://0002-make-remove-Wno-unsafe-loop-for-clang.patch \ 
> -           file://0003-make-remove-Wmissing-noreturn-for-clang.patch \
>             file://run-ptest \
>            "
>  
> @@ -36,6 +28,7 @@ do_compile() {
>      # Top level makefile doesn't seem to handle parallel make gracefully
>      oe_runmake xtest
>      oe_runmake ta
> +    oe_runmake test_plugin
>  }
>  do_compile[cleandirs] = "${B}"
>  
> @@ -46,9 +39,13 @@ do_install () {
>      # default TEEC_LOAD_PATH is /lib
>      mkdir -p ${D}${nonarch_base_libdir}/optee_armtz/
>      install -D -p -m0444 ${B}/ta/*/*.ta ${D}${nonarch_base_libdir}/optee_armtz/
> +    mkdir -p ${D}${libdir}/tee-supplicant/plugins
> +    install -D -p -m0444 ${B}/supp_plugin/*.plugin ${D}${libdir}/tee-supplicant/plugins/
>  }
>  
> -FILES_${PN} += "${nonarch_base_libdir}/optee_armtz/"
> +FILES_${PN} += "${nonarch_base_libdir}/optee_armtz/ \
> +                ${libdir}/tee-supplicant/plugins/ \
> +               "
>  
>  # Imports machine specific configs from staging to build
>  PACKAGE_ARCH = "${MACHINE_ARCH}"
> diff --git a/meta-arm/recipes-security/optee/optee-test/0001-host-xtest-Adjust-order-of-including-compiler.h.patch b/meta-arm/recipes-security/optee/optee-test/0001-host-xtest-Adjust-order-of-including-compiler.h.patch
> deleted file mode 100644
> index 3c500d7..0000000
> --- a/meta-arm/recipes-security/optee/optee-test/0001-host-xtest-Adjust-order-of-including-compiler.h.patch
> +++ /dev/null
> @@ -1,64 +0,0 @@
> -From fc95b3ccbbfd336797ae2cfd6dd4dc58644e146f Mon Sep 17 00:00:00 2001
> -From: Khem Raj <raj.khem@gmail.com>
> -Date: Sat, 30 May 2020 17:52:18 -0700
> -Subject: [PATCH] host/xtest: Adjust order of including compiler.h
> -
> -compiler.h defines some defines which violate libc namespace e.g.
> -__unused, this works ok with glibc but fails in awkward ways with musl
> -the reason is musl uses __unused in its internal structures and this
> -define in compiler.h conflicts with system headers causing errors like
> -
> -recipe-sysroot/usr/include/bits/stat.h:17:19: error: expected identifier or '(' before '[' token unsigned __unused[2];
> -                   ^
> -including compiler.h afer sys/stat.h fixes the problem.
> -
> -Upstream-Status: Pending [https://github.com/OP-TEE/optee_test/issues/453]
> -Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ----
> - host/xtest/install_ta.c | 2 +-
> - host/xtest/stats.c      | 2 +-
> - 2 files changed, 2 insertions(+), 2 deletions(-)
> -
> -diff --git a/host/xtest/install_ta.c b/host/xtest/install_ta.c
> -index 09a4c6d..6f7bb5c 100644
> ---- a/host/xtest/install_ta.c
> -+++ b/host/xtest/install_ta.c
> -@@ -4,7 +4,6 @@
> -  * SPDX-License-Identifier: BSD-2-Clause
> -  */
> - 
> --#include <compiler.h>
> - #include <dirent.h>
> - #include <err.h>
> - #include <errno.h>
> -@@ -20,6 +19,7 @@
> - #include <sys/types.h>
> - #include <tee_client_api.h>
> - #include <unistd.h>
> -+#include <compiler.h>
> - 
> - #include "install_ta.h"
> - #include "xtest_helpers.h"
> -diff --git a/host/xtest/stats.c b/host/xtest/stats.c
> -index 96b0b5f..db9bf25 100644
> ---- a/host/xtest/stats.c
> -+++ b/host/xtest/stats.c
> -@@ -3,7 +3,6 @@
> -  * Copyright (c) 2019, Linaro Limited
> -  */
> - 
> --#include <compiler.h>
> - #include <dirent.h>
> - #include <err.h>
> - #include <errno.h>
> -@@ -18,6 +17,7 @@
> - #include <sys/types.h>
> - #include <tee_client_api.h>
> - #include <unistd.h>
> -+#include <compiler.h>
> - #include "xtest_test.h"
> - #include "stats.h"
> - 
> --- 
> -2.26.2
> -
> diff --git a/meta-arm/recipes-security/optee/optee-test/0002-make-remove-Wno-unsafe-loop-for-clang.patch b/meta-arm/recipes-security/optee/optee-test/0002-make-remove-Wno-unsafe-loop-for-clang.patch
> deleted file mode 100644
> index 17dd7d8..0000000
> --- a/meta-arm/recipes-security/optee/optee-test/0002-make-remove-Wno-unsafe-loop-for-clang.patch
> +++ /dev/null
> @@ -1,31 +0,0 @@
> -From 438533ce9da1df0b7c7914e64b39ffdc1da1ab79 Mon Sep 17 00:00:00 2001
> -From: Brett Warren <brett.warran@arm.com>
> -Date: Thu, 8 Oct 2020 10:03:25 +0100
> -Subject: [PATCH] make: remove -Wmissing-noreturn for clang
> -
> -When compiling when clang, -Wmissing-noreturn causes an error because
> -of non-compliant code. This option is removed to workaround this.
> -
> -Upstream-Status: Pending [https://github.com/OP-TEE/optee_test/issues/452]
> -Changed-Id: 71cb511904547d790d1ea98f93bf8e5a6afcb36d
> -Signed-off-by: Brett Warren <brett.warren@arm.com>
> ----
> - host/xtest/Makefile | 2 +-
> - 1 file changed, 1 insertion(+), 1 deletion(-)
> -
> -diff --git a/host/xtest/Makefile b/host/xtest/Makefile
> -index 3c206b0..96746de 100644
> ---- a/host/xtest/Makefile
> -+++ b/host/xtest/Makefile
> -@@ -169,7 +169,7 @@ CFLAGS += -Wall -Wcast-align -Werror \
> - 	  -Werror-implicit-function-declaration -Wextra -Wfloat-equal \
> - 	  -Wformat-nonliteral -Wformat-security -Wformat=2 -Winit-self \
> - 	  -Wmissing-declarations -Wmissing-format-attribute \
> --	  -Wmissing-include-dirs -Wmissing-noreturn \
> -+	  -Wmissing-include-dirs \
> - 	  -Wmissing-prototypes -Wnested-externs -Wpointer-arith \
> - 	  -Wshadow -Wstrict-prototypes -Wswitch-default \
> - 	  -Wwrite-strings \
> --- 
> -2.17.1
> -
> diff --git a/meta-arm/recipes-security/optee/optee-test/0003-make-remove-Wmissing-noreturn-for-clang.patch b/meta-arm/recipes-security/optee/optee-test/0003-make-remove-Wmissing-noreturn-for-clang.patch
> deleted file mode 100644
> index bbc303f..0000000
> --- a/meta-arm/recipes-security/optee/optee-test/0003-make-remove-Wmissing-noreturn-for-clang.patch
> +++ /dev/null
> @@ -1,31 +0,0 @@
> -From ed5a9d9f7a3e9e14ca0e8aea59008124ee0e5f96 Mon Sep 17 00:00:00 2001
> -From: Brett Warren <brett.warren@arm.com>
> -Date: Thu, 8 Oct 2020 10:20:52 +0100
> -Subject: [PATCH] make: remove -Wno-unsafe-loop for clang
> -
> -When compiling with clang, the -Wno-unsafe-loop-optimizations option
> -throws an error because clang doesn't recognise it. This option is
> -removed to workaround this.
> -
> -Upstream-Status: Pending [https://github.com/OP-TEE/optee_test/issues/452]
> -Change-Id: 5fe0892c73208aaffac8c9995cb3275936fb1ba6
> -Signed-off-by: Brett Warren <brett.warren@arm.com>
> ----
> - host/xtest/Makefile | 1 -
> - 1 file changed, 1 deletion(-)
> -
> -diff --git a/host/xtest/Makefile b/host/xtest/Makefile
> -index 96746de..73731d0 100644
> ---- a/host/xtest/Makefile
> -+++ b/host/xtest/Makefile
> -@@ -174,7 +174,6 @@ CFLAGS += -Wall -Wcast-align -Werror \
> - 	  -Wshadow -Wstrict-prototypes -Wswitch-default \
> - 	  -Wwrite-strings \
> - 	  -Wno-declaration-after-statement \
> --	  -Wno-unsafe-loop-optimizations \
> - 	  -Wno-missing-field-initializers -Wno-format-zero-length
> - endif
> - 
> --- 
> -2.17.1
> -
> diff --git a/meta-arm/recipes-security/optee/optee-test_3.11.0.bb b/meta-arm/recipes-security/optee/optee-test_3.11.0.bb
> deleted file mode 100644
> index 0f8b5b0..0000000
> --- a/meta-arm/recipes-security/optee/optee-test_3.11.0.bb
> +++ /dev/null
> @@ -1,3 +0,0 @@
> -require optee-test.inc
> -
> -SRCREV = "159e295d5cc3ad2275ab15fe544620f6604d4ba4"
> diff --git a/meta-arm/recipes-security/optee/optee-test_3.14.0.bb b/meta-arm/recipes-security/optee/optee-test_3.14.0.bb
> new file mode 100644
> index 0000000..6367c27
> --- /dev/null
> +++ b/meta-arm/recipes-security/optee/optee-test_3.14.0.bb
> @@ -0,0 +1,3 @@
> +require optee-test.inc
> +
> +SRCREV = "f2eb88affbb7f028561b4fd5cbd049d5d704f741"
> -- 
> 2.25.1
> 

> 
> 
> 


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [meta-arm] [PATCH] arm/optee: version uplift 3.11.0 -> 3.14.0
  2021-07-20 14:42 ` [meta-arm] " Jon Mason
@ 2021-07-22  8:00   ` Sumit Garg
  2021-07-22  8:31     ` Arunachalam Ganapathy
  0 siblings, 1 reply; 11+ messages in thread
From: Sumit Garg @ 2021-07-22  8:00 UTC (permalink / raw)
  To: Jon Mason; +Cc: meta-arm, Jon Mason, Ross Burton, Arunachalam Ganapathy

+ TC0 platform maintainer in OP-TEE

Hi Jon,

On Tue, 20 Jul 2021 at 20:12, Jon Mason <jdmason@kudzu.us> wrote:
>
> On Tue, Jul 20, 2021 at 03:37:01PM +0530, Sumit Garg wrote:
> > Brief description of changes:
> > - Version uplift 3.11.0 -> 3.14.0.
> > - Removed OP-TEE patches that has already been accepted upstream.
> > - Added support for tee-supplicant plugin framework testing.
> >
> > Tested on qemuarm64_secureboot:
> > $ xtest -l 15
> > $ optee-examples_*
>
>
> Unfortunately, TC0 is using the 3.11 version.  So, it breaks when
> applying this patch.

The TC0 platform support was recently merged in OP-TEE upstream [1].
So I took the liberty to migrate corresponding recipes as well [2]
which is build tested only as I don't possess access to the platform
itself.

[1] https://github.com/OP-TEE/optee_os/pull/4736
[2] https://lists.yoctoproject.org/g/meta-arm/message/2091

> Can you rework this patch to keep the old
> version around?
>

With TC0 support for 3.14.0, I think we should be able to drop support
for the old version.

-Sumit

> Thanks,
> Jon
>
> >
> > Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
> > ---
> >  .../optee/optee-client_3.11.0.bb              |   3 -
> >  .../optee/optee-client_3.14.0.bb              |   3 +
> >  .../recipes-security/optee/optee-examples.inc |   9 +-
> >  .../0001-make-Pass-ldflags-during-link.patch  | 103 ------------------
> >  ...efault-cross-compiler-environment-se.patch |  84 ++++++++++++++
> >  ...nable-plugins-installation-in-rootfs.patch |  39 +++++++
> >  .../optee/optee-examples_3.11.0.bb            |   4 -
> >  .../optee/optee-examples_3.14.0.bb            |   4 +
> >  ...ide-empty-__getauxval-implementation.patch |  62 -----------
> >  ...t-support-for-libnames-after-libgcc-.patch |  55 ----------
> >  ...ke-sure-that-libutils-is-linked-seco.patch |  44 --------
> >  .../recipes-security/optee/optee-os_3.11.0.bb |  11 --
> >  .../recipes-security/optee/optee-os_3.14.0.bb |   8 ++
> >  .../recipes-security/optee/optee-test.inc     |  15 +--
> >  ...Adjust-order-of-including-compiler.h.patch |  64 -----------
> >  ...ake-remove-Wno-unsafe-loop-for-clang.patch |  31 ------
> >  ...e-remove-Wmissing-noreturn-for-clang.patch |  31 ------
> >  .../optee/optee-test_3.11.0.bb                |   3 -
> >  .../optee/optee-test_3.14.0.bb                |   3 +
> >  19 files changed, 154 insertions(+), 422 deletions(-)
> >  delete mode 100644 meta-arm/recipes-security/optee/optee-client_3.11.0.bb
> >  create mode 100644 meta-arm/recipes-security/optee/optee-client_3.14.0.bb
> >  delete mode 100644 meta-arm/recipes-security/optee/optee-examples/0001-make-Pass-ldflags-during-link.patch
> >  create mode 100644 meta-arm/recipes-security/optee/optee-examples/0001-plugins-Honour-default-cross-compiler-environment-se.patch
> >  create mode 100644 meta-arm/recipes-security/optee/optee-examples/0002-Makefile-Enable-plugins-installation-in-rootfs.patch
> >  delete mode 100644 meta-arm/recipes-security/optee/optee-examples_3.11.0.bb
> >  create mode 100644 meta-arm/recipes-security/optee/optee-examples_3.14.0.bb
> >  delete mode 100644 meta-arm/recipes-security/optee/optee-os/0001-libutils-provide-empty-__getauxval-implementation.patch
> >  delete mode 100644 meta-arm/recipes-security/optee/optee-os/0002-link.mk-implement-support-for-libnames-after-libgcc-.patch
> >  delete mode 100644 meta-arm/recipes-security/optee/optee-os/0003-ta_dev_kit.mk-make-sure-that-libutils-is-linked-seco.patch
> >  delete mode 100644 meta-arm/recipes-security/optee/optee-os_3.11.0.bb
> >  create mode 100644 meta-arm/recipes-security/optee/optee-os_3.14.0.bb
> >  delete mode 100644 meta-arm/recipes-security/optee/optee-test/0001-host-xtest-Adjust-order-of-including-compiler.h.patch
> >  delete mode 100644 meta-arm/recipes-security/optee/optee-test/0002-make-remove-Wno-unsafe-loop-for-clang.patch
> >  delete mode 100644 meta-arm/recipes-security/optee/optee-test/0003-make-remove-Wmissing-noreturn-for-clang.patch
> >  delete mode 100644 meta-arm/recipes-security/optee/optee-test_3.11.0.bb
> >  create mode 100644 meta-arm/recipes-security/optee/optee-test_3.14.0.bb
> >
> > diff --git a/meta-arm/recipes-security/optee/optee-client_3.11.0.bb b/meta-arm/recipes-security/optee/optee-client_3.11.0.bb
> > deleted file mode 100644
> > index f765d12..0000000
> > --- a/meta-arm/recipes-security/optee/optee-client_3.11.0.bb
> > +++ /dev/null
> > @@ -1,3 +0,0 @@
> > -require optee-client.inc
> > -
> > -SRCREV = "c0c925384c1d7e3558d27d2708857482952d7907"
> > diff --git a/meta-arm/recipes-security/optee/optee-client_3.14.0.bb b/meta-arm/recipes-security/optee/optee-client_3.14.0.bb
> > new file mode 100644
> > index 0000000..be78b88
> > --- /dev/null
> > +++ b/meta-arm/recipes-security/optee/optee-client_3.14.0.bb
> > @@ -0,0 +1,3 @@
> > +require optee-client.inc
> > +
> > +SRCREV = "06e1b32f6a7028e039c625b07cfc25fda0c17d53"
> > diff --git a/meta-arm/recipes-security/optee/optee-examples.inc b/meta-arm/recipes-security/optee/optee-examples.inc
> > index 81c31bc..f2e53f3 100644
> > --- a/meta-arm/recipes-security/optee/optee-examples.inc
> > +++ b/meta-arm/recipes-security/optee/optee-examples.inc
> > @@ -12,7 +12,8 @@ inherit python3native
> >  require optee.inc
> >
> >  SRC_URI = "git://github.com/linaro-swg/optee_examples.git \
> > -           file://0001-make-Pass-ldflags-during-link.patch \
> > +           file://0001-plugins-Honour-default-cross-compiler-environment-se.patch \
> > +           file://0002-Makefile-Enable-plugins-installation-in-rootfs.patch \
> >            "
> >
> >  EXTRA_OEMAKE += "TA_DEV_KIT_DIR=${TA_DEV_KIT_DIR} \
> > @@ -32,11 +33,15 @@ do_compile[cleandirs] = "${B}"
> >  do_install () {
> >      mkdir -p ${D}${nonarch_base_libdir}/optee_armtz
> >      mkdir -p ${D}${bindir}
> > +    mkdir -p ${D}${libdir}/tee-supplicant/plugins
> >      install -D -p -m0755 ${B}/ca/* ${D}${bindir}
> >      install -D -p -m0444 ${B}/ta/* ${D}${nonarch_base_libdir}/optee_armtz
> > +    install -D -p -m0444 ${B}/plugins/* ${D}${libdir}/tee-supplicant/plugins
> >  }
> >
> > -FILES_${PN} += "${nonarch_base_libdir}/optee_armtz/"
> > +FILES_${PN} += "${nonarch_base_libdir}/optee_armtz/ \
> > +                ${libdir}/tee-supplicant/plugins/ \
> > +               "
> >
> >  # Imports machine specific configs from staging to build
> >  PACKAGE_ARCH = "${MACHINE_ARCH}"
> > diff --git a/meta-arm/recipes-security/optee/optee-examples/0001-make-Pass-ldflags-during-link.patch b/meta-arm/recipes-security/optee/optee-examples/0001-make-Pass-ldflags-during-link.patch
> > deleted file mode 100644
> > index 84202ef..0000000
> > --- a/meta-arm/recipes-security/optee/optee-examples/0001-make-Pass-ldflags-during-link.patch
> > +++ /dev/null
> > @@ -1,103 +0,0 @@
> > -From 29ae21de41f2fbab6dbecbbf408826b28de82df1 Mon Sep 17 00:00:00 2001
> > -From: Khem Raj <raj.khem@gmail.com>
> > -Date: Tue, 1 Sep 2020 21:09:56 -0700
> > -Subject: [PATCH] make: Pass ldflags during link
> > -
> > -OpenEmbeeded needs to pass essential linker flags to set correct flags
> > -for gnu_hash among others which sets the linking straight
> > -using LDFLAGS varible here means, we can affect the linker flags
> > -from build environment
> > -
> > -Upstream-Status: Submitted [https://github.com/linaro-swg/optee_examples/pull/85]
> > -
> > -Signed-off-by: Khem Raj <raj.khem@gmail.com>
> > ----
> > - acipher/host/Makefile        | 2 +-
> > - aes/host/Makefile            | 2 +-
> > - hello_world/host/Makefile    | 2 +-
> > - hotp/host/Makefile           | 2 +-
> > - random/host/Makefile         | 2 +-
> > - secure_storage/host/Makefile | 2 +-
> > - 6 files changed, 6 insertions(+), 6 deletions(-)
> > -
> > -diff --git a/acipher/host/Makefile b/acipher/host/Makefile
> > -index 8f4bc8a..c2cabef 100644
> > ---- a/acipher/host/Makefile
> > -+++ b/acipher/host/Makefile
> > -@@ -18,7 +18,7 @@ BINARY = optee_example_acipher
> > - all: $(BINARY)
> > -
> > - $(BINARY): $(OBJS)
> > --    $(CC) -o $@ $< $(LDADD)
> > -+    $(CC) -o $@ $< $(LDFLAGS) $(LDADD)
> > -
> > - .PHONY: clean
> > - clean:
> > -diff --git a/aes/host/Makefile b/aes/host/Makefile
> > -index dfeb4e8..f61c71b 100644
> > ---- a/aes/host/Makefile
> > -+++ b/aes/host/Makefile
> > -@@ -18,7 +18,7 @@ BINARY = optee_example_aes
> > - all: $(BINARY)
> > -
> > - $(BINARY): $(OBJS)
> > --    $(CC) -o $@ $< $(LDADD)
> > -+    $(CC) -o $@ $< $(LDFLAGS) $(LDADD)
> > -
> > - .PHONY: clean
> > - clean:
> > -diff --git a/hello_world/host/Makefile b/hello_world/host/Makefile
> > -index c4c8239..69cf42c 100644
> > ---- a/hello_world/host/Makefile
> > -+++ b/hello_world/host/Makefile
> > -@@ -18,7 +18,7 @@ BINARY = optee_example_hello_world
> > - all: $(BINARY)
> > -
> > - $(BINARY): $(OBJS)
> > --    $(CC) -o $@ $< $(LDADD)
> > -+    $(CC) -o $@ $< $(LDFLAGS) $(LDADD)
> > -
> > - .PHONY: clean
> > - clean:
> > -diff --git a/hotp/host/Makefile b/hotp/host/Makefile
> > -index cb7fd19..e7f013f 100644
> > ---- a/hotp/host/Makefile
> > -+++ b/hotp/host/Makefile
> > -@@ -18,7 +18,7 @@ BINARY = optee_example_hotp
> > - all: $(BINARY)
> > -
> > - $(BINARY): $(OBJS)
> > --    $(CC) -o $@ $< $(LDADD)
> > -+    $(CC) -o $@ $< $(LDFLAGS) $(LDADD)
> > -
> > - .PHONY: clean
> > - clean:
> > -diff --git a/random/host/Makefile b/random/host/Makefile
> > -index fd407d9..9377f7a 100644
> > ---- a/random/host/Makefile
> > -+++ b/random/host/Makefile
> > -@@ -18,7 +18,7 @@ BINARY = optee_example_random
> > - all: $(BINARY)
> > -
> > - $(BINARY): $(OBJS)
> > --    $(CC) -o $@ $< $(LDADD)
> > -+    $(CC) -o $@ $< $(LDFLAGS) $(LDADD)
> > -
> > - .PHONY: clean
> > - clean:
> > -diff --git a/secure_storage/host/Makefile b/secure_storage/host/Makefile
> > -index 29bfb87..b3265ae 100644
> > ---- a/secure_storage/host/Makefile
> > -+++ b/secure_storage/host/Makefile
> > -@@ -18,7 +18,7 @@ BINARY = optee_example_secure_storage
> > - all: $(BINARY)
> > -
> > - $(BINARY): $(OBJS)
> > --    $(CC) -o $@ $< $(LDADD)
> > -+    $(CC) -o $@ $< $(LDFLAGS) $(LDADD)
> > -
> > - .PHONY: clean
> > - clean:
> > ---
> > -2.28.0
> > -
> > diff --git a/meta-arm/recipes-security/optee/optee-examples/0001-plugins-Honour-default-cross-compiler-environment-se.patch b/meta-arm/recipes-security/optee/optee-examples/0001-plugins-Honour-default-cross-compiler-environment-se.patch
> > new file mode 100644
> > index 0000000..033e48c
> > --- /dev/null
> > +++ b/meta-arm/recipes-security/optee/optee-examples/0001-plugins-Honour-default-cross-compiler-environment-se.patch
> > @@ -0,0 +1,84 @@
> > +From 79c826c249001700007a6dffe80c3d61ff4428ef Mon Sep 17 00:00:00 2001
> > +From: Sumit Garg <sumit.garg@linaro.org>
> > +Date: Tue, 20 Jul 2021 13:54:30 +0530
> > +Subject: [PATCH 1/2] plugins: Honour default cross compiler environment setup
> > +
> > +Honour default $(CC), $(CFLAGS) and $(LDFLAGS) variables. Without this
> > +plugins example fails to build for OE/Yocto.
> > +
> > +Upstream-Status: Submitted [https://github.com/linaro-swg/optee_examples/pull/87]
> > +
> > +Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
> > +---
> > + plugins/Makefile        |  2 +-
> > + plugins/host/Makefile   |  2 +-
> > + plugins/syslog/Makefile | 16 ++++++++++++----
> > + 3 files changed, 14 insertions(+), 6 deletions(-)
> > +
> > +diff --git a/plugins/Makefile b/plugins/Makefile
> > +index 2372b38..ea472b4 100644
> > +--- a/plugins/Makefile
> > ++++ b/plugins/Makefile
> > +@@ -8,7 +8,7 @@ TA_CROSS_COMPILE ?= $(CROSS_COMPILE)
> > + all:
> > +     $(MAKE) -C host CROSS_COMPILE="$(HOST_CROSS_COMPILE)" --no-builtin-variables
> > +     $(MAKE) -C ta CROSS_COMPILE="$(TA_CROSS_COMPILE)" LDFLAGS=""
> > +-    $(MAKE) -C syslog CROSS_COMPILE="$(HOST_CROSS_COMPILE)"
> > ++    $(MAKE) -C syslog CROSS_COMPILE="$(HOST_CROSS_COMPILE)" --no-builtin-variables
> > +
> > + .PHONY: clean
> > + clean:
> > +diff --git a/plugins/host/Makefile b/plugins/host/Makefile
> > +index 7285104..76244c7 100644
> > +--- a/plugins/host/Makefile
> > ++++ b/plugins/host/Makefile
> > +@@ -20,7 +20,7 @@ BINARY = optee_example_plugins
> > + all: $(BINARY)
> > +
> > + $(BINARY): $(OBJS)
> > +-    $(CC) -o $@ $< $(LDADD)
> > ++    $(CC) $(LDFLAGS) -o $@ $< $(LDADD)
> > +
> > + .PHONY: clean
> > + clean:
> > +diff --git a/plugins/syslog/Makefile b/plugins/syslog/Makefile
> > +index 62d916a..71f5f92 100644
> > +--- a/plugins/syslog/Makefile
> > ++++ b/plugins/syslog/Makefile
> > +@@ -1,3 +1,11 @@
> > ++CC      ?= $(CROSS_COMPILE)gcc
> > ++LD      ?= $(CROSS_COMPILE)ld
> > ++AR      ?= $(CROSS_COMPILE)ar
> > ++NM      ?= $(CROSS_COMPILE)nm
> > ++OBJCOPY ?= $(CROSS_COMPILE)objcopy
> > ++OBJDUMP ?= $(CROSS_COMPILE)objdump
> > ++READELF ?= $(CROSS_COMPILE)readelf
> > ++
> > + PLUGIN_UUID = 96bcf744-4f72-4866-bf1d-8634fd9c65e5
> > +
> > + PLUGIN                      = $(PLUGIN_UUID).plugin
> > +@@ -6,17 +14,17 @@ PLUGIN_OBJ                = $(patsubst %.c, %.o, $(PLUGIN_SRS))
> > + PLUGIN_INCLUDES_DIR = $(CURDIR) $(TEEC_EXPORT)/include
> > +
> > + PLUGIN_INCLUDES             = $(addprefix -I, $(PLUGIN_INCLUDES_DIR))
> > +-PLUGIN_CCFLAGS              = -Wall -fPIC
> > +-PLUGIN_LDFLAGS              = -shared
> > ++PLUGIN_CCFLAGS              = $(CFLAGS) -Wall -fPIC
> > ++PLUGIN_LDFLAGS              = $(LDFLAGS) -shared
> > +
> > + .PHONY: all
> > + all: $(PLUGIN)
> > +
> > + $(PLUGIN): $(PLUGIN_OBJ)
> > +-    $(CROSS_COMPILE)gcc $(PLUGIN_LDFLAGS) $(PLUGIN_OBJ) -o $@
> > ++    $(CC) $(PLUGIN_LDFLAGS) $(PLUGIN_OBJ) -o $@
> > +
> > + %.o: %.c
> > +-    $(CROSS_COMPILE)gcc $(PLUGIN_CCFLAGS) $(PLUGIN_INCLUDES) -c $*.c -o $*.o
> > ++    $(CC) $(PLUGIN_CCFLAGS) $(PLUGIN_INCLUDES) -c $*.c -o $*.o
> > +
> > + .PHONY: clean
> > + clean:
> > +--
> > +2.25.1
> > +
> > diff --git a/meta-arm/recipes-security/optee/optee-examples/0002-Makefile-Enable-plugins-installation-in-rootfs.patch b/meta-arm/recipes-security/optee/optee-examples/0002-Makefile-Enable-plugins-installation-in-rootfs.patch
> > new file mode 100644
> > index 0000000..8d1d60a
> > --- /dev/null
> > +++ b/meta-arm/recipes-security/optee/optee-examples/0002-Makefile-Enable-plugins-installation-in-rootfs.patch
> > @@ -0,0 +1,39 @@
> > +From a865f2e25e178fc2c4617eb1faf79ac922d02ffd Mon Sep 17 00:00:00 2001
> > +From: Sumit Garg <sumit.garg@linaro.org>
> > +Date: Tue, 20 Jul 2021 14:20:10 +0530
> > +Subject: [PATCH 2/2] Makefile: Enable plugins installation in rootfs
> > +
> > +Upstream-Status: Submitted [https://github.com/linaro-swg/optee_examples/pull/87]
> > +
> > +Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
> > +---
> > + Makefile | 5 +++++
> > + 1 file changed, 5 insertions(+)
> > +
> > +diff --git a/Makefile b/Makefile
> > +index a275842..b3f16aa 100644
> > +--- a/Makefile
> > ++++ b/Makefile
> > +@@ -25,14 +25,19 @@ prepare-for-rootfs: examples
> > +     @mkdir -p $(OUTPUT_DIR)
> > +     @mkdir -p $(OUTPUT_DIR)/ta
> > +     @mkdir -p $(OUTPUT_DIR)/ca
> > ++    @mkdir -p $(OUTPUT_DIR)/plugins
> > +     @for example in $(EXAMPLE_LIST); do \
> > +             if [ -e $$example/host/optee_example_$$example ]; then \
> > +                     cp -p $$example/host/optee_example_$$example $(OUTPUT_DIR)/ca/; \
> > +             fi; \
> > +             cp -pr $$example/ta/*.ta $(OUTPUT_DIR)/ta/; \
> > ++            if [ $$example == plugins ]; then \
> > ++                    cp -p plugins/syslog/*.plugin $(OUTPUT_DIR)/plugins/; \
> > ++            fi; \
> > +     done
> > +
> > + prepare-for-rootfs-clean:
> > +     @rm -rf $(OUTPUT_DIR)/ta
> > +     @rm -rf $(OUTPUT_DIR)/ca
> > ++    @rm -rf $(OUTPUT_DIR)/plugins
> > +     @rmdir --ignore-fail-on-non-empty $(OUTPUT_DIR) || test ! -e $(OUTPUT_DIR)
> > +--
> > +2.25.1
> > +
> > diff --git a/meta-arm/recipes-security/optee/optee-examples_3.11.0.bb b/meta-arm/recipes-security/optee/optee-examples_3.11.0.bb
> > deleted file mode 100644
> > index 72473ed..0000000
> > --- a/meta-arm/recipes-security/optee/optee-examples_3.11.0.bb
> > +++ /dev/null
> > @@ -1,4 +0,0 @@
> > -require optee-examples.inc
> > -
> > -SRCREV = "9a7dc598591990349d88b4dba3a37aadd6851295"
> > -
> > diff --git a/meta-arm/recipes-security/optee/optee-examples_3.14.0.bb b/meta-arm/recipes-security/optee/optee-examples_3.14.0.bb
> > new file mode 100644
> > index 0000000..f2b5f7d
> > --- /dev/null
> > +++ b/meta-arm/recipes-security/optee/optee-examples_3.14.0.bb
> > @@ -0,0 +1,4 @@
> > +require optee-examples.inc
> > +
> > +SRCREV = "e9c870525af8f7e7fccf575a0ca5394ce55adcec"
> > +
> > diff --git a/meta-arm/recipes-security/optee/optee-os/0001-libutils-provide-empty-__getauxval-implementation.patch b/meta-arm/recipes-security/optee/optee-os/0001-libutils-provide-empty-__getauxval-implementation.patch
> > deleted file mode 100644
> > index 0120f5c..0000000
> > --- a/meta-arm/recipes-security/optee/optee-os/0001-libutils-provide-empty-__getauxval-implementation.patch
> > +++ /dev/null
> > @@ -1,62 +0,0 @@
> > -Upstream-Status: Backport
> > -Signed-off-by: Ross Burton <ross.burton@arm.com>
> > -
> > -From 36e784f621bf5d5be9183beba35f39426277c110 Mon Sep 17 00:00:00 2001
> > -From: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
> > -Date: Tue, 13 Oct 2020 22:45:39 +0300
> > -Subject: [PATCH 1/3] libutils: provide empty __getauxval() implementation
> > -
> > -Never version of libgcc are built with LSE implementation in mind. To
> > -determine if LSE is available on platform it calls __getauxval(), so in
> > -some cases we can get undefined reference to __getauxval() error.
> > -
> > -Prominent case is libgcc_eh.a library, which is used by C++ TAs. Exception
> > -handler depends on atomic operations, so it tries to call
> > -init_have_lse_atomics() first. This function in turn calls __getauxval(),
> > -which causes linking error.
> > -
> > -In the future we can make __getauxval() to return actual platform
> > -capabilities.
> > -
> > -Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
> > -Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
> > -Reviewed-by: Jerome Forissier <jerome@forissier.org>
> > ----
> > - lib/libutils/ext/arch/arm/auxval.c | 12 ++++++++++++
> > - lib/libutils/ext/arch/arm/sub.mk   |  1 +
> > - 2 files changed, 13 insertions(+)
> > - create mode 100644 lib/libutils/ext/arch/arm/auxval.c
> > -
> > -diff --git a/lib/libutils/ext/arch/arm/auxval.c b/lib/libutils/ext/arch/arm/auxval.c
> > -new file mode 100644
> > -index 00000000..98bca850
> > ---- /dev/null
> > -+++ b/lib/libutils/ext/arch/arm/auxval.c
> > -@@ -0,0 +1,12 @@
> > -+// SPDX-License-Identifier: BSD-2-Clause
> > -+/*
> > -+ * Copyright (c) 2020, EPAM Systems
> > -+ */
> > -+
> > -+#include <compiler.h>
> > -+
> > -+unsigned long int __getauxval (unsigned long int type);
> > -+unsigned long int __getauxval (unsigned long int type __unused)
> > -+{
> > -+    return 0;
> > -+}
> > -diff --git a/lib/libutils/ext/arch/arm/sub.mk b/lib/libutils/ext/arch/arm/sub.mk
> > -index dc5eed67..2e779066 100644
> > ---- a/lib/libutils/ext/arch/arm/sub.mk
> > -+++ b/lib/libutils/ext/arch/arm/sub.mk
> > -@@ -3,6 +3,7 @@ srcs-$(CFG_ARM32_$(sm)) += aeabi_unwind.c
> > - endif
> > - srcs-$(CFG_ARM32_$(sm)) += atomic_a32.S
> > - srcs-$(CFG_ARM64_$(sm)) += atomic_a64.S
> > -+srcs-y += auxval.c
> > - ifneq ($(sm),ldelf) # TA, core
> > - srcs-$(CFG_ARM32_$(sm)) += mcount_a32.S
> > - srcs-$(CFG_ARM64_$(sm)) += mcount_a64.S
> > ---
> > -2.25.1
> > -
> > diff --git a/meta-arm/recipes-security/optee/optee-os/0002-link.mk-implement-support-for-libnames-after-libgcc-.patch b/meta-arm/recipes-security/optee/optee-os/0002-link.mk-implement-support-for-libnames-after-libgcc-.patch
> > deleted file mode 100644
> > index 11296c8..0000000
> > --- a/meta-arm/recipes-security/optee/optee-os/0002-link.mk-implement-support-for-libnames-after-libgcc-.patch
> > +++ /dev/null
> > @@ -1,55 +0,0 @@
> > -Upstream-Status: Backport
> > -Signed-off-by: Ross Burton <ross.burton@arm.com>
> > -
> > -From 73196b58ea6978ffa5e581738030f51c5789ef73 Mon Sep 17 00:00:00 2001
> > -From: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
> > -Date: Tue, 13 Oct 2020 22:54:13 +0300
> > -Subject: [PATCH 2/3] link.mk: implement support for libnames-after-libgcc
> > - variable
> > -
> > -Newer versions of libgcc depend on external __getauxval() symbol, which is
> > -now provided by libutils. But libgcc is linked after libutils, so linker
> > -can't resolve that symbol. We can't include libgcc into linking group with
> > -libtutils, because libgcc provides symbols that conflict with libutil's
> > -ones, like __aeabi_idiv with friends for instance.
> > -
> > -So, to resolve libgcc dependency on libutils we need to link with libutils
> > -second time. To make things more generic, we will introduce
> > -$(libnames-after-libgcc) variable for libraries that should be linked after
> > -libgcc.
> > -
> > -Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
> > -Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
> > -Reviewed-by: Jerome Forissier <jerome@forissier.org>
> > ----
> > - ta/arch/arm/link.mk | 6 +++++-
> > - 1 file changed, 5 insertions(+), 1 deletion(-)
> > -
> > -diff --git a/ta/arch/arm/link.mk b/ta/arch/arm/link.mk
> > -index 445c285d..3025acb1 100644
> > ---- a/ta/arch/arm/link.mk
> > -+++ b/ta/arch/arm/link.mk
> > -@@ -55,8 +55,11 @@ link-ldflags += --eh-frame-hdr
> > - link-ldadd += $(libstdc++$(sm)) $(libgcc_eh$(sm))
> > - endif
> > - link-ldadd += --end-group
> > --ldargs-$(user-ta-uuid).elf := $(link-ldflags) $(objs) $(link-ldadd) $(libgcc$(sm))
> > -
> > -+link-ldadd-after-libgcc += $(addprefix -l,$(libnames-after-libgcc))
> > -+
> > -+ldargs-$(user-ta-uuid).elf := $(link-ldflags) $(objs) $(link-ldadd) \
> > -+                            $(libgcc$(sm)) $(link-ldadd-after-libgcc)
> > -
> > - link-script-cppflags-$(sm) := \
> > -     $(filter-out $(CPPFLAGS_REMOVE) $(cppflags-remove), \
> > -@@ -76,6 +79,7 @@ $(link-script-pp$(sm)): $(link-script$(sm)) $(conf-file) $(link-script-pp-makefi
> > -             $(link-script-cppflags-$(sm)) $$< -o $$@
> > -
> > - $(link-out-dir$(sm))/$(user-ta-uuid).elf: $(objs) $(libdeps) \
> > -+                                      $(libdeps-after-libgcc) \
> > -                                       $(link-script-pp$(sm)) \
> > -                                       $(dynlistdep) \
> > -                                       $(additional-link-deps)
> > ---
> > -2.25.1
> > -
> > diff --git a/meta-arm/recipes-security/optee/optee-os/0003-ta_dev_kit.mk-make-sure-that-libutils-is-linked-seco.patch b/meta-arm/recipes-security/optee/optee-os/0003-ta_dev_kit.mk-make-sure-that-libutils-is-linked-seco.patch
> > deleted file mode 100644
> > index 88ba5f8..0000000
> > --- a/meta-arm/recipes-security/optee/optee-os/0003-ta_dev_kit.mk-make-sure-that-libutils-is-linked-seco.patch
> > +++ /dev/null
> > @@ -1,44 +0,0 @@
> > -Upstream-Status: Backport
> > -Signed-off-by: Ross Burton <ross.burton@arm.com>
> > -
> > -From f50962e3f56f0932662b2ffa10afe53339a335dd Mon Sep 17 00:00:00 2001
> > -From: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
> > -Date: Fri, 16 Oct 2020 16:36:08 +0300
> > -Subject: [PATCH 3/3] ta_dev_kit.mk: make sure that libutils is linked second
> > - time
> > -
> > -libgcc depends on __getauxval symbol from libuils. As, generally libutils
> > -is linked before libgcc, we will get "unresolved symbol" error. To resolve
> > -this dependency we need to link libutils second time - after libgcc.
> > -
> > -Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
> > -Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
> > -Reviewed-by: Jerome Forissier <jerome@forissier.org>
> > ----
> > - ta/mk/ta_dev_kit.mk | 10 ++++++++++
> > - 1 file changed, 10 insertions(+)
> > -
> > -diff --git a/ta/mk/ta_dev_kit.mk b/ta/mk/ta_dev_kit.mk
> > -index e28be677..d0e66317 100644
> > ---- a/ta/mk/ta_dev_kit.mk
> > -+++ b/ta/mk/ta_dev_kit.mk
> > -@@ -78,6 +78,16 @@ endif
> > - libnames += dl
> > - libdeps += $(ta-dev-kit-dir$(sm))/lib/libdl.a
> > -
> > -+# libutils provides __getauxval symbol which is needed by libgcc 10.x. We can't
> > -+# link libutils after libgcc, because libgcc will replace some symbols provided
> > -+# by libutils, which will cause further linking issues.
> > -+#
> > -+# But if we place libutils before libgcc, linker will not be able to resolve
> > -+# __getauxval. So we need to link with libutils twice: before and after libgcc.
> > -+# Hence it included both in $(libnames) and in $(libnames-after-libgcc)
> > -+libnames-after-libgcc += utils
> > -+libdeps-after-libgcc += $(ta-dev-kit-dir$(sm))/lib/libutils.a
> > -+
> > - # Pass config variable (CFG_) from conf.mk on the command line
> > - cppflags$(sm) += $(strip \
> > -     $(foreach var, $(filter CFG_%,$(.VARIABLES)), \
> > ---
> > -2.25.1
> > -
> > diff --git a/meta-arm/recipes-security/optee/optee-os_3.11.0.bb b/meta-arm/recipes-security/optee/optee-os_3.11.0.bb
> > deleted file mode 100644
> > index 13b3dc6..0000000
> > --- a/meta-arm/recipes-security/optee/optee-os_3.11.0.bb
> > +++ /dev/null
> > @@ -1,11 +0,0 @@
> > -require optee-os.inc
> > -
> > -SRCREV = "c4def2a8262a03244d9a88461699b9b8e43c6b55"
> > -
> > -SRC_URI_append = " \
> > -    file://0006-allow-setting-sysroot-for-libgcc-lookup.patch \
> > -    file://0007-allow-setting-sysroot-for-clang.patch \
> > -    file://0001-libutils-provide-empty-__getauxval-implementation.patch \
> > -    file://0002-link.mk-implement-support-for-libnames-after-libgcc-.patch \
> > -    file://0003-ta_dev_kit.mk-make-sure-that-libutils-is-linked-seco.patch \
> > -"
> > diff --git a/meta-arm/recipes-security/optee/optee-os_3.14.0.bb b/meta-arm/recipes-security/optee/optee-os_3.14.0.bb
> > new file mode 100644
> > index 0000000..3289e2c
> > --- /dev/null
> > +++ b/meta-arm/recipes-security/optee/optee-os_3.14.0.bb
> > @@ -0,0 +1,8 @@
> > +require optee-os.inc
> > +
> > +SRCREV = "d21befa5e53eae9db469eba1685f5aa5c6f92c2f"
> > +
> > +SRC_URI_append = " \
> > +    file://0006-allow-setting-sysroot-for-libgcc-lookup.patch \
> > +    file://0007-allow-setting-sysroot-for-clang.patch \
> > +"
> > diff --git a/meta-arm/recipes-security/optee/optee-test.inc b/meta-arm/recipes-security/optee/optee-test.inc
> > index f09b9d2..bcbcc06 100644
> > --- a/meta-arm/recipes-security/optee/optee-test.inc
> > +++ b/meta-arm/recipes-security/optee/optee-test.inc
> > @@ -8,17 +8,9 @@ LIC_FILES_CHKSUM = "file://${S}/LICENSE.md;md5=daa2bcccc666345ab8940aab1315a4fa"
> >  inherit python3native ptest
> >  require optee.inc
> >
> > -# Linking fails on musl due to C++/threads
> > -# https://github.com/OP-TEE/optee_test/issues/458#issuecomment-720540834
> > -# When upgraded we should be able to remove this limitation
> > -COMPATIBLE_HOST_libc-musl = 'null'
> > -
> >  DEPENDS = "optee-client optee-os python3-pycryptodome-native"
> >
> >  SRC_URI = "git://github.com/OP-TEE/optee_test.git \
> > -           file://0001-host-xtest-Adjust-order-of-including-compiler.h.patch \
> > -           file://0002-make-remove-Wno-unsafe-loop-for-clang.patch \
> > -           file://0003-make-remove-Wmissing-noreturn-for-clang.patch \
> >             file://run-ptest \
> >            "
> >
> > @@ -36,6 +28,7 @@ do_compile() {
> >      # Top level makefile doesn't seem to handle parallel make gracefully
> >      oe_runmake xtest
> >      oe_runmake ta
> > +    oe_runmake test_plugin
> >  }
> >  do_compile[cleandirs] = "${B}"
> >
> > @@ -46,9 +39,13 @@ do_install () {
> >      # default TEEC_LOAD_PATH is /lib
> >      mkdir -p ${D}${nonarch_base_libdir}/optee_armtz/
> >      install -D -p -m0444 ${B}/ta/*/*.ta ${D}${nonarch_base_libdir}/optee_armtz/
> > +    mkdir -p ${D}${libdir}/tee-supplicant/plugins
> > +    install -D -p -m0444 ${B}/supp_plugin/*.plugin ${D}${libdir}/tee-supplicant/plugins/
> >  }
> >
> > -FILES_${PN} += "${nonarch_base_libdir}/optee_armtz/"
> > +FILES_${PN} += "${nonarch_base_libdir}/optee_armtz/ \
> > +                ${libdir}/tee-supplicant/plugins/ \
> > +               "
> >
> >  # Imports machine specific configs from staging to build
> >  PACKAGE_ARCH = "${MACHINE_ARCH}"
> > diff --git a/meta-arm/recipes-security/optee/optee-test/0001-host-xtest-Adjust-order-of-including-compiler.h.patch b/meta-arm/recipes-security/optee/optee-test/0001-host-xtest-Adjust-order-of-including-compiler.h.patch
> > deleted file mode 100644
> > index 3c500d7..0000000
> > --- a/meta-arm/recipes-security/optee/optee-test/0001-host-xtest-Adjust-order-of-including-compiler.h.patch
> > +++ /dev/null
> > @@ -1,64 +0,0 @@
> > -From fc95b3ccbbfd336797ae2cfd6dd4dc58644e146f Mon Sep 17 00:00:00 2001
> > -From: Khem Raj <raj.khem@gmail.com>
> > -Date: Sat, 30 May 2020 17:52:18 -0700
> > -Subject: [PATCH] host/xtest: Adjust order of including compiler.h
> > -
> > -compiler.h defines some defines which violate libc namespace e.g.
> > -__unused, this works ok with glibc but fails in awkward ways with musl
> > -the reason is musl uses __unused in its internal structures and this
> > -define in compiler.h conflicts with system headers causing errors like
> > -
> > -recipe-sysroot/usr/include/bits/stat.h:17:19: error: expected identifier or '(' before '[' token unsigned __unused[2];
> > -                   ^
> > -including compiler.h afer sys/stat.h fixes the problem.
> > -
> > -Upstream-Status: Pending [https://github.com/OP-TEE/optee_test/issues/453]
> > -Signed-off-by: Khem Raj <raj.khem@gmail.com>
> > ----
> > - host/xtest/install_ta.c | 2 +-
> > - host/xtest/stats.c      | 2 +-
> > - 2 files changed, 2 insertions(+), 2 deletions(-)
> > -
> > -diff --git a/host/xtest/install_ta.c b/host/xtest/install_ta.c
> > -index 09a4c6d..6f7bb5c 100644
> > ---- a/host/xtest/install_ta.c
> > -+++ b/host/xtest/install_ta.c
> > -@@ -4,7 +4,6 @@
> > -  * SPDX-License-Identifier: BSD-2-Clause
> > -  */
> > -
> > --#include <compiler.h>
> > - #include <dirent.h>
> > - #include <err.h>
> > - #include <errno.h>
> > -@@ -20,6 +19,7 @@
> > - #include <sys/types.h>
> > - #include <tee_client_api.h>
> > - #include <unistd.h>
> > -+#include <compiler.h>
> > -
> > - #include "install_ta.h"
> > - #include "xtest_helpers.h"
> > -diff --git a/host/xtest/stats.c b/host/xtest/stats.c
> > -index 96b0b5f..db9bf25 100644
> > ---- a/host/xtest/stats.c
> > -+++ b/host/xtest/stats.c
> > -@@ -3,7 +3,6 @@
> > -  * Copyright (c) 2019, Linaro Limited
> > -  */
> > -
> > --#include <compiler.h>
> > - #include <dirent.h>
> > - #include <err.h>
> > - #include <errno.h>
> > -@@ -18,6 +17,7 @@
> > - #include <sys/types.h>
> > - #include <tee_client_api.h>
> > - #include <unistd.h>
> > -+#include <compiler.h>
> > - #include "xtest_test.h"
> > - #include "stats.h"
> > -
> > ---
> > -2.26.2
> > -
> > diff --git a/meta-arm/recipes-security/optee/optee-test/0002-make-remove-Wno-unsafe-loop-for-clang.patch b/meta-arm/recipes-security/optee/optee-test/0002-make-remove-Wno-unsafe-loop-for-clang.patch
> > deleted file mode 100644
> > index 17dd7d8..0000000
> > --- a/meta-arm/recipes-security/optee/optee-test/0002-make-remove-Wno-unsafe-loop-for-clang.patch
> > +++ /dev/null
> > @@ -1,31 +0,0 @@
> > -From 438533ce9da1df0b7c7914e64b39ffdc1da1ab79 Mon Sep 17 00:00:00 2001
> > -From: Brett Warren <brett.warran@arm.com>
> > -Date: Thu, 8 Oct 2020 10:03:25 +0100
> > -Subject: [PATCH] make: remove -Wmissing-noreturn for clang
> > -
> > -When compiling when clang, -Wmissing-noreturn causes an error because
> > -of non-compliant code. This option is removed to workaround this.
> > -
> > -Upstream-Status: Pending [https://github.com/OP-TEE/optee_test/issues/452]
> > -Changed-Id: 71cb511904547d790d1ea98f93bf8e5a6afcb36d
> > -Signed-off-by: Brett Warren <brett.warren@arm.com>
> > ----
> > - host/xtest/Makefile | 2 +-
> > - 1 file changed, 1 insertion(+), 1 deletion(-)
> > -
> > -diff --git a/host/xtest/Makefile b/host/xtest/Makefile
> > -index 3c206b0..96746de 100644
> > ---- a/host/xtest/Makefile
> > -+++ b/host/xtest/Makefile
> > -@@ -169,7 +169,7 @@ CFLAGS += -Wall -Wcast-align -Werror \
> > -       -Werror-implicit-function-declaration -Wextra -Wfloat-equal \
> > -       -Wformat-nonliteral -Wformat-security -Wformat=2 -Winit-self \
> > -       -Wmissing-declarations -Wmissing-format-attribute \
> > --      -Wmissing-include-dirs -Wmissing-noreturn \
> > -+      -Wmissing-include-dirs \
> > -       -Wmissing-prototypes -Wnested-externs -Wpointer-arith \
> > -       -Wshadow -Wstrict-prototypes -Wswitch-default \
> > -       -Wwrite-strings \
> > ---
> > -2.17.1
> > -
> > diff --git a/meta-arm/recipes-security/optee/optee-test/0003-make-remove-Wmissing-noreturn-for-clang.patch b/meta-arm/recipes-security/optee/optee-test/0003-make-remove-Wmissing-noreturn-for-clang.patch
> > deleted file mode 100644
> > index bbc303f..0000000
> > --- a/meta-arm/recipes-security/optee/optee-test/0003-make-remove-Wmissing-noreturn-for-clang.patch
> > +++ /dev/null
> > @@ -1,31 +0,0 @@
> > -From ed5a9d9f7a3e9e14ca0e8aea59008124ee0e5f96 Mon Sep 17 00:00:00 2001
> > -From: Brett Warren <brett.warren@arm.com>
> > -Date: Thu, 8 Oct 2020 10:20:52 +0100
> > -Subject: [PATCH] make: remove -Wno-unsafe-loop for clang
> > -
> > -When compiling with clang, the -Wno-unsafe-loop-optimizations option
> > -throws an error because clang doesn't recognise it. This option is
> > -removed to workaround this.
> > -
> > -Upstream-Status: Pending [https://github.com/OP-TEE/optee_test/issues/452]
> > -Change-Id: 5fe0892c73208aaffac8c9995cb3275936fb1ba6
> > -Signed-off-by: Brett Warren <brett.warren@arm.com>
> > ----
> > - host/xtest/Makefile | 1 -
> > - 1 file changed, 1 deletion(-)
> > -
> > -diff --git a/host/xtest/Makefile b/host/xtest/Makefile
> > -index 96746de..73731d0 100644
> > ---- a/host/xtest/Makefile
> > -+++ b/host/xtest/Makefile
> > -@@ -174,7 +174,6 @@ CFLAGS += -Wall -Wcast-align -Werror \
> > -       -Wshadow -Wstrict-prototypes -Wswitch-default \
> > -       -Wwrite-strings \
> > -       -Wno-declaration-after-statement \
> > --      -Wno-unsafe-loop-optimizations \
> > -       -Wno-missing-field-initializers -Wno-format-zero-length
> > - endif
> > -
> > ---
> > -2.17.1
> > -
> > diff --git a/meta-arm/recipes-security/optee/optee-test_3.11.0.bb b/meta-arm/recipes-security/optee/optee-test_3.11.0.bb
> > deleted file mode 100644
> > index 0f8b5b0..0000000
> > --- a/meta-arm/recipes-security/optee/optee-test_3.11.0.bb
> > +++ /dev/null
> > @@ -1,3 +0,0 @@
> > -require optee-test.inc
> > -
> > -SRCREV = "159e295d5cc3ad2275ab15fe544620f6604d4ba4"
> > diff --git a/meta-arm/recipes-security/optee/optee-test_3.14.0.bb b/meta-arm/recipes-security/optee/optee-test_3.14.0.bb
> > new file mode 100644
> > index 0000000..6367c27
> > --- /dev/null
> > +++ b/meta-arm/recipes-security/optee/optee-test_3.14.0.bb
> > @@ -0,0 +1,3 @@
> > +require optee-test.inc
> > +
> > +SRCREV = "f2eb88affbb7f028561b4fd5cbd049d5d704f741"
> > --
> > 2.25.1
> >
>
> >
> > 
> >
>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [meta-arm] [PATCH] arm/optee: version uplift 3.11.0 -> 3.14.0
  2021-07-22  8:00   ` Sumit Garg
@ 2021-07-22  8:31     ` Arunachalam Ganapathy
  0 siblings, 0 replies; 11+ messages in thread
From: Arunachalam Ganapathy @ 2021-07-22  8:31 UTC (permalink / raw)
  To: Sumit Garg, Jon Mason; +Cc: meta-arm, Jon Mason, Ross Burton

Hi Sumit,

Thanks for the arm/optee upgrade to 3.14.0. I have used that base recipes and upgraded optee to 3.14.0 for TC0 platform and it works fine. The patches for TC0 OP-TEE upgrade are in internal review.

Jon / Ross,

Post internal review, I will send out the patches to mailing list, can you please merge arm/optee upgrade and TC0 OP-TEE upgrade together.

Thanks,
Arun

-----Original Message-----
From: Sumit Garg <sumit.garg@linaro.org>
Sent: Thursday, July 22, 2021 09:00
To: Jon Mason <jdmason@kudzu.us>
Cc: meta-arm@lists.yoctoproject.org <meta-arm@lists.yoctoproject.org>; Jon Mason <Jon.Mason@arm.com>; Ross Burton <Ross.Burton@arm.com>; Arunachalam Ganapathy <Arunachalam.Ganapathy@arm.com>
Subject: Re: [meta-arm] [PATCH] arm/optee: version uplift 3.11.0 -> 3.14.0 
 
+ TC0 platform maintainer in OP-TEE

Hi Jon,

On Tue, 20 Jul 2021 at 20:12, Jon Mason <jdmason@kudzu.us> wrote:
>
> On Tue, Jul 20, 2021 at 03:37:01PM +0530, Sumit Garg wrote:
> > Brief description of changes:
> > - Version uplift 3.11.0 -> 3.14.0.
> > - Removed OP-TEE patches that has already been accepted upstream.
> > - Added support for tee-supplicant plugin framework testing.
> >
> > Tested on qemuarm64_secureboot:
> > $ xtest -l 15
> > $ optee-examples_*
>
>
> Unfortunately, TC0 is using the 3.11 version.  So, it breaks when
> applying this patch.

The TC0 platform support was recently merged in OP-TEE upstream [1].
So I took the liberty to migrate corresponding recipes as well [2]
which is build tested only as I don't possess access to the platform
itself.

[1] https://github.com/OP-TEE/optee_os/pull/4736
[2] https://lists.yoctoproject.org/g/meta-arm/message/2091

> Can you rework this patch to keep the old
> version around?
>

With TC0 support for 3.14.0, I think we should be able to drop support
for the old version.

-Sumit

> Thanks,
> Jon
>
> >
> > Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
> > ---
> >  .../optee/optee-client_3.11.0.bb              |   3 -
> >  .../optee/optee-client_3.14.0.bb              |   3 +
> >  .../recipes-security/optee/optee-examples.inc |   9 +-
> >  .../0001-make-Pass-ldflags-during-link.patch  | 103 ------------------
> >  ...efault-cross-compiler-environment-se.patch |  84 ++++++++++++++
> >  ...nable-plugins-installation-in-rootfs.patch |  39 +++++++
> >  .../optee/optee-examples_3.11.0.bb            |   4 -
> >  .../optee/optee-examples_3.14.0.bb            |   4 +
> >  ...ide-empty-__getauxval-implementation.patch |  62 -----------
> >  ...t-support-for-libnames-after-libgcc-.patch |  55 ----------
> >  ...ke-sure-that-libutils-is-linked-seco.patch |  44 --------
> >  .../recipes-security/optee/optee-os_3.11.0.bb |  11 --
> >  .../recipes-security/optee/optee-os_3.14.0.bb |   8 ++
> >  .../recipes-security/optee/optee-test.inc     |  15 +--
> >  ...Adjust-order-of-including-compiler.h.patch |  64 -----------
> >  ...ake-remove-Wno-unsafe-loop-for-clang.patch |  31 ------
> >  ...e-remove-Wmissing-noreturn-for-clang.patch |  31 ------
> >  .../optee/optee-test_3.11.0.bb                |   3 -
> >  .../optee/optee-test_3.14.0.bb                |   3 +
> >  19 files changed, 154 insertions(+), 422 deletions(-)
> >  delete mode 100644 meta-arm/recipes-security/optee/optee-client_3.11.0.bb
> >  create mode 100644 meta-arm/recipes-security/optee/optee-client_3.14.0.bb
> >  delete mode 100644 meta-arm/recipes-security/optee/optee-examples/0001-make-Pass-ldflags-during-link.patch
> >  create mode 100644 meta-arm/recipes-security/optee/optee-examples/0001-plugins-Honour-default-cross-compiler-environment-se.patch
> >  create mode 100644 meta-arm/recipes-security/optee/optee-examples/0002-Makefile-Enable-plugins-installation-in-rootfs.patch
> >  delete mode 100644 meta-arm/recipes-security/optee/optee-examples_3.11.0.bb
> >  create mode 100644 meta-arm/recipes-security/optee/optee-examples_3.14.0.bb
> >  delete mode 100644 meta-arm/recipes-security/optee/optee-os/0001-libutils-provide-empty-__getauxval-implementation.patch
> >  delete mode 100644 meta-arm/recipes-security/optee/optee-os/0002-link.mk-implement-support-for-libnames-after-libgcc-.patch
> >  delete mode 100644 meta-arm/recipes-security/optee/optee-os/0003-ta_dev_kit.mk-make-sure-that-libutils-is-linked-seco.patch
> >  delete mode 100644 meta-arm/recipes-security/optee/optee-os_3.11.0.bb
> >  create mode 100644 meta-arm/recipes-security/optee/optee-os_3.14.0.bb
> >  delete mode 100644 meta-arm/recipes-security/optee/optee-test/0001-host-xtest-Adjust-order-of-including-compiler.h.patch
> >  delete mode 100644 meta-arm/recipes-security/optee/optee-test/0002-make-remove-Wno-unsafe-loop-for-clang.patch
> >  delete mode 100644 meta-arm/recipes-security/optee/optee-test/0003-make-remove-Wmissing-noreturn-for-clang.patch
> >  delete mode 100644 meta-arm/recipes-security/optee/optee-test_3.11.0.bb
> >  create mode 100644 meta-arm/recipes-security/optee/optee-test_3.14.0.bb
> >
> > diff --git a/meta-arm/recipes-security/optee/optee-client_3.11.0.bb b/meta-arm/recipes-security/optee/optee-client_3.11.0.bb
> > deleted file mode 100644
> > index f765d12..0000000
> > --- a/meta-arm/recipes-security/optee/optee-client_3.11.0.bb
> > +++ /dev/null
> > @@ -1,3 +0,0 @@
> > -require optee-client.inc
> > -
> > -SRCREV = "c0c925384c1d7e3558d27d2708857482952d7907"
> > diff --git a/meta-arm/recipes-security/optee/optee-client_3.14.0.bb b/meta-arm/recipes-security/optee/optee-client_3.14.0.bb
> > new file mode 100644
> > index 0000000..be78b88
> > --- /dev/null
> > +++ b/meta-arm/recipes-security/optee/optee-client_3.14.0.bb
> > @@ -0,0 +1,3 @@
> > +require optee-client.inc
> > +
> > +SRCREV = "06e1b32f6a7028e039c625b07cfc25fda0c17d53"
> > diff --git a/meta-arm/recipes-security/optee/optee-examples.inc b/meta-arm/recipes-security/optee/optee-examples.inc
> > index 81c31bc..f2e53f3 100644
> > --- a/meta-arm/recipes-security/optee/optee-examples.inc
> > +++ b/meta-arm/recipes-security/optee/optee-examples.inc
> > @@ -12,7 +12,8 @@ inherit python3native
> >  require optee.inc
> >
> >  SRC_URI = "git://github.com/linaro-swg/optee_examples.git \
> > -           file://0001-make-Pass-ldflags-during-link.patch \
> > +           file://0001-plugins-Honour-default-cross-compiler-environment-se.patch \
> > +           file://0002-Makefile-Enable-plugins-installation-in-rootfs.patch \
> >            "
> >
> >  EXTRA_OEMAKE += "TA_DEV_KIT_DIR=${TA_DEV_KIT_DIR} \
> > @@ -32,11 +33,15 @@ do_compile[cleandirs] = "${B}"
> >  do_install () {
> >      mkdir -p ${D}${nonarch_base_libdir}/optee_armtz
> >      mkdir -p ${D}${bindir}
> > +    mkdir -p ${D}${libdir}/tee-supplicant/plugins
> >      install -D -p -m0755 ${B}/ca/* ${D}${bindir}
> >      install -D -p -m0444 ${B}/ta/* ${D}${nonarch_base_libdir}/optee_armtz
> > +    install -D -p -m0444 ${B}/plugins/* ${D}${libdir}/tee-supplicant/plugins
> >  }
> >
> > -FILES_${PN} += "${nonarch_base_libdir}/optee_armtz/"
> > +FILES_${PN} += "${nonarch_base_libdir}/optee_armtz/ \
> > +                ${libdir}/tee-supplicant/plugins/ \
> > +               "
> >
> >  # Imports machine specific configs from staging to build
> >  PACKAGE_ARCH = "${MACHINE_ARCH}"
> > diff --git a/meta-arm/recipes-security/optee/optee-examples/0001-make-Pass-ldflags-during-link.patch b/meta-arm/recipes-security/optee/optee-examples/0001-make-Pass-ldflags-during-link.patch
> > deleted file mode 100644
> > index 84202ef..0000000
> > --- a/meta-arm/recipes-security/optee/optee-examples/0001-make-Pass-ldflags-during-link.patch
> > +++ /dev/null
> > @@ -1,103 +0,0 @@
> > -From 29ae21de41f2fbab6dbecbbf408826b28de82df1 Mon Sep 17 00:00:00 2001
> > -From: Khem Raj <raj.khem@gmail.com>
> > -Date: Tue, 1 Sep 2020 21:09:56 -0700
> > -Subject: [PATCH] make: Pass ldflags during link
> > -
> > -OpenEmbeeded needs to pass essential linker flags to set correct flags
> > -for gnu_hash among others which sets the linking straight
> > -using LDFLAGS varible here means, we can affect the linker flags
> > -from build environment
> > -
> > -Upstream-Status: Submitted [https://github.com/linaro-swg/optee_examples/pull/85]
> > -
> > -Signed-off-by: Khem Raj <raj.khem@gmail.com>
> > ----
> > - acipher/host/Makefile        | 2 +-
> > - aes/host/Makefile            | 2 +-
> > - hello_world/host/Makefile    | 2 +-
> > - hotp/host/Makefile           | 2 +-
> > - random/host/Makefile         | 2 +-
> > - secure_storage/host/Makefile | 2 +-
> > - 6 files changed, 6 insertions(+), 6 deletions(-)
> > -
> > -diff --git a/acipher/host/Makefile b/acipher/host/Makefile
> > -index 8f4bc8a..c2cabef 100644
> > ---- a/acipher/host/Makefile
> > -+++ b/acipher/host/Makefile
> > -@@ -18,7 +18,7 @@ BINARY = optee_example_acipher
> > - all: $(BINARY)
> > -
> > - $(BINARY): $(OBJS)
> > --    $(CC) -o $@ $< $(LDADD)
> > -+    $(CC) -o $@ $< $(LDFLAGS) $(LDADD)
> > -
> > - .PHONY: clean
> > - clean:
> > -diff --git a/aes/host/Makefile b/aes/host/Makefile
> > -index dfeb4e8..f61c71b 100644
> > ---- a/aes/host/Makefile
> > -+++ b/aes/host/Makefile
> > -@@ -18,7 +18,7 @@ BINARY = optee_example_aes
> > - all: $(BINARY)
> > -
> > - $(BINARY): $(OBJS)
> > --    $(CC) -o $@ $< $(LDADD)
> > -+    $(CC) -o $@ $< $(LDFLAGS) $(LDADD)
> > -
> > - .PHONY: clean
> > - clean:
> > -diff --git a/hello_world/host/Makefile b/hello_world/host/Makefile
> > -index c4c8239..69cf42c 100644
> > ---- a/hello_world/host/Makefile
> > -+++ b/hello_world/host/Makefile
> > -@@ -18,7 +18,7 @@ BINARY = optee_example_hello_world
> > - all: $(BINARY)
> > -
> > - $(BINARY): $(OBJS)
> > --    $(CC) -o $@ $< $(LDADD)
> > -+    $(CC) -o $@ $< $(LDFLAGS) $(LDADD)
> > -
> > - .PHONY: clean
> > - clean:
> > -diff --git a/hotp/host/Makefile b/hotp/host/Makefile
> > -index cb7fd19..e7f013f 100644
> > ---- a/hotp/host/Makefile
> > -+++ b/hotp/host/Makefile
> > -@@ -18,7 +18,7 @@ BINARY = optee_example_hotp
> > - all: $(BINARY)
> > -
> > - $(BINARY): $(OBJS)
> > --    $(CC) -o $@ $< $(LDADD)
> > -+    $(CC) -o $@ $< $(LDFLAGS) $(LDADD)
> > -
> > - .PHONY: clean
> > - clean:
> > -diff --git a/random/host/Makefile b/random/host/Makefile
> > -index fd407d9..9377f7a 100644
> > ---- a/random/host/Makefile
> > -+++ b/random/host/Makefile
> > -@@ -18,7 +18,7 @@ BINARY = optee_example_random
> > - all: $(BINARY)
> > -
> > - $(BINARY): $(OBJS)
> > --    $(CC) -o $@ $< $(LDADD)
> > -+    $(CC) -o $@ $< $(LDFLAGS) $(LDADD)
> > -
> > - .PHONY: clean
> > - clean:
> > -diff --git a/secure_storage/host/Makefile b/secure_storage/host/Makefile
> > -index 29bfb87..b3265ae 100644
> > ---- a/secure_storage/host/Makefile
> > -+++ b/secure_storage/host/Makefile
> > -@@ -18,7 +18,7 @@ BINARY = optee_example_secure_storage
> > - all: $(BINARY)
> > -
> > - $(BINARY): $(OBJS)
> > --    $(CC) -o $@ $< $(LDADD)
> > -+    $(CC) -o $@ $< $(LDFLAGS) $(LDADD)
> > -
> > - .PHONY: clean
> > - clean:
> > ---
> > -2.28.0
> > -
> > diff --git a/meta-arm/recipes-security/optee/optee-examples/0001-plugins-Honour-default-cross-compiler-environment-se.patch b/meta-arm/recipes-security/optee/optee-examples/0001-plugins-Honour-default-cross-compiler-environment-se.patch
> > new file mode 100644
> > index 0000000..033e48c
> > --- /dev/null
> > +++ b/meta-arm/recipes-security/optee/optee-examples/0001-plugins-Honour-default-cross-compiler-environment-se.patch
> > @@ -0,0 +1,84 @@
> > +From 79c826c249001700007a6dffe80c3d61ff4428ef Mon Sep 17 00:00:00 2001
> > +From: Sumit Garg <sumit.garg@linaro.org>
> > +Date: Tue, 20 Jul 2021 13:54:30 +0530
> > +Subject: [PATCH 1/2] plugins: Honour default cross compiler environment setup
> > +
> > +Honour default $(CC), $(CFLAGS) and $(LDFLAGS) variables. Without this
> > +plugins example fails to build for OE/Yocto.
> > +
> > +Upstream-Status: Submitted [https://github.com/linaro-swg/optee_examples/pull/87]
> > +
> > +Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
> > +---
> > + plugins/Makefile        |  2 +-
> > + plugins/host/Makefile   |  2 +-
> > + plugins/syslog/Makefile | 16 ++++++++++++----
> > + 3 files changed, 14 insertions(+), 6 deletions(-)
> > +
> > +diff --git a/plugins/Makefile b/plugins/Makefile
> > +index 2372b38..ea472b4 100644
> > +--- a/plugins/Makefile
> > ++++ b/plugins/Makefile
> > +@@ -8,7 +8,7 @@ TA_CROSS_COMPILE ?= $(CROSS_COMPILE)
> > + all:
> > +     $(MAKE) -C host CROSS_COMPILE="$(HOST_CROSS_COMPILE)" --no-builtin-variables
> > +     $(MAKE) -C ta CROSS_COMPILE="$(TA_CROSS_COMPILE)" LDFLAGS=""
> > +-    $(MAKE) -C syslog CROSS_COMPILE="$(HOST_CROSS_COMPILE)"
> > ++    $(MAKE) -C syslog CROSS_COMPILE="$(HOST_CROSS_COMPILE)" --no-builtin-variables
> > +
> > + .PHONY: clean
> > + clean:
> > +diff --git a/plugins/host/Makefile b/plugins/host/Makefile
> > +index 7285104..76244c7 100644
> > +--- a/plugins/host/Makefile
> > ++++ b/plugins/host/Makefile
> > +@@ -20,7 +20,7 @@ BINARY = optee_example_plugins
> > + all: $(BINARY)
> > +
> > + $(BINARY): $(OBJS)
> > +-    $(CC) -o $@ $< $(LDADD)
> > ++    $(CC) $(LDFLAGS) -o $@ $< $(LDADD)
> > +
> > + .PHONY: clean
> > + clean:
> > +diff --git a/plugins/syslog/Makefile b/plugins/syslog/Makefile
> > +index 62d916a..71f5f92 100644
> > +--- a/plugins/syslog/Makefile
> > ++++ b/plugins/syslog/Makefile
> > +@@ -1,3 +1,11 @@
> > ++CC      ?= $(CROSS_COMPILE)gcc
> > ++LD      ?= $(CROSS_COMPILE)ld
> > ++AR      ?= $(CROSS_COMPILE)ar
> > ++NM      ?= $(CROSS_COMPILE)nm
> > ++OBJCOPY ?= $(CROSS_COMPILE)objcopy
> > ++OBJDUMP ?= $(CROSS_COMPILE)objdump
> > ++READELF ?= $(CROSS_COMPILE)readelf
> > ++
> > + PLUGIN_UUID = 96bcf744-4f72-4866-bf1d-8634fd9c65e5
> > +
> > + PLUGIN                      = $(PLUGIN_UUID).plugin
> > +@@ -6,17 +14,17 @@ PLUGIN_OBJ                = $(patsubst %.c, %.o, $(PLUGIN_SRS))
> > + PLUGIN_INCLUDES_DIR = $(CURDIR) $(TEEC_EXPORT)/include
> > +
> > + PLUGIN_INCLUDES             = $(addprefix -I, $(PLUGIN_INCLUDES_DIR))
> > +-PLUGIN_CCFLAGS              = -Wall -fPIC
> > +-PLUGIN_LDFLAGS              = -shared
> > ++PLUGIN_CCFLAGS              = $(CFLAGS) -Wall -fPIC
> > ++PLUGIN_LDFLAGS              = $(LDFLAGS) -shared
> > +
> > + .PHONY: all
> > + all: $(PLUGIN)
> > +
> > + $(PLUGIN): $(PLUGIN_OBJ)
> > +-    $(CROSS_COMPILE)gcc $(PLUGIN_LDFLAGS) $(PLUGIN_OBJ) -o $@
> > ++    $(CC) $(PLUGIN_LDFLAGS) $(PLUGIN_OBJ) -o $@
> > +
> > + %.o: %.c
> > +-    $(CROSS_COMPILE)gcc $(PLUGIN_CCFLAGS) $(PLUGIN_INCLUDES) -c $*.c -o $*.o
> > ++    $(CC) $(PLUGIN_CCFLAGS) $(PLUGIN_INCLUDES) -c $*.c -o $*.o
> > +
> > + .PHONY: clean
> > + clean:
> > +--
> > +2.25.1
> > +
> > diff --git a/meta-arm/recipes-security/optee/optee-examples/0002-Makefile-Enable-plugins-installation-in-rootfs.patch b/meta-arm/recipes-security/optee/optee-examples/0002-Makefile-Enable-plugins-installation-in-rootfs.patch
> > new file mode 100644
> > index 0000000..8d1d60a
> > --- /dev/null
> > +++ b/meta-arm/recipes-security/optee/optee-examples/0002-Makefile-Enable-plugins-installation-in-rootfs.patch
> > @@ -0,0 +1,39 @@
> > +From a865f2e25e178fc2c4617eb1faf79ac922d02ffd Mon Sep 17 00:00:00 2001
> > +From: Sumit Garg <sumit.garg@linaro.org>
> > +Date: Tue, 20 Jul 2021 14:20:10 +0530
> > +Subject: [PATCH 2/2] Makefile: Enable plugins installation in rootfs
> > +
> > +Upstream-Status: Submitted [https://github.com/linaro-swg/optee_examples/pull/87]
> > +
> > +Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
> > +---
> > + Makefile | 5 +++++
> > + 1 file changed, 5 insertions(+)
> > +
> > +diff --git a/Makefile b/Makefile
> > +index a275842..b3f16aa 100644
> > +--- a/Makefile
> > ++++ b/Makefile
> > +@@ -25,14 +25,19 @@ prepare-for-rootfs: examples
> > +     @mkdir -p $(OUTPUT_DIR)
> > +     @mkdir -p $(OUTPUT_DIR)/ta
> > +     @mkdir -p $(OUTPUT_DIR)/ca
> > ++    @mkdir -p $(OUTPUT_DIR)/plugins
> > +     @for example in $(EXAMPLE_LIST); do \
> > +             if [ -e $$example/host/optee_example_$$example ]; then \
> > +                     cp -p $$example/host/optee_example_$$example $(OUTPUT_DIR)/ca/; \
> > +             fi; \
> > +             cp -pr $$example/ta/*.ta $(OUTPUT_DIR)/ta/; \
> > ++            if [ $$example == plugins ]; then \
> > ++                    cp -p plugins/syslog/*.plugin $(OUTPUT_DIR)/plugins/; \
> > ++            fi; \
> > +     done
> > +
> > + prepare-for-rootfs-clean:
> > +     @rm -rf $(OUTPUT_DIR)/ta
> > +     @rm -rf $(OUTPUT_DIR)/ca
> > ++    @rm -rf $(OUTPUT_DIR)/plugins
> > +     @rmdir --ignore-fail-on-non-empty $(OUTPUT_DIR) || test ! -e $(OUTPUT_DIR)
> > +--
> > +2.25.1
> > +
> > diff --git a/meta-arm/recipes-security/optee/optee-examples_3.11.0.bb b/meta-arm/recipes-security/optee/optee-examples_3.11.0.bb
> > deleted file mode 100644
> > index 72473ed..0000000
> > --- a/meta-arm/recipes-security/optee/optee-examples_3.11.0.bb
> > +++ /dev/null
> > @@ -1,4 +0,0 @@
> > -require optee-examples.inc
> > -
> > -SRCREV = "9a7dc598591990349d88b4dba3a37aadd6851295"
> > -
> > diff --git a/meta-arm/recipes-security/optee/optee-examples_3.14.0.bb b/meta-arm/recipes-security/optee/optee-examples_3.14.0.bb
> > new file mode 100644
> > index 0000000..f2b5f7d
> > --- /dev/null
> > +++ b/meta-arm/recipes-security/optee/optee-examples_3.14.0.bb
> > @@ -0,0 +1,4 @@
> > +require optee-examples.inc
> > +
> > +SRCREV = "e9c870525af8f7e7fccf575a0ca5394ce55adcec"
> > +
> > diff --git a/meta-arm/recipes-security/optee/optee-os/0001-libutils-provide-empty-__getauxval-implementation.patch b/meta-arm/recipes-security/optee/optee-os/0001-libutils-provide-empty-__getauxval-implementation.patch
> > deleted file mode 100644
> > index 0120f5c..0000000
> > --- a/meta-arm/recipes-security/optee/optee-os/0001-libutils-provide-empty-__getauxval-implementation.patch
> > +++ /dev/null
> > @@ -1,62 +0,0 @@
> > -Upstream-Status: Backport
> > -Signed-off-by: Ross Burton <ross.burton@arm.com>
> > -
> > -From 36e784f621bf5d5be9183beba35f39426277c110 Mon Sep 17 00:00:00 2001
> > -From: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
> > -Date: Tue, 13 Oct 2020 22:45:39 +0300
> > -Subject: [PATCH 1/3] libutils: provide empty __getauxval() implementation
> > -
> > -Never version of libgcc are built with LSE implementation in mind. To
> > -determine if LSE is available on platform it calls __getauxval(), so in
> > -some cases we can get undefined reference to __getauxval() error.
> > -
> > -Prominent case is libgcc_eh.a library, which is used by C++ TAs. Exception
> > -handler depends on atomic operations, so it tries to call
> > -init_have_lse_atomics() first. This function in turn calls __getauxval(),
> > -which causes linking error.
> > -
> > -In the future we can make __getauxval() to return actual platform
> > -capabilities.
> > -
> > -Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
> > -Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
> > -Reviewed-by: Jerome Forissier <jerome@forissier.org>
> > ----
> > - lib/libutils/ext/arch/arm/auxval.c | 12 ++++++++++++
> > - lib/libutils/ext/arch/arm/sub.mk   |  1 +
> > - 2 files changed, 13 insertions(+)
> > - create mode 100644 lib/libutils/ext/arch/arm/auxval.c
> > -
> > -diff --git a/lib/libutils/ext/arch/arm/auxval.c b/lib/libutils/ext/arch/arm/auxval.c
> > -new file mode 100644
> > -index 00000000..98bca850
> > ---- /dev/null
> > -+++ b/lib/libutils/ext/arch/arm/auxval.c
> > -@@ -0,0 +1,12 @@
> > -+// SPDX-License-Identifier: BSD-2-Clause
> > -+/*
> > -+ * Copyright (c) 2020, EPAM Systems
> > -+ */
> > -+
> > -+#include <compiler.h>
> > -+
> > -+unsigned long int __getauxval (unsigned long int type);
> > -+unsigned long int __getauxval (unsigned long int type __unused)
> > -+{
> > -+    return 0;
> > -+}
> > -diff --git a/lib/libutils/ext/arch/arm/sub.mk b/lib/libutils/ext/arch/arm/sub.mk
> > -index dc5eed67..2e779066 100644
> > ---- a/lib/libutils/ext/arch/arm/sub.mk
> > -+++ b/lib/libutils/ext/arch/arm/sub.mk
> > -@@ -3,6 +3,7 @@ srcs-$(CFG_ARM32_$(sm)) += aeabi_unwind.c
> > - endif
> > - srcs-$(CFG_ARM32_$(sm)) += atomic_a32.S
> > - srcs-$(CFG_ARM64_$(sm)) += atomic_a64.S
> > -+srcs-y += auxval.c
> > - ifneq ($(sm),ldelf) # TA, core
> > - srcs-$(CFG_ARM32_$(sm)) += mcount_a32.S
> > - srcs-$(CFG_ARM64_$(sm)) += mcount_a64.S
> > ---
> > -2.25.1
> > -
> > diff --git a/meta-arm/recipes-security/optee/optee-os/0002-link.mk-implement-support-for-libnames-after-libgcc-.patch b/meta-arm/recipes-security/optee/optee-os/0002-link.mk-implement-support-for-libnames-after-libgcc-.patch
> > deleted file mode 100644
> > index 11296c8..0000000
> > --- a/meta-arm/recipes-security/optee/optee-os/0002-link.mk-implement-support-for-libnames-after-libgcc-.patch
> > +++ /dev/null
> > @@ -1,55 +0,0 @@
> > -Upstream-Status: Backport
> > -Signed-off-by: Ross Burton <ross.burton@arm.com>
> > -
> > -From 73196b58ea6978ffa5e581738030f51c5789ef73 Mon Sep 17 00:00:00 2001
> > -From: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
> > -Date: Tue, 13 Oct 2020 22:54:13 +0300
> > -Subject: [PATCH 2/3] link.mk: implement support for libnames-after-libgcc
> > - variable
> > -
> > -Newer versions of libgcc depend on external __getauxval() symbol, which is
> > -now provided by libutils. But libgcc is linked after libutils, so linker
> > -can't resolve that symbol. We can't include libgcc into linking group with
> > -libtutils, because libgcc provides symbols that conflict with libutil's
> > -ones, like __aeabi_idiv with friends for instance.
> > -
> > -So, to resolve libgcc dependency on libutils we need to link with libutils
> > -second time. To make things more generic, we will introduce
> > -$(libnames-after-libgcc) variable for libraries that should be linked after
> > -libgcc.
> > -
> > -Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
> > -Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
> > -Reviewed-by: Jerome Forissier <jerome@forissier.org>
> > ----
> > - ta/arch/arm/link.mk | 6 +++++-
> > - 1 file changed, 5 insertions(+), 1 deletion(-)
> > -
> > -diff --git a/ta/arch/arm/link.mk b/ta/arch/arm/link.mk
> > -index 445c285d..3025acb1 100644
> > ---- a/ta/arch/arm/link.mk
> > -+++ b/ta/arch/arm/link.mk
> > -@@ -55,8 +55,11 @@ link-ldflags += --eh-frame-hdr
> > - link-ldadd += $(libstdc++$(sm)) $(libgcc_eh$(sm))
> > - endif
> > - link-ldadd += --end-group
> > --ldargs-$(user-ta-uuid).elf := $(link-ldflags) $(objs) $(link-ldadd) $(libgcc$(sm))
> > -
> > -+link-ldadd-after-libgcc += $(addprefix -l,$(libnames-after-libgcc))
> > -+
> > -+ldargs-$(user-ta-uuid).elf := $(link-ldflags) $(objs) $(link-ldadd) \
> > -+                            $(libgcc$(sm)) $(link-ldadd-after-libgcc)
> > -
> > - link-script-cppflags-$(sm) := \
> > -     $(filter-out $(CPPFLAGS_REMOVE) $(cppflags-remove), \
> > -@@ -76,6 +79,7 @@ $(link-script-pp$(sm)): $(link-script$(sm)) $(conf-file) $(link-script-pp-makefi
> > -             $(link-script-cppflags-$(sm)) $$< -o $$@
> > -
> > - $(link-out-dir$(sm))/$(user-ta-uuid).elf: $(objs) $(libdeps) \
> > -+                                      $(libdeps-after-libgcc) \
> > -                                       $(link-script-pp$(sm)) \
> > -                                       $(dynlistdep) \
> > -                                       $(additional-link-deps)
> > ---
> > -2.25.1
> > -
> > diff --git a/meta-arm/recipes-security/optee/optee-os/0003-ta_dev_kit.mk-make-sure-that-libutils-is-linked-seco.patch b/meta-arm/recipes-security/optee/optee-os/0003-ta_dev_kit.mk-make-sure-that-libutils-is-linked-seco.patch
> > deleted file mode 100644
> > index 88ba5f8..0000000
> > --- a/meta-arm/recipes-security/optee/optee-os/0003-ta_dev_kit.mk-make-sure-that-libutils-is-linked-seco.patch
> > +++ /dev/null
> > @@ -1,44 +0,0 @@
> > -Upstream-Status: Backport
> > -Signed-off-by: Ross Burton <ross.burton@arm.com>
> > -
> > -From f50962e3f56f0932662b2ffa10afe53339a335dd Mon Sep 17 00:00:00 2001
> > -From: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
> > -Date: Fri, 16 Oct 2020 16:36:08 +0300
> > -Subject: [PATCH 3/3] ta_dev_kit.mk: make sure that libutils is linked second
> > - time
> > -
> > -libgcc depends on __getauxval symbol from libuils. As, generally libutils
> > -is linked before libgcc, we will get "unresolved symbol" error. To resolve
> > -this dependency we need to link libutils second time - after libgcc.
> > -
> > -Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
> > -Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
> > -Reviewed-by: Jerome Forissier <jerome@forissier.org>
> > ----
> > - ta/mk/ta_dev_kit.mk | 10 ++++++++++
> > - 1 file changed, 10 insertions(+)
> > -
> > -diff --git a/ta/mk/ta_dev_kit.mk b/ta/mk/ta_dev_kit.mk
> > -index e28be677..d0e66317 100644
> > ---- a/ta/mk/ta_dev_kit.mk
> > -+++ b/ta/mk/ta_dev_kit.mk
> > -@@ -78,6 +78,16 @@ endif
> > - libnames += dl
> > - libdeps += $(ta-dev-kit-dir$(sm))/lib/libdl.a
> > -
> > -+# libutils provides __getauxval symbol which is needed by libgcc 10.x. We can't
> > -+# link libutils after libgcc, because libgcc will replace some symbols provided
> > -+# by libutils, which will cause further linking issues.
> > -+#
> > -+# But if we place libutils before libgcc, linker will not be able to resolve
> > -+# __getauxval. So we need to link with libutils twice: before and after libgcc.
> > -+# Hence it included both in $(libnames) and in $(libnames-after-libgcc)
> > -+libnames-after-libgcc += utils
> > -+libdeps-after-libgcc += $(ta-dev-kit-dir$(sm))/lib/libutils.a
> > -+
> > - # Pass config variable (CFG_) from conf.mk on the command line
> > - cppflags$(sm) += $(strip \
> > -     $(foreach var, $(filter CFG_%,$(.VARIABLES)), \
> > ---
> > -2.25.1
> > -
> > diff --git a/meta-arm/recipes-security/optee/optee-os_3.11.0.bb b/meta-arm/recipes-security/optee/optee-os_3.11.0.bb
> > deleted file mode 100644
> > index 13b3dc6..0000000
> > --- a/meta-arm/recipes-security/optee/optee-os_3.11.0.bb
> > +++ /dev/null
> > @@ -1,11 +0,0 @@
> > -require optee-os.inc
> > -
> > -SRCREV = "c4def2a8262a03244d9a88461699b9b8e43c6b55"
> > -
> > -SRC_URI_append = " \
> > -    file://0006-allow-setting-sysroot-for-libgcc-lookup.patch \
> > -    file://0007-allow-setting-sysroot-for-clang.patch \
> > -    file://0001-libutils-provide-empty-__getauxval-implementation.patch \
> > -    file://0002-link.mk-implement-support-for-libnames-after-libgcc-.patch \
> > -    file://0003-ta_dev_kit.mk-make-sure-that-libutils-is-linked-seco.patch \
> > -"
> > diff --git a/meta-arm/recipes-security/optee/optee-os_3.14.0.bb b/meta-arm/recipes-security/optee/optee-os_3.14.0.bb
> > new file mode 100644
> > index 0000000..3289e2c
> > --- /dev/null
> > +++ b/meta-arm/recipes-security/optee/optee-os_3.14.0.bb
> > @@ -0,0 +1,8 @@
> > +require optee-os.inc
> > +
> > +SRCREV = "d21befa5e53eae9db469eba1685f5aa5c6f92c2f"
> > +
> > +SRC_URI_append = " \
> > +    file://0006-allow-setting-sysroot-for-libgcc-lookup.patch \
> > +    file://0007-allow-setting-sysroot-for-clang.patch \
> > +"
> > diff --git a/meta-arm/recipes-security/optee/optee-test.inc b/meta-arm/recipes-security/optee/optee-test.inc
> > index f09b9d2..bcbcc06 100644
> > --- a/meta-arm/recipes-security/optee/optee-test.inc
> > +++ b/meta-arm/recipes-security/optee/optee-test.inc
> > @@ -8,17 +8,9 @@ LIC_FILES_CHKSUM = "file://${S}/LICENSE.md;md5=daa2bcccc666345ab8940aab1315a4fa"
> >  inherit python3native ptest
> >  require optee.inc
> >
> > -# Linking fails on musl due to C++/threads
> > -# https://github.com/OP-TEE/optee_test/issues/458#issuecomment-720540834
> > -# When upgraded we should be able to remove this limitation
> > -COMPATIBLE_HOST_libc-musl = 'null'
> > -
> >  DEPENDS = "optee-client optee-os python3-pycryptodome-native"
> >
> >  SRC_URI = "git://github.com/OP-TEE/optee_test.git \
> > -           file://0001-host-xtest-Adjust-order-of-including-compiler.h.patch \
> > -           file://0002-make-remove-Wno-unsafe-loop-for-clang.patch \
> > -           file://0003-make-remove-Wmissing-noreturn-for-clang.patch \
> >             file://run-ptest \
> >            "
> >
> > @@ -36,6 +28,7 @@ do_compile() {
> >      # Top level makefile doesn't seem to handle parallel make gracefully
> >      oe_runmake xtest
> >      oe_runmake ta
> > +    oe_runmake test_plugin
> >  }
> >  do_compile[cleandirs] = "${B}"
> >
> > @@ -46,9 +39,13 @@ do_install () {
> >      # default TEEC_LOAD_PATH is /lib
> >      mkdir -p ${D}${nonarch_base_libdir}/optee_armtz/
> >      install -D -p -m0444 ${B}/ta/*/*.ta ${D}${nonarch_base_libdir}/optee_armtz/
> > +    mkdir -p ${D}${libdir}/tee-supplicant/plugins
> > +    install -D -p -m0444 ${B}/supp_plugin/*.plugin ${D}${libdir}/tee-supplicant/plugins/
> >  }
> >
> > -FILES_${PN} += "${nonarch_base_libdir}/optee_armtz/"
> > +FILES_${PN} += "${nonarch_base_libdir}/optee_armtz/ \
> > +                ${libdir}/tee-supplicant/plugins/ \
> > +               "
> >
> >  # Imports machine specific configs from staging to build
> >  PACKAGE_ARCH = "${MACHINE_ARCH}"
> > diff --git a/meta-arm/recipes-security/optee/optee-test/0001-host-xtest-Adjust-order-of-including-compiler.h.patch b/meta-arm/recipes-security/optee/optee-test/0001-host-xtest-Adjust-order-of-including-compiler.h.patch
> > deleted file mode 100644
> > index 3c500d7..0000000
> > --- a/meta-arm/recipes-security/optee/optee-test/0001-host-xtest-Adjust-order-of-including-compiler.h.patch
> > +++ /dev/null
> > @@ -1,64 +0,0 @@
> > -From fc95b3ccbbfd336797ae2cfd6dd4dc58644e146f Mon Sep 17 00:00:00 2001
> > -From: Khem Raj <raj.khem@gmail.com>
> > -Date: Sat, 30 May 2020 17:52:18 -0700
> > -Subject: [PATCH] host/xtest: Adjust order of including compiler.h
> > -
> > -compiler.h defines some defines which violate libc namespace e.g.
> > -__unused, this works ok with glibc but fails in awkward ways with musl
> > -the reason is musl uses __unused in its internal structures and this
> > -define in compiler.h conflicts with system headers causing errors like
> > -
> > -recipe-sysroot/usr/include/bits/stat.h:17:19: error: expected identifier or '(' before '[' token unsigned __unused[2];
> > -                   ^
> > -including compiler.h afer sys/stat.h fixes the problem.
> > -
> > -Upstream-Status: Pending [https://github.com/OP-TEE/optee_test/issues/453]
> > -Signed-off-by: Khem Raj <raj.khem@gmail.com>
> > ----
> > - host/xtest/install_ta.c | 2 +-
> > - host/xtest/stats.c      | 2 +-
> > - 2 files changed, 2 insertions(+), 2 deletions(-)
> > -
> > -diff --git a/host/xtest/install_ta.c b/host/xtest/install_ta.c
> > -index 09a4c6d..6f7bb5c 100644
> > ---- a/host/xtest/install_ta.c
> > -+++ b/host/xtest/install_ta.c
> > -@@ -4,7 +4,6 @@
> > -  * SPDX-License-Identifier: BSD-2-Clause
> > -  */
> > -
> > --#include <compiler.h>
> > - #include <dirent.h>
> > - #include <err.h>
> > - #include <errno.h>
> > -@@ -20,6 +19,7 @@
> > - #include <sys/types.h>
> > - #include <tee_client_api.h>
> > - #include <unistd.h>
> > -+#include <compiler.h>
> > -
> > - #include "install_ta.h"
> > - #include "xtest_helpers.h"
> > -diff --git a/host/xtest/stats.c b/host/xtest/stats.c
> > -index 96b0b5f..db9bf25 100644
> > ---- a/host/xtest/stats.c
> > -+++ b/host/xtest/stats.c
> > -@@ -3,7 +3,6 @@
> > -  * Copyright (c) 2019, Linaro Limited
> > -  */
> > -
> > --#include <compiler.h>
> > - #include <dirent.h>
> > - #include <err.h>
> > - #include <errno.h>
> > -@@ -18,6 +17,7 @@
> > - #include <sys/types.h>
> > - #include <tee_client_api.h>
> > - #include <unistd.h>
> > -+#include <compiler.h>
> > - #include "xtest_test.h"
> > - #include "stats.h"
> > -
> > ---
> > -2.26.2
> > -
> > diff --git a/meta-arm/recipes-security/optee/optee-test/0002-make-remove-Wno-unsafe-loop-for-clang.patch b/meta-arm/recipes-security/optee/optee-test/0002-make-remove-Wno-unsafe-loop-for-clang.patch
> > deleted file mode 100644
> > index 17dd7d8..0000000
> > --- a/meta-arm/recipes-security/optee/optee-test/0002-make-remove-Wno-unsafe-loop-for-clang.patch
> > +++ /dev/null
> > @@ -1,31 +0,0 @@
> > -From 438533ce9da1df0b7c7914e64b39ffdc1da1ab79 Mon Sep 17 00:00:00 2001
> > -From: Brett Warren <brett.warran@arm.com>
> > -Date: Thu, 8 Oct 2020 10:03:25 +0100
> > -Subject: [PATCH] make: remove -Wmissing-noreturn for clang
> > -
> > -When compiling when clang, -Wmissing-noreturn causes an error because
> > -of non-compliant code. This option is removed to workaround this.
> > -
> > -Upstream-Status: Pending [https://github.com/OP-TEE/optee_test/issues/452]
> > -Changed-Id: 71cb511904547d790d1ea98f93bf8e5a6afcb36d
> > -Signed-off-by: Brett Warren <brett.warren@arm.com>
> > ----
> > - host/xtest/Makefile | 2 +-
> > - 1 file changed, 1 insertion(+), 1 deletion(-)
> > -
> > -diff --git a/host/xtest/Makefile b/host/xtest/Makefile
> > -index 3c206b0..96746de 100644
> > ---- a/host/xtest/Makefile
> > -+++ b/host/xtest/Makefile
> > -@@ -169,7 +169,7 @@ CFLAGS += -Wall -Wcast-align -Werror \
> > -       -Werror-implicit-function-declaration -Wextra -Wfloat-equal \
> > -       -Wformat-nonliteral -Wformat-security -Wformat=2 -Winit-self \
> > -       -Wmissing-declarations -Wmissing-format-attribute \
> > --      -Wmissing-include-dirs -Wmissing-noreturn \
> > -+      -Wmissing-include-dirs \
> > -       -Wmissing-prototypes -Wnested-externs -Wpointer-arith \
> > -       -Wshadow -Wstrict-prototypes -Wswitch-default \
> > -       -Wwrite-strings \
> > ---
> > -2.17.1
> > -
> > diff --git a/meta-arm/recipes-security/optee/optee-test/0003-make-remove-Wmissing-noreturn-for-clang.patch b/meta-arm/recipes-security/optee/optee-test/0003-make-remove-Wmissing-noreturn-for-clang.patch
> > deleted file mode 100644
> > index bbc303f..0000000
> > --- a/meta-arm/recipes-security/optee/optee-test/0003-make-remove-Wmissing-noreturn-for-clang.patch
> > +++ /dev/null
> > @@ -1,31 +0,0 @@
> > -From ed5a9d9f7a3e9e14ca0e8aea59008124ee0e5f96 Mon Sep 17 00:00:00 2001
> > -From: Brett Warren <brett.warren@arm.com>
> > -Date: Thu, 8 Oct 2020 10:20:52 +0100
> > -Subject: [PATCH] make: remove -Wno-unsafe-loop for clang
> > -
> > -When compiling with clang, the -Wno-unsafe-loop-optimizations option
> > -throws an error because clang doesn't recognise it. This option is
> > -removed to workaround this.
> > -
> > -Upstream-Status: Pending [https://github.com/OP-TEE/optee_test/issues/452]
> > -Change-Id: 5fe0892c73208aaffac8c9995cb3275936fb1ba6
> > -Signed-off-by: Brett Warren <brett.warren@arm.com>
> > ----
> > - host/xtest/Makefile | 1 -
> > - 1 file changed, 1 deletion(-)
> > -
> > -diff --git a/host/xtest/Makefile b/host/xtest/Makefile
> > -index 96746de..73731d0 100644
> > ---- a/host/xtest/Makefile
> > -+++ b/host/xtest/Makefile
> > -@@ -174,7 +174,6 @@ CFLAGS += -Wall -Wcast-align -Werror \
> > -       -Wshadow -Wstrict-prototypes -Wswitch-default \
> > -       -Wwrite-strings \
> > -       -Wno-declaration-after-statement \
> > --      -Wno-unsafe-loop-optimizations \
> > -       -Wno-missing-field-initializers -Wno-format-zero-length
> > - endif
> > -
> > ---
> > -2.17.1
> > -
> > diff --git a/meta-arm/recipes-security/optee/optee-test_3.11.0.bb b/meta-arm/recipes-security/optee/optee-test_3.11.0.bb
> > deleted file mode 100644
> > index 0f8b5b0..0000000
> > --- a/meta-arm/recipes-security/optee/optee-test_3.11.0.bb
> > +++ /dev/null
> > @@ -1,3 +0,0 @@
> > -require optee-test.inc
> > -
> > -SRCREV = "159e295d5cc3ad2275ab15fe544620f6604d4ba4"
> > diff --git a/meta-arm/recipes-security/optee/optee-test_3.14.0.bb b/meta-arm/recipes-security/optee/optee-test_3.14.0.bb
> > new file mode 100644
> > index 0000000..6367c27
> > --- /dev/null
> > +++ b/meta-arm/recipes-security/optee/optee-test_3.14.0.bb
> > @@ -0,0 +1,3 @@
> > +require optee-test.inc
> > +
> > +SRCREV = "f2eb88affbb7f028561b4fd5cbd049d5d704f741"
> > --
> > 2.25.1
> >
>
> >
> > 
> >
>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [meta-arm] [PATCH] arm/optee: version uplift 3.11.0 -> 3.14.0
  2021-07-20 10:07 [PATCH] arm/optee: version uplift 3.11.0 -> 3.14.0 Sumit Garg
  2021-07-20 14:42 ` [meta-arm] " Jon Mason
@ 2021-07-23 19:06 ` Ross Burton
  2021-07-26  7:09   ` Sumit Garg
  1 sibling, 1 reply; 11+ messages in thread
From: Ross Burton @ 2021-07-23 19:06 UTC (permalink / raw)
  To: Sumit Garg; +Cc: meta-arm, Jon Mason, Ross Burton

The optee-examples recipe is broken:

install: cannot stat
'/builds/engineering/yocto/meta-arm/work/build/tmp/work/qemuarm64_secureboot-poky-linux/optee-examples/3.14.0-r0/build/plugins/*':
No such file or directory

(qemuarm64-secureboot can build it)

Ross

On Tue, 20 Jul 2021 at 11:07, Sumit Garg <sumit.garg@linaro.org> wrote:
>
> Brief description of changes:
> - Version uplift 3.11.0 -> 3.14.0.
> - Removed OP-TEE patches that has already been accepted upstream.
> - Added support for tee-supplicant plugin framework testing.
>
> Tested on qemuarm64_secureboot:
> $ xtest -l 15
> $ optee-examples_*
>
> Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
> ---
>  .../optee/optee-client_3.11.0.bb              |   3 -
>  .../optee/optee-client_3.14.0.bb              |   3 +
>  .../recipes-security/optee/optee-examples.inc |   9 +-
>  .../0001-make-Pass-ldflags-during-link.patch  | 103 ------------------
>  ...efault-cross-compiler-environment-se.patch |  84 ++++++++++++++
>  ...nable-plugins-installation-in-rootfs.patch |  39 +++++++
>  .../optee/optee-examples_3.11.0.bb            |   4 -
>  .../optee/optee-examples_3.14.0.bb            |   4 +
>  ...ide-empty-__getauxval-implementation.patch |  62 -----------
>  ...t-support-for-libnames-after-libgcc-.patch |  55 ----------
>  ...ke-sure-that-libutils-is-linked-seco.patch |  44 --------
>  .../recipes-security/optee/optee-os_3.11.0.bb |  11 --
>  .../recipes-security/optee/optee-os_3.14.0.bb |   8 ++
>  .../recipes-security/optee/optee-test.inc     |  15 +--
>  ...Adjust-order-of-including-compiler.h.patch |  64 -----------
>  ...ake-remove-Wno-unsafe-loop-for-clang.patch |  31 ------
>  ...e-remove-Wmissing-noreturn-for-clang.patch |  31 ------
>  .../optee/optee-test_3.11.0.bb                |   3 -
>  .../optee/optee-test_3.14.0.bb                |   3 +
>  19 files changed, 154 insertions(+), 422 deletions(-)
>  delete mode 100644 meta-arm/recipes-security/optee/optee-client_3.11.0.bb
>  create mode 100644 meta-arm/recipes-security/optee/optee-client_3.14.0.bb
>  delete mode 100644 meta-arm/recipes-security/optee/optee-examples/0001-make-Pass-ldflags-during-link.patch
>  create mode 100644 meta-arm/recipes-security/optee/optee-examples/0001-plugins-Honour-default-cross-compiler-environment-se.patch
>  create mode 100644 meta-arm/recipes-security/optee/optee-examples/0002-Makefile-Enable-plugins-installation-in-rootfs.patch
>  delete mode 100644 meta-arm/recipes-security/optee/optee-examples_3.11.0.bb
>  create mode 100644 meta-arm/recipes-security/optee/optee-examples_3.14.0.bb
>  delete mode 100644 meta-arm/recipes-security/optee/optee-os/0001-libutils-provide-empty-__getauxval-implementation.patch
>  delete mode 100644 meta-arm/recipes-security/optee/optee-os/0002-link.mk-implement-support-for-libnames-after-libgcc-.patch
>  delete mode 100644 meta-arm/recipes-security/optee/optee-os/0003-ta_dev_kit.mk-make-sure-that-libutils-is-linked-seco.patch
>  delete mode 100644 meta-arm/recipes-security/optee/optee-os_3.11.0.bb
>  create mode 100644 meta-arm/recipes-security/optee/optee-os_3.14.0.bb
>  delete mode 100644 meta-arm/recipes-security/optee/optee-test/0001-host-xtest-Adjust-order-of-including-compiler.h.patch
>  delete mode 100644 meta-arm/recipes-security/optee/optee-test/0002-make-remove-Wno-unsafe-loop-for-clang.patch
>  delete mode 100644 meta-arm/recipes-security/optee/optee-test/0003-make-remove-Wmissing-noreturn-for-clang.patch
>  delete mode 100644 meta-arm/recipes-security/optee/optee-test_3.11.0.bb
>  create mode 100644 meta-arm/recipes-security/optee/optee-test_3.14.0.bb
>
> diff --git a/meta-arm/recipes-security/optee/optee-client_3.11.0.bb b/meta-arm/recipes-security/optee/optee-client_3.11.0.bb
> deleted file mode 100644
> index f765d12..0000000
> --- a/meta-arm/recipes-security/optee/optee-client_3.11.0.bb
> +++ /dev/null
> @@ -1,3 +0,0 @@
> -require optee-client.inc
> -
> -SRCREV = "c0c925384c1d7e3558d27d2708857482952d7907"
> diff --git a/meta-arm/recipes-security/optee/optee-client_3.14.0.bb b/meta-arm/recipes-security/optee/optee-client_3.14.0.bb
> new file mode 100644
> index 0000000..be78b88
> --- /dev/null
> +++ b/meta-arm/recipes-security/optee/optee-client_3.14.0.bb
> @@ -0,0 +1,3 @@
> +require optee-client.inc
> +
> +SRCREV = "06e1b32f6a7028e039c625b07cfc25fda0c17d53"
> diff --git a/meta-arm/recipes-security/optee/optee-examples.inc b/meta-arm/recipes-security/optee/optee-examples.inc
> index 81c31bc..f2e53f3 100644
> --- a/meta-arm/recipes-security/optee/optee-examples.inc
> +++ b/meta-arm/recipes-security/optee/optee-examples.inc
> @@ -12,7 +12,8 @@ inherit python3native
>  require optee.inc
>
>  SRC_URI = "git://github.com/linaro-swg/optee_examples.git \
> -           file://0001-make-Pass-ldflags-during-link.patch \
> +           file://0001-plugins-Honour-default-cross-compiler-environment-se.patch \
> +           file://0002-Makefile-Enable-plugins-installation-in-rootfs.patch \
>            "
>
>  EXTRA_OEMAKE += "TA_DEV_KIT_DIR=${TA_DEV_KIT_DIR} \
> @@ -32,11 +33,15 @@ do_compile[cleandirs] = "${B}"
>  do_install () {
>      mkdir -p ${D}${nonarch_base_libdir}/optee_armtz
>      mkdir -p ${D}${bindir}
> +    mkdir -p ${D}${libdir}/tee-supplicant/plugins
>      install -D -p -m0755 ${B}/ca/* ${D}${bindir}
>      install -D -p -m0444 ${B}/ta/* ${D}${nonarch_base_libdir}/optee_armtz
> +    install -D -p -m0444 ${B}/plugins/* ${D}${libdir}/tee-supplicant/plugins
>  }
>
> -FILES_${PN} += "${nonarch_base_libdir}/optee_armtz/"
> +FILES_${PN} += "${nonarch_base_libdir}/optee_armtz/ \
> +                ${libdir}/tee-supplicant/plugins/ \
> +               "
>
>  # Imports machine specific configs from staging to build
>  PACKAGE_ARCH = "${MACHINE_ARCH}"
> diff --git a/meta-arm/recipes-security/optee/optee-examples/0001-make-Pass-ldflags-during-link.patch b/meta-arm/recipes-security/optee/optee-examples/0001-make-Pass-ldflags-during-link.patch
> deleted file mode 100644
> index 84202ef..0000000
> --- a/meta-arm/recipes-security/optee/optee-examples/0001-make-Pass-ldflags-during-link.patch
> +++ /dev/null
> @@ -1,103 +0,0 @@
> -From 29ae21de41f2fbab6dbecbbf408826b28de82df1 Mon Sep 17 00:00:00 2001
> -From: Khem Raj <raj.khem@gmail.com>
> -Date: Tue, 1 Sep 2020 21:09:56 -0700
> -Subject: [PATCH] make: Pass ldflags during link
> -
> -OpenEmbeeded needs to pass essential linker flags to set correct flags
> -for gnu_hash among others which sets the linking straight
> -using LDFLAGS varible here means, we can affect the linker flags
> -from build environment
> -
> -Upstream-Status: Submitted [https://github.com/linaro-swg/optee_examples/pull/85]
> -
> -Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ----
> - acipher/host/Makefile        | 2 +-
> - aes/host/Makefile            | 2 +-
> - hello_world/host/Makefile    | 2 +-
> - hotp/host/Makefile           | 2 +-
> - random/host/Makefile         | 2 +-
> - secure_storage/host/Makefile | 2 +-
> - 6 files changed, 6 insertions(+), 6 deletions(-)
> -
> -diff --git a/acipher/host/Makefile b/acipher/host/Makefile
> -index 8f4bc8a..c2cabef 100644
> ---- a/acipher/host/Makefile
> -+++ b/acipher/host/Makefile
> -@@ -18,7 +18,7 @@ BINARY = optee_example_acipher
> - all: $(BINARY)
> -
> - $(BINARY): $(OBJS)
> --      $(CC) -o $@ $< $(LDADD)
> -+      $(CC) -o $@ $< $(LDFLAGS) $(LDADD)
> -
> - .PHONY: clean
> - clean:
> -diff --git a/aes/host/Makefile b/aes/host/Makefile
> -index dfeb4e8..f61c71b 100644
> ---- a/aes/host/Makefile
> -+++ b/aes/host/Makefile
> -@@ -18,7 +18,7 @@ BINARY = optee_example_aes
> - all: $(BINARY)
> -
> - $(BINARY): $(OBJS)
> --      $(CC) -o $@ $< $(LDADD)
> -+      $(CC) -o $@ $< $(LDFLAGS) $(LDADD)
> -
> - .PHONY: clean
> - clean:
> -diff --git a/hello_world/host/Makefile b/hello_world/host/Makefile
> -index c4c8239..69cf42c 100644
> ---- a/hello_world/host/Makefile
> -+++ b/hello_world/host/Makefile
> -@@ -18,7 +18,7 @@ BINARY = optee_example_hello_world
> - all: $(BINARY)
> -
> - $(BINARY): $(OBJS)
> --      $(CC) -o $@ $< $(LDADD)
> -+      $(CC) -o $@ $< $(LDFLAGS) $(LDADD)
> -
> - .PHONY: clean
> - clean:
> -diff --git a/hotp/host/Makefile b/hotp/host/Makefile
> -index cb7fd19..e7f013f 100644
> ---- a/hotp/host/Makefile
> -+++ b/hotp/host/Makefile
> -@@ -18,7 +18,7 @@ BINARY = optee_example_hotp
> - all: $(BINARY)
> -
> - $(BINARY): $(OBJS)
> --      $(CC) -o $@ $< $(LDADD)
> -+      $(CC) -o $@ $< $(LDFLAGS) $(LDADD)
> -
> - .PHONY: clean
> - clean:
> -diff --git a/random/host/Makefile b/random/host/Makefile
> -index fd407d9..9377f7a 100644
> ---- a/random/host/Makefile
> -+++ b/random/host/Makefile
> -@@ -18,7 +18,7 @@ BINARY = optee_example_random
> - all: $(BINARY)
> -
> - $(BINARY): $(OBJS)
> --      $(CC) -o $@ $< $(LDADD)
> -+      $(CC) -o $@ $< $(LDFLAGS) $(LDADD)
> -
> - .PHONY: clean
> - clean:
> -diff --git a/secure_storage/host/Makefile b/secure_storage/host/Makefile
> -index 29bfb87..b3265ae 100644
> ---- a/secure_storage/host/Makefile
> -+++ b/secure_storage/host/Makefile
> -@@ -18,7 +18,7 @@ BINARY = optee_example_secure_storage
> - all: $(BINARY)
> -
> - $(BINARY): $(OBJS)
> --      $(CC) -o $@ $< $(LDADD)
> -+      $(CC) -o $@ $< $(LDFLAGS) $(LDADD)
> -
> - .PHONY: clean
> - clean:
> ---
> -2.28.0
> -
> diff --git a/meta-arm/recipes-security/optee/optee-examples/0001-plugins-Honour-default-cross-compiler-environment-se.patch b/meta-arm/recipes-security/optee/optee-examples/0001-plugins-Honour-default-cross-compiler-environment-se.patch
> new file mode 100644
> index 0000000..033e48c
> --- /dev/null
> +++ b/meta-arm/recipes-security/optee/optee-examples/0001-plugins-Honour-default-cross-compiler-environment-se.patch
> @@ -0,0 +1,84 @@
> +From 79c826c249001700007a6dffe80c3d61ff4428ef Mon Sep 17 00:00:00 2001
> +From: Sumit Garg <sumit.garg@linaro.org>
> +Date: Tue, 20 Jul 2021 13:54:30 +0530
> +Subject: [PATCH 1/2] plugins: Honour default cross compiler environment setup
> +
> +Honour default $(CC), $(CFLAGS) and $(LDFLAGS) variables. Without this
> +plugins example fails to build for OE/Yocto.
> +
> +Upstream-Status: Submitted [https://github.com/linaro-swg/optee_examples/pull/87]
> +
> +Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
> +---
> + plugins/Makefile        |  2 +-
> + plugins/host/Makefile   |  2 +-
> + plugins/syslog/Makefile | 16 ++++++++++++----
> + 3 files changed, 14 insertions(+), 6 deletions(-)
> +
> +diff --git a/plugins/Makefile b/plugins/Makefile
> +index 2372b38..ea472b4 100644
> +--- a/plugins/Makefile
> ++++ b/plugins/Makefile
> +@@ -8,7 +8,7 @@ TA_CROSS_COMPILE ?= $(CROSS_COMPILE)
> + all:
> +       $(MAKE) -C host CROSS_COMPILE="$(HOST_CROSS_COMPILE)" --no-builtin-variables
> +       $(MAKE) -C ta CROSS_COMPILE="$(TA_CROSS_COMPILE)" LDFLAGS=""
> +-      $(MAKE) -C syslog CROSS_COMPILE="$(HOST_CROSS_COMPILE)"
> ++      $(MAKE) -C syslog CROSS_COMPILE="$(HOST_CROSS_COMPILE)" --no-builtin-variables
> +
> + .PHONY: clean
> + clean:
> +diff --git a/plugins/host/Makefile b/plugins/host/Makefile
> +index 7285104..76244c7 100644
> +--- a/plugins/host/Makefile
> ++++ b/plugins/host/Makefile
> +@@ -20,7 +20,7 @@ BINARY = optee_example_plugins
> + all: $(BINARY)
> +
> + $(BINARY): $(OBJS)
> +-      $(CC) -o $@ $< $(LDADD)
> ++      $(CC) $(LDFLAGS) -o $@ $< $(LDADD)
> +
> + .PHONY: clean
> + clean:
> +diff --git a/plugins/syslog/Makefile b/plugins/syslog/Makefile
> +index 62d916a..71f5f92 100644
> +--- a/plugins/syslog/Makefile
> ++++ b/plugins/syslog/Makefile
> +@@ -1,3 +1,11 @@
> ++CC      ?= $(CROSS_COMPILE)gcc
> ++LD      ?= $(CROSS_COMPILE)ld
> ++AR      ?= $(CROSS_COMPILE)ar
> ++NM      ?= $(CROSS_COMPILE)nm
> ++OBJCOPY ?= $(CROSS_COMPILE)objcopy
> ++OBJDUMP ?= $(CROSS_COMPILE)objdump
> ++READELF ?= $(CROSS_COMPILE)readelf
> ++
> + PLUGIN_UUID = 96bcf744-4f72-4866-bf1d-8634fd9c65e5
> +
> + PLUGIN                        = $(PLUGIN_UUID).plugin
> +@@ -6,17 +14,17 @@ PLUGIN_OBJ          = $(patsubst %.c, %.o, $(PLUGIN_SRS))
> + PLUGIN_INCLUDES_DIR   = $(CURDIR) $(TEEC_EXPORT)/include
> +
> + PLUGIN_INCLUDES               = $(addprefix -I, $(PLUGIN_INCLUDES_DIR))
> +-PLUGIN_CCFLAGS                = -Wall -fPIC
> +-PLUGIN_LDFLAGS                = -shared
> ++PLUGIN_CCFLAGS                = $(CFLAGS) -Wall -fPIC
> ++PLUGIN_LDFLAGS                = $(LDFLAGS) -shared
> +
> + .PHONY: all
> + all: $(PLUGIN)
> +
> + $(PLUGIN): $(PLUGIN_OBJ)
> +-      $(CROSS_COMPILE)gcc $(PLUGIN_LDFLAGS) $(PLUGIN_OBJ) -o $@
> ++      $(CC) $(PLUGIN_LDFLAGS) $(PLUGIN_OBJ) -o $@
> +
> + %.o: %.c
> +-      $(CROSS_COMPILE)gcc $(PLUGIN_CCFLAGS) $(PLUGIN_INCLUDES) -c $*.c -o $*.o
> ++      $(CC) $(PLUGIN_CCFLAGS) $(PLUGIN_INCLUDES) -c $*.c -o $*.o
> +
> + .PHONY: clean
> + clean:
> +--
> +2.25.1
> +
> diff --git a/meta-arm/recipes-security/optee/optee-examples/0002-Makefile-Enable-plugins-installation-in-rootfs.patch b/meta-arm/recipes-security/optee/optee-examples/0002-Makefile-Enable-plugins-installation-in-rootfs.patch
> new file mode 100644
> index 0000000..8d1d60a
> --- /dev/null
> +++ b/meta-arm/recipes-security/optee/optee-examples/0002-Makefile-Enable-plugins-installation-in-rootfs.patch
> @@ -0,0 +1,39 @@
> +From a865f2e25e178fc2c4617eb1faf79ac922d02ffd Mon Sep 17 00:00:00 2001
> +From: Sumit Garg <sumit.garg@linaro.org>
> +Date: Tue, 20 Jul 2021 14:20:10 +0530
> +Subject: [PATCH 2/2] Makefile: Enable plugins installation in rootfs
> +
> +Upstream-Status: Submitted [https://github.com/linaro-swg/optee_examples/pull/87]
> +
> +Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
> +---
> + Makefile | 5 +++++
> + 1 file changed, 5 insertions(+)
> +
> +diff --git a/Makefile b/Makefile
> +index a275842..b3f16aa 100644
> +--- a/Makefile
> ++++ b/Makefile
> +@@ -25,14 +25,19 @@ prepare-for-rootfs: examples
> +       @mkdir -p $(OUTPUT_DIR)
> +       @mkdir -p $(OUTPUT_DIR)/ta
> +       @mkdir -p $(OUTPUT_DIR)/ca
> ++      @mkdir -p $(OUTPUT_DIR)/plugins
> +       @for example in $(EXAMPLE_LIST); do \
> +               if [ -e $$example/host/optee_example_$$example ]; then \
> +                       cp -p $$example/host/optee_example_$$example $(OUTPUT_DIR)/ca/; \
> +               fi; \
> +               cp -pr $$example/ta/*.ta $(OUTPUT_DIR)/ta/; \
> ++              if [ $$example == plugins ]; then \
> ++                      cp -p plugins/syslog/*.plugin $(OUTPUT_DIR)/plugins/; \
> ++              fi; \
> +       done
> +
> + prepare-for-rootfs-clean:
> +       @rm -rf $(OUTPUT_DIR)/ta
> +       @rm -rf $(OUTPUT_DIR)/ca
> ++      @rm -rf $(OUTPUT_DIR)/plugins
> +       @rmdir --ignore-fail-on-non-empty $(OUTPUT_DIR) || test ! -e $(OUTPUT_DIR)
> +--
> +2.25.1
> +
> diff --git a/meta-arm/recipes-security/optee/optee-examples_3.11.0.bb b/meta-arm/recipes-security/optee/optee-examples_3.11.0.bb
> deleted file mode 100644
> index 72473ed..0000000
> --- a/meta-arm/recipes-security/optee/optee-examples_3.11.0.bb
> +++ /dev/null
> @@ -1,4 +0,0 @@
> -require optee-examples.inc
> -
> -SRCREV = "9a7dc598591990349d88b4dba3a37aadd6851295"
> -
> diff --git a/meta-arm/recipes-security/optee/optee-examples_3.14.0.bb b/meta-arm/recipes-security/optee/optee-examples_3.14.0.bb
> new file mode 100644
> index 0000000..f2b5f7d
> --- /dev/null
> +++ b/meta-arm/recipes-security/optee/optee-examples_3.14.0.bb
> @@ -0,0 +1,4 @@
> +require optee-examples.inc
> +
> +SRCREV = "e9c870525af8f7e7fccf575a0ca5394ce55adcec"
> +
> diff --git a/meta-arm/recipes-security/optee/optee-os/0001-libutils-provide-empty-__getauxval-implementation.patch b/meta-arm/recipes-security/optee/optee-os/0001-libutils-provide-empty-__getauxval-implementation.patch
> deleted file mode 100644
> index 0120f5c..0000000
> --- a/meta-arm/recipes-security/optee/optee-os/0001-libutils-provide-empty-__getauxval-implementation.patch
> +++ /dev/null
> @@ -1,62 +0,0 @@
> -Upstream-Status: Backport
> -Signed-off-by: Ross Burton <ross.burton@arm.com>
> -
> -From 36e784f621bf5d5be9183beba35f39426277c110 Mon Sep 17 00:00:00 2001
> -From: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
> -Date: Tue, 13 Oct 2020 22:45:39 +0300
> -Subject: [PATCH 1/3] libutils: provide empty __getauxval() implementation
> -
> -Never version of libgcc are built with LSE implementation in mind. To
> -determine if LSE is available on platform it calls __getauxval(), so in
> -some cases we can get undefined reference to __getauxval() error.
> -
> -Prominent case is libgcc_eh.a library, which is used by C++ TAs. Exception
> -handler depends on atomic operations, so it tries to call
> -init_have_lse_atomics() first. This function in turn calls __getauxval(),
> -which causes linking error.
> -
> -In the future we can make __getauxval() to return actual platform
> -capabilities.
> -
> -Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
> -Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
> -Reviewed-by: Jerome Forissier <jerome@forissier.org>
> ----
> - lib/libutils/ext/arch/arm/auxval.c | 12 ++++++++++++
> - lib/libutils/ext/arch/arm/sub.mk   |  1 +
> - 2 files changed, 13 insertions(+)
> - create mode 100644 lib/libutils/ext/arch/arm/auxval.c
> -
> -diff --git a/lib/libutils/ext/arch/arm/auxval.c b/lib/libutils/ext/arch/arm/auxval.c
> -new file mode 100644
> -index 00000000..98bca850
> ---- /dev/null
> -+++ b/lib/libutils/ext/arch/arm/auxval.c
> -@@ -0,0 +1,12 @@
> -+// SPDX-License-Identifier: BSD-2-Clause
> -+/*
> -+ * Copyright (c) 2020, EPAM Systems
> -+ */
> -+
> -+#include <compiler.h>
> -+
> -+unsigned long int __getauxval (unsigned long int type);
> -+unsigned long int __getauxval (unsigned long int type __unused)
> -+{
> -+      return 0;
> -+}
> -diff --git a/lib/libutils/ext/arch/arm/sub.mk b/lib/libutils/ext/arch/arm/sub.mk
> -index dc5eed67..2e779066 100644
> ---- a/lib/libutils/ext/arch/arm/sub.mk
> -+++ b/lib/libutils/ext/arch/arm/sub.mk
> -@@ -3,6 +3,7 @@ srcs-$(CFG_ARM32_$(sm)) += aeabi_unwind.c
> - endif
> - srcs-$(CFG_ARM32_$(sm)) += atomic_a32.S
> - srcs-$(CFG_ARM64_$(sm)) += atomic_a64.S
> -+srcs-y += auxval.c
> - ifneq ($(sm),ldelf) # TA, core
> - srcs-$(CFG_ARM32_$(sm)) += mcount_a32.S
> - srcs-$(CFG_ARM64_$(sm)) += mcount_a64.S
> ---
> -2.25.1
> -
> diff --git a/meta-arm/recipes-security/optee/optee-os/0002-link.mk-implement-support-for-libnames-after-libgcc-.patch b/meta-arm/recipes-security/optee/optee-os/0002-link.mk-implement-support-for-libnames-after-libgcc-.patch
> deleted file mode 100644
> index 11296c8..0000000
> --- a/meta-arm/recipes-security/optee/optee-os/0002-link.mk-implement-support-for-libnames-after-libgcc-.patch
> +++ /dev/null
> @@ -1,55 +0,0 @@
> -Upstream-Status: Backport
> -Signed-off-by: Ross Burton <ross.burton@arm.com>
> -
> -From 73196b58ea6978ffa5e581738030f51c5789ef73 Mon Sep 17 00:00:00 2001
> -From: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
> -Date: Tue, 13 Oct 2020 22:54:13 +0300
> -Subject: [PATCH 2/3] link.mk: implement support for libnames-after-libgcc
> - variable
> -
> -Newer versions of libgcc depend on external __getauxval() symbol, which is
> -now provided by libutils. But libgcc is linked after libutils, so linker
> -can't resolve that symbol. We can't include libgcc into linking group with
> -libtutils, because libgcc provides symbols that conflict with libutil's
> -ones, like __aeabi_idiv with friends for instance.
> -
> -So, to resolve libgcc dependency on libutils we need to link with libutils
> -second time. To make things more generic, we will introduce
> -$(libnames-after-libgcc) variable for libraries that should be linked after
> -libgcc.
> -
> -Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
> -Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
> -Reviewed-by: Jerome Forissier <jerome@forissier.org>
> ----
> - ta/arch/arm/link.mk | 6 +++++-
> - 1 file changed, 5 insertions(+), 1 deletion(-)
> -
> -diff --git a/ta/arch/arm/link.mk b/ta/arch/arm/link.mk
> -index 445c285d..3025acb1 100644
> ---- a/ta/arch/arm/link.mk
> -+++ b/ta/arch/arm/link.mk
> -@@ -55,8 +55,11 @@ link-ldflags += --eh-frame-hdr
> - link-ldadd += $(libstdc++$(sm)) $(libgcc_eh$(sm))
> - endif
> - link-ldadd += --end-group
> --ldargs-$(user-ta-uuid).elf := $(link-ldflags) $(objs) $(link-ldadd) $(libgcc$(sm))
> -
> -+link-ldadd-after-libgcc += $(addprefix -l,$(libnames-after-libgcc))
> -+
> -+ldargs-$(user-ta-uuid).elf := $(link-ldflags) $(objs) $(link-ldadd) \
> -+                              $(libgcc$(sm)) $(link-ldadd-after-libgcc)
> -
> - link-script-cppflags-$(sm) := \
> -       $(filter-out $(CPPFLAGS_REMOVE) $(cppflags-remove), \
> -@@ -76,6 +79,7 @@ $(link-script-pp$(sm)): $(link-script$(sm)) $(conf-file) $(link-script-pp-makefi
> -               $(link-script-cppflags-$(sm)) $$< -o $$@
> -
> - $(link-out-dir$(sm))/$(user-ta-uuid).elf: $(objs) $(libdeps) \
> -+                                        $(libdeps-after-libgcc) \
> -                                         $(link-script-pp$(sm)) \
> -                                         $(dynlistdep) \
> -                                         $(additional-link-deps)
> ---
> -2.25.1
> -
> diff --git a/meta-arm/recipes-security/optee/optee-os/0003-ta_dev_kit.mk-make-sure-that-libutils-is-linked-seco.patch b/meta-arm/recipes-security/optee/optee-os/0003-ta_dev_kit.mk-make-sure-that-libutils-is-linked-seco.patch
> deleted file mode 100644
> index 88ba5f8..0000000
> --- a/meta-arm/recipes-security/optee/optee-os/0003-ta_dev_kit.mk-make-sure-that-libutils-is-linked-seco.patch
> +++ /dev/null
> @@ -1,44 +0,0 @@
> -Upstream-Status: Backport
> -Signed-off-by: Ross Burton <ross.burton@arm.com>
> -
> -From f50962e3f56f0932662b2ffa10afe53339a335dd Mon Sep 17 00:00:00 2001
> -From: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
> -Date: Fri, 16 Oct 2020 16:36:08 +0300
> -Subject: [PATCH 3/3] ta_dev_kit.mk: make sure that libutils is linked second
> - time
> -
> -libgcc depends on __getauxval symbol from libuils. As, generally libutils
> -is linked before libgcc, we will get "unresolved symbol" error. To resolve
> -this dependency we need to link libutils second time - after libgcc.
> -
> -Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
> -Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
> -Reviewed-by: Jerome Forissier <jerome@forissier.org>
> ----
> - ta/mk/ta_dev_kit.mk | 10 ++++++++++
> - 1 file changed, 10 insertions(+)
> -
> -diff --git a/ta/mk/ta_dev_kit.mk b/ta/mk/ta_dev_kit.mk
> -index e28be677..d0e66317 100644
> ---- a/ta/mk/ta_dev_kit.mk
> -+++ b/ta/mk/ta_dev_kit.mk
> -@@ -78,6 +78,16 @@ endif
> - libnames += dl
> - libdeps += $(ta-dev-kit-dir$(sm))/lib/libdl.a
> -
> -+# libutils provides __getauxval symbol which is needed by libgcc 10.x. We can't
> -+# link libutils after libgcc, because libgcc will replace some symbols provided
> -+# by libutils, which will cause further linking issues.
> -+#
> -+# But if we place libutils before libgcc, linker will not be able to resolve
> -+# __getauxval. So we need to link with libutils twice: before and after libgcc.
> -+# Hence it included both in $(libnames) and in $(libnames-after-libgcc)
> -+libnames-after-libgcc += utils
> -+libdeps-after-libgcc += $(ta-dev-kit-dir$(sm))/lib/libutils.a
> -+
> - # Pass config variable (CFG_) from conf.mk on the command line
> - cppflags$(sm) += $(strip \
> -       $(foreach var, $(filter CFG_%,$(.VARIABLES)), \
> ---
> -2.25.1
> -
> diff --git a/meta-arm/recipes-security/optee/optee-os_3.11.0.bb b/meta-arm/recipes-security/optee/optee-os_3.11.0.bb
> deleted file mode 100644
> index 13b3dc6..0000000
> --- a/meta-arm/recipes-security/optee/optee-os_3.11.0.bb
> +++ /dev/null
> @@ -1,11 +0,0 @@
> -require optee-os.inc
> -
> -SRCREV = "c4def2a8262a03244d9a88461699b9b8e43c6b55"
> -
> -SRC_URI_append = " \
> -    file://0006-allow-setting-sysroot-for-libgcc-lookup.patch \
> -    file://0007-allow-setting-sysroot-for-clang.patch \
> -    file://0001-libutils-provide-empty-__getauxval-implementation.patch \
> -    file://0002-link.mk-implement-support-for-libnames-after-libgcc-.patch \
> -    file://0003-ta_dev_kit.mk-make-sure-that-libutils-is-linked-seco.patch \
> -"
> diff --git a/meta-arm/recipes-security/optee/optee-os_3.14.0.bb b/meta-arm/recipes-security/optee/optee-os_3.14.0.bb
> new file mode 100644
> index 0000000..3289e2c
> --- /dev/null
> +++ b/meta-arm/recipes-security/optee/optee-os_3.14.0.bb
> @@ -0,0 +1,8 @@
> +require optee-os.inc
> +
> +SRCREV = "d21befa5e53eae9db469eba1685f5aa5c6f92c2f"
> +
> +SRC_URI_append = " \
> +    file://0006-allow-setting-sysroot-for-libgcc-lookup.patch \
> +    file://0007-allow-setting-sysroot-for-clang.patch \
> +"
> diff --git a/meta-arm/recipes-security/optee/optee-test.inc b/meta-arm/recipes-security/optee/optee-test.inc
> index f09b9d2..bcbcc06 100644
> --- a/meta-arm/recipes-security/optee/optee-test.inc
> +++ b/meta-arm/recipes-security/optee/optee-test.inc
> @@ -8,17 +8,9 @@ LIC_FILES_CHKSUM = "file://${S}/LICENSE.md;md5=daa2bcccc666345ab8940aab1315a4fa"
>  inherit python3native ptest
>  require optee.inc
>
> -# Linking fails on musl due to C++/threads
> -# https://github.com/OP-TEE/optee_test/issues/458#issuecomment-720540834
> -# When upgraded we should be able to remove this limitation
> -COMPATIBLE_HOST_libc-musl = 'null'
> -
>  DEPENDS = "optee-client optee-os python3-pycryptodome-native"
>
>  SRC_URI = "git://github.com/OP-TEE/optee_test.git \
> -           file://0001-host-xtest-Adjust-order-of-including-compiler.h.patch \
> -           file://0002-make-remove-Wno-unsafe-loop-for-clang.patch \
> -           file://0003-make-remove-Wmissing-noreturn-for-clang.patch \
>             file://run-ptest \
>            "
>
> @@ -36,6 +28,7 @@ do_compile() {
>      # Top level makefile doesn't seem to handle parallel make gracefully
>      oe_runmake xtest
>      oe_runmake ta
> +    oe_runmake test_plugin
>  }
>  do_compile[cleandirs] = "${B}"
>
> @@ -46,9 +39,13 @@ do_install () {
>      # default TEEC_LOAD_PATH is /lib
>      mkdir -p ${D}${nonarch_base_libdir}/optee_armtz/
>      install -D -p -m0444 ${B}/ta/*/*.ta ${D}${nonarch_base_libdir}/optee_armtz/
> +    mkdir -p ${D}${libdir}/tee-supplicant/plugins
> +    install -D -p -m0444 ${B}/supp_plugin/*.plugin ${D}${libdir}/tee-supplicant/plugins/
>  }
>
> -FILES_${PN} += "${nonarch_base_libdir}/optee_armtz/"
> +FILES_${PN} += "${nonarch_base_libdir}/optee_armtz/ \
> +                ${libdir}/tee-supplicant/plugins/ \
> +               "
>
>  # Imports machine specific configs from staging to build
>  PACKAGE_ARCH = "${MACHINE_ARCH}"
> diff --git a/meta-arm/recipes-security/optee/optee-test/0001-host-xtest-Adjust-order-of-including-compiler.h.patch b/meta-arm/recipes-security/optee/optee-test/0001-host-xtest-Adjust-order-of-including-compiler.h.patch
> deleted file mode 100644
> index 3c500d7..0000000
> --- a/meta-arm/recipes-security/optee/optee-test/0001-host-xtest-Adjust-order-of-including-compiler.h.patch
> +++ /dev/null
> @@ -1,64 +0,0 @@
> -From fc95b3ccbbfd336797ae2cfd6dd4dc58644e146f Mon Sep 17 00:00:00 2001
> -From: Khem Raj <raj.khem@gmail.com>
> -Date: Sat, 30 May 2020 17:52:18 -0700
> -Subject: [PATCH] host/xtest: Adjust order of including compiler.h
> -
> -compiler.h defines some defines which violate libc namespace e.g.
> -__unused, this works ok with glibc but fails in awkward ways with musl
> -the reason is musl uses __unused in its internal structures and this
> -define in compiler.h conflicts with system headers causing errors like
> -
> -recipe-sysroot/usr/include/bits/stat.h:17:19: error: expected identifier or '(' before '[' token unsigned __unused[2];
> -                   ^
> -including compiler.h afer sys/stat.h fixes the problem.
> -
> -Upstream-Status: Pending [https://github.com/OP-TEE/optee_test/issues/453]
> -Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ----
> - host/xtest/install_ta.c | 2 +-
> - host/xtest/stats.c      | 2 +-
> - 2 files changed, 2 insertions(+), 2 deletions(-)
> -
> -diff --git a/host/xtest/install_ta.c b/host/xtest/install_ta.c
> -index 09a4c6d..6f7bb5c 100644
> ---- a/host/xtest/install_ta.c
> -+++ b/host/xtest/install_ta.c
> -@@ -4,7 +4,6 @@
> -  * SPDX-License-Identifier: BSD-2-Clause
> -  */
> -
> --#include <compiler.h>
> - #include <dirent.h>
> - #include <err.h>
> - #include <errno.h>
> -@@ -20,6 +19,7 @@
> - #include <sys/types.h>
> - #include <tee_client_api.h>
> - #include <unistd.h>
> -+#include <compiler.h>
> -
> - #include "install_ta.h"
> - #include "xtest_helpers.h"
> -diff --git a/host/xtest/stats.c b/host/xtest/stats.c
> -index 96b0b5f..db9bf25 100644
> ---- a/host/xtest/stats.c
> -+++ b/host/xtest/stats.c
> -@@ -3,7 +3,6 @@
> -  * Copyright (c) 2019, Linaro Limited
> -  */
> -
> --#include <compiler.h>
> - #include <dirent.h>
> - #include <err.h>
> - #include <errno.h>
> -@@ -18,6 +17,7 @@
> - #include <sys/types.h>
> - #include <tee_client_api.h>
> - #include <unistd.h>
> -+#include <compiler.h>
> - #include "xtest_test.h"
> - #include "stats.h"
> -
> ---
> -2.26.2
> -
> diff --git a/meta-arm/recipes-security/optee/optee-test/0002-make-remove-Wno-unsafe-loop-for-clang.patch b/meta-arm/recipes-security/optee/optee-test/0002-make-remove-Wno-unsafe-loop-for-clang.patch
> deleted file mode 100644
> index 17dd7d8..0000000
> --- a/meta-arm/recipes-security/optee/optee-test/0002-make-remove-Wno-unsafe-loop-for-clang.patch
> +++ /dev/null
> @@ -1,31 +0,0 @@
> -From 438533ce9da1df0b7c7914e64b39ffdc1da1ab79 Mon Sep 17 00:00:00 2001
> -From: Brett Warren <brett.warran@arm.com>
> -Date: Thu, 8 Oct 2020 10:03:25 +0100
> -Subject: [PATCH] make: remove -Wmissing-noreturn for clang
> -
> -When compiling when clang, -Wmissing-noreturn causes an error because
> -of non-compliant code. This option is removed to workaround this.
> -
> -Upstream-Status: Pending [https://github.com/OP-TEE/optee_test/issues/452]
> -Changed-Id: 71cb511904547d790d1ea98f93bf8e5a6afcb36d
> -Signed-off-by: Brett Warren <brett.warren@arm.com>
> ----
> - host/xtest/Makefile | 2 +-
> - 1 file changed, 1 insertion(+), 1 deletion(-)
> -
> -diff --git a/host/xtest/Makefile b/host/xtest/Makefile
> -index 3c206b0..96746de 100644
> ---- a/host/xtest/Makefile
> -+++ b/host/xtest/Makefile
> -@@ -169,7 +169,7 @@ CFLAGS += -Wall -Wcast-align -Werror \
> -         -Werror-implicit-function-declaration -Wextra -Wfloat-equal \
> -         -Wformat-nonliteral -Wformat-security -Wformat=2 -Winit-self \
> -         -Wmissing-declarations -Wmissing-format-attribute \
> --        -Wmissing-include-dirs -Wmissing-noreturn \
> -+        -Wmissing-include-dirs \
> -         -Wmissing-prototypes -Wnested-externs -Wpointer-arith \
> -         -Wshadow -Wstrict-prototypes -Wswitch-default \
> -         -Wwrite-strings \
> ---
> -2.17.1
> -
> diff --git a/meta-arm/recipes-security/optee/optee-test/0003-make-remove-Wmissing-noreturn-for-clang.patch b/meta-arm/recipes-security/optee/optee-test/0003-make-remove-Wmissing-noreturn-for-clang.patch
> deleted file mode 100644
> index bbc303f..0000000
> --- a/meta-arm/recipes-security/optee/optee-test/0003-make-remove-Wmissing-noreturn-for-clang.patch
> +++ /dev/null
> @@ -1,31 +0,0 @@
> -From ed5a9d9f7a3e9e14ca0e8aea59008124ee0e5f96 Mon Sep 17 00:00:00 2001
> -From: Brett Warren <brett.warren@arm.com>
> -Date: Thu, 8 Oct 2020 10:20:52 +0100
> -Subject: [PATCH] make: remove -Wno-unsafe-loop for clang
> -
> -When compiling with clang, the -Wno-unsafe-loop-optimizations option
> -throws an error because clang doesn't recognise it. This option is
> -removed to workaround this.
> -
> -Upstream-Status: Pending [https://github.com/OP-TEE/optee_test/issues/452]
> -Change-Id: 5fe0892c73208aaffac8c9995cb3275936fb1ba6
> -Signed-off-by: Brett Warren <brett.warren@arm.com>
> ----
> - host/xtest/Makefile | 1 -
> - 1 file changed, 1 deletion(-)
> -
> -diff --git a/host/xtest/Makefile b/host/xtest/Makefile
> -index 96746de..73731d0 100644
> ---- a/host/xtest/Makefile
> -+++ b/host/xtest/Makefile
> -@@ -174,7 +174,6 @@ CFLAGS += -Wall -Wcast-align -Werror \
> -         -Wshadow -Wstrict-prototypes -Wswitch-default \
> -         -Wwrite-strings \
> -         -Wno-declaration-after-statement \
> --        -Wno-unsafe-loop-optimizations \
> -         -Wno-missing-field-initializers -Wno-format-zero-length
> - endif
> -
> ---
> -2.17.1
> -
> diff --git a/meta-arm/recipes-security/optee/optee-test_3.11.0.bb b/meta-arm/recipes-security/optee/optee-test_3.11.0.bb
> deleted file mode 100644
> index 0f8b5b0..0000000
> --- a/meta-arm/recipes-security/optee/optee-test_3.11.0.bb
> +++ /dev/null
> @@ -1,3 +0,0 @@
> -require optee-test.inc
> -
> -SRCREV = "159e295d5cc3ad2275ab15fe544620f6604d4ba4"
> diff --git a/meta-arm/recipes-security/optee/optee-test_3.14.0.bb b/meta-arm/recipes-security/optee/optee-test_3.14.0.bb
> new file mode 100644
> index 0000000..6367c27
> --- /dev/null
> +++ b/meta-arm/recipes-security/optee/optee-test_3.14.0.bb
> @@ -0,0 +1,3 @@
> +require optee-test.inc
> +
> +SRCREV = "f2eb88affbb7f028561b4fd5cbd049d5d704f741"
> --
> 2.25.1
>
>
> 
>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [meta-arm] [PATCH] arm/optee: version uplift 3.11.0 -> 3.14.0
  2021-07-23 19:06 ` Ross Burton
@ 2021-07-26  7:09   ` Sumit Garg
  2021-07-26 14:01     ` Jon Mason
  0 siblings, 1 reply; 11+ messages in thread
From: Sumit Garg @ 2021-07-26  7:09 UTC (permalink / raw)
  To: Ross Burton; +Cc: meta-arm, Jon Mason, Ross Burton

Hi Ross,

On Sat, 24 Jul 2021 at 00:36, Ross Burton <ross@burtonini.com> wrote:
>
> The optee-examples recipe is broken:
>
> install: cannot stat
> '/builds/engineering/yocto/meta-arm/work/build/tmp/work/qemuarm64_secureboot-poky-linux/optee-examples/3.14.0-r0/build/plugins/*':
> No such file or directory
>
> (qemuarm64-secureboot can build it)
>

Strangely, it works fine for me when building for
qemuarm64-secureboot. Can you check if the following patches have been
correctly applied in the corresponding work directory?

           file://0001-plugins-Honour-default-cross-compiler-environment-se.patch
\
           file://0002-Makefile-Enable-plugins-installation-in-rootfs.patch \

-Sumit

> Ross
>
> On Tue, 20 Jul 2021 at 11:07, Sumit Garg <sumit.garg@linaro.org> wrote:
> >
> > Brief description of changes:
> > - Version uplift 3.11.0 -> 3.14.0.
> > - Removed OP-TEE patches that has already been accepted upstream.
> > - Added support for tee-supplicant plugin framework testing.
> >
> > Tested on qemuarm64_secureboot:
> > $ xtest -l 15
> > $ optee-examples_*
> >
> > Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
> > ---
> >  .../optee/optee-client_3.11.0.bb              |   3 -
> >  .../optee/optee-client_3.14.0.bb              |   3 +
> >  .../recipes-security/optee/optee-examples.inc |   9 +-
> >  .../0001-make-Pass-ldflags-during-link.patch  | 103 ------------------
> >  ...efault-cross-compiler-environment-se.patch |  84 ++++++++++++++
> >  ...nable-plugins-installation-in-rootfs.patch |  39 +++++++
> >  .../optee/optee-examples_3.11.0.bb            |   4 -
> >  .../optee/optee-examples_3.14.0.bb            |   4 +
> >  ...ide-empty-__getauxval-implementation.patch |  62 -----------
> >  ...t-support-for-libnames-after-libgcc-.patch |  55 ----------
> >  ...ke-sure-that-libutils-is-linked-seco.patch |  44 --------
> >  .../recipes-security/optee/optee-os_3.11.0.bb |  11 --
> >  .../recipes-security/optee/optee-os_3.14.0.bb |   8 ++
> >  .../recipes-security/optee/optee-test.inc     |  15 +--
> >  ...Adjust-order-of-including-compiler.h.patch |  64 -----------
> >  ...ake-remove-Wno-unsafe-loop-for-clang.patch |  31 ------
> >  ...e-remove-Wmissing-noreturn-for-clang.patch |  31 ------
> >  .../optee/optee-test_3.11.0.bb                |   3 -
> >  .../optee/optee-test_3.14.0.bb                |   3 +
> >  19 files changed, 154 insertions(+), 422 deletions(-)
> >  delete mode 100644 meta-arm/recipes-security/optee/optee-client_3.11.0.bb
> >  create mode 100644 meta-arm/recipes-security/optee/optee-client_3.14.0.bb
> >  delete mode 100644 meta-arm/recipes-security/optee/optee-examples/0001-make-Pass-ldflags-during-link.patch
> >  create mode 100644 meta-arm/recipes-security/optee/optee-examples/0001-plugins-Honour-default-cross-compiler-environment-se.patch
> >  create mode 100644 meta-arm/recipes-security/optee/optee-examples/0002-Makefile-Enable-plugins-installation-in-rootfs.patch
> >  delete mode 100644 meta-arm/recipes-security/optee/optee-examples_3.11.0.bb
> >  create mode 100644 meta-arm/recipes-security/optee/optee-examples_3.14.0.bb
> >  delete mode 100644 meta-arm/recipes-security/optee/optee-os/0001-libutils-provide-empty-__getauxval-implementation.patch
> >  delete mode 100644 meta-arm/recipes-security/optee/optee-os/0002-link.mk-implement-support-for-libnames-after-libgcc-.patch
> >  delete mode 100644 meta-arm/recipes-security/optee/optee-os/0003-ta_dev_kit.mk-make-sure-that-libutils-is-linked-seco.patch
> >  delete mode 100644 meta-arm/recipes-security/optee/optee-os_3.11.0.bb
> >  create mode 100644 meta-arm/recipes-security/optee/optee-os_3.14.0.bb
> >  delete mode 100644 meta-arm/recipes-security/optee/optee-test/0001-host-xtest-Adjust-order-of-including-compiler.h.patch
> >  delete mode 100644 meta-arm/recipes-security/optee/optee-test/0002-make-remove-Wno-unsafe-loop-for-clang.patch
> >  delete mode 100644 meta-arm/recipes-security/optee/optee-test/0003-make-remove-Wmissing-noreturn-for-clang.patch
> >  delete mode 100644 meta-arm/recipes-security/optee/optee-test_3.11.0.bb
> >  create mode 100644 meta-arm/recipes-security/optee/optee-test_3.14.0.bb
> >
> > diff --git a/meta-arm/recipes-security/optee/optee-client_3.11.0.bb b/meta-arm/recipes-security/optee/optee-client_3.11.0.bb
> > deleted file mode 100644
> > index f765d12..0000000
> > --- a/meta-arm/recipes-security/optee/optee-client_3.11.0.bb
> > +++ /dev/null
> > @@ -1,3 +0,0 @@
> > -require optee-client.inc
> > -
> > -SRCREV = "c0c925384c1d7e3558d27d2708857482952d7907"
> > diff --git a/meta-arm/recipes-security/optee/optee-client_3.14.0.bb b/meta-arm/recipes-security/optee/optee-client_3.14.0.bb
> > new file mode 100644
> > index 0000000..be78b88
> > --- /dev/null
> > +++ b/meta-arm/recipes-security/optee/optee-client_3.14.0.bb
> > @@ -0,0 +1,3 @@
> > +require optee-client.inc
> > +
> > +SRCREV = "06e1b32f6a7028e039c625b07cfc25fda0c17d53"
> > diff --git a/meta-arm/recipes-security/optee/optee-examples.inc b/meta-arm/recipes-security/optee/optee-examples.inc
> > index 81c31bc..f2e53f3 100644
> > --- a/meta-arm/recipes-security/optee/optee-examples.inc
> > +++ b/meta-arm/recipes-security/optee/optee-examples.inc
> > @@ -12,7 +12,8 @@ inherit python3native
> >  require optee.inc
> >
> >  SRC_URI = "git://github.com/linaro-swg/optee_examples.git \
> > -           file://0001-make-Pass-ldflags-during-link.patch \
> > +           file://0001-plugins-Honour-default-cross-compiler-environment-se.patch \
> > +           file://0002-Makefile-Enable-plugins-installation-in-rootfs.patch \
> >            "
> >
> >  EXTRA_OEMAKE += "TA_DEV_KIT_DIR=${TA_DEV_KIT_DIR} \
> > @@ -32,11 +33,15 @@ do_compile[cleandirs] = "${B}"
> >  do_install () {
> >      mkdir -p ${D}${nonarch_base_libdir}/optee_armtz
> >      mkdir -p ${D}${bindir}
> > +    mkdir -p ${D}${libdir}/tee-supplicant/plugins
> >      install -D -p -m0755 ${B}/ca/* ${D}${bindir}
> >      install -D -p -m0444 ${B}/ta/* ${D}${nonarch_base_libdir}/optee_armtz
> > +    install -D -p -m0444 ${B}/plugins/* ${D}${libdir}/tee-supplicant/plugins
> >  }
> >
> > -FILES_${PN} += "${nonarch_base_libdir}/optee_armtz/"
> > +FILES_${PN} += "${nonarch_base_libdir}/optee_armtz/ \
> > +                ${libdir}/tee-supplicant/plugins/ \
> > +               "
> >
> >  # Imports machine specific configs from staging to build
> >  PACKAGE_ARCH = "${MACHINE_ARCH}"
> > diff --git a/meta-arm/recipes-security/optee/optee-examples/0001-make-Pass-ldflags-during-link.patch b/meta-arm/recipes-security/optee/optee-examples/0001-make-Pass-ldflags-during-link.patch
> > deleted file mode 100644
> > index 84202ef..0000000
> > --- a/meta-arm/recipes-security/optee/optee-examples/0001-make-Pass-ldflags-during-link.patch
> > +++ /dev/null
> > @@ -1,103 +0,0 @@
> > -From 29ae21de41f2fbab6dbecbbf408826b28de82df1 Mon Sep 17 00:00:00 2001
> > -From: Khem Raj <raj.khem@gmail.com>
> > -Date: Tue, 1 Sep 2020 21:09:56 -0700
> > -Subject: [PATCH] make: Pass ldflags during link
> > -
> > -OpenEmbeeded needs to pass essential linker flags to set correct flags
> > -for gnu_hash among others which sets the linking straight
> > -using LDFLAGS varible here means, we can affect the linker flags
> > -from build environment
> > -
> > -Upstream-Status: Submitted [https://github.com/linaro-swg/optee_examples/pull/85]
> > -
> > -Signed-off-by: Khem Raj <raj.khem@gmail.com>
> > ----
> > - acipher/host/Makefile        | 2 +-
> > - aes/host/Makefile            | 2 +-
> > - hello_world/host/Makefile    | 2 +-
> > - hotp/host/Makefile           | 2 +-
> > - random/host/Makefile         | 2 +-
> > - secure_storage/host/Makefile | 2 +-
> > - 6 files changed, 6 insertions(+), 6 deletions(-)
> > -
> > -diff --git a/acipher/host/Makefile b/acipher/host/Makefile
> > -index 8f4bc8a..c2cabef 100644
> > ---- a/acipher/host/Makefile
> > -+++ b/acipher/host/Makefile
> > -@@ -18,7 +18,7 @@ BINARY = optee_example_acipher
> > - all: $(BINARY)
> > -
> > - $(BINARY): $(OBJS)
> > --      $(CC) -o $@ $< $(LDADD)
> > -+      $(CC) -o $@ $< $(LDFLAGS) $(LDADD)
> > -
> > - .PHONY: clean
> > - clean:
> > -diff --git a/aes/host/Makefile b/aes/host/Makefile
> > -index dfeb4e8..f61c71b 100644
> > ---- a/aes/host/Makefile
> > -+++ b/aes/host/Makefile
> > -@@ -18,7 +18,7 @@ BINARY = optee_example_aes
> > - all: $(BINARY)
> > -
> > - $(BINARY): $(OBJS)
> > --      $(CC) -o $@ $< $(LDADD)
> > -+      $(CC) -o $@ $< $(LDFLAGS) $(LDADD)
> > -
> > - .PHONY: clean
> > - clean:
> > -diff --git a/hello_world/host/Makefile b/hello_world/host/Makefile
> > -index c4c8239..69cf42c 100644
> > ---- a/hello_world/host/Makefile
> > -+++ b/hello_world/host/Makefile
> > -@@ -18,7 +18,7 @@ BINARY = optee_example_hello_world
> > - all: $(BINARY)
> > -
> > - $(BINARY): $(OBJS)
> > --      $(CC) -o $@ $< $(LDADD)
> > -+      $(CC) -o $@ $< $(LDFLAGS) $(LDADD)
> > -
> > - .PHONY: clean
> > - clean:
> > -diff --git a/hotp/host/Makefile b/hotp/host/Makefile
> > -index cb7fd19..e7f013f 100644
> > ---- a/hotp/host/Makefile
> > -+++ b/hotp/host/Makefile
> > -@@ -18,7 +18,7 @@ BINARY = optee_example_hotp
> > - all: $(BINARY)
> > -
> > - $(BINARY): $(OBJS)
> > --      $(CC) -o $@ $< $(LDADD)
> > -+      $(CC) -o $@ $< $(LDFLAGS) $(LDADD)
> > -
> > - .PHONY: clean
> > - clean:
> > -diff --git a/random/host/Makefile b/random/host/Makefile
> > -index fd407d9..9377f7a 100644
> > ---- a/random/host/Makefile
> > -+++ b/random/host/Makefile
> > -@@ -18,7 +18,7 @@ BINARY = optee_example_random
> > - all: $(BINARY)
> > -
> > - $(BINARY): $(OBJS)
> > --      $(CC) -o $@ $< $(LDADD)
> > -+      $(CC) -o $@ $< $(LDFLAGS) $(LDADD)
> > -
> > - .PHONY: clean
> > - clean:
> > -diff --git a/secure_storage/host/Makefile b/secure_storage/host/Makefile
> > -index 29bfb87..b3265ae 100644
> > ---- a/secure_storage/host/Makefile
> > -+++ b/secure_storage/host/Makefile
> > -@@ -18,7 +18,7 @@ BINARY = optee_example_secure_storage
> > - all: $(BINARY)
> > -
> > - $(BINARY): $(OBJS)
> > --      $(CC) -o $@ $< $(LDADD)
> > -+      $(CC) -o $@ $< $(LDFLAGS) $(LDADD)
> > -
> > - .PHONY: clean
> > - clean:
> > ---
> > -2.28.0
> > -
> > diff --git a/meta-arm/recipes-security/optee/optee-examples/0001-plugins-Honour-default-cross-compiler-environment-se.patch b/meta-arm/recipes-security/optee/optee-examples/0001-plugins-Honour-default-cross-compiler-environment-se.patch
> > new file mode 100644
> > index 0000000..033e48c
> > --- /dev/null
> > +++ b/meta-arm/recipes-security/optee/optee-examples/0001-plugins-Honour-default-cross-compiler-environment-se.patch
> > @@ -0,0 +1,84 @@
> > +From 79c826c249001700007a6dffe80c3d61ff4428ef Mon Sep 17 00:00:00 2001
> > +From: Sumit Garg <sumit.garg@linaro.org>
> > +Date: Tue, 20 Jul 2021 13:54:30 +0530
> > +Subject: [PATCH 1/2] plugins: Honour default cross compiler environment setup
> > +
> > +Honour default $(CC), $(CFLAGS) and $(LDFLAGS) variables. Without this
> > +plugins example fails to build for OE/Yocto.
> > +
> > +Upstream-Status: Submitted [https://github.com/linaro-swg/optee_examples/pull/87]
> > +
> > +Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
> > +---
> > + plugins/Makefile        |  2 +-
> > + plugins/host/Makefile   |  2 +-
> > + plugins/syslog/Makefile | 16 ++++++++++++----
> > + 3 files changed, 14 insertions(+), 6 deletions(-)
> > +
> > +diff --git a/plugins/Makefile b/plugins/Makefile
> > +index 2372b38..ea472b4 100644
> > +--- a/plugins/Makefile
> > ++++ b/plugins/Makefile
> > +@@ -8,7 +8,7 @@ TA_CROSS_COMPILE ?= $(CROSS_COMPILE)
> > + all:
> > +       $(MAKE) -C host CROSS_COMPILE="$(HOST_CROSS_COMPILE)" --no-builtin-variables
> > +       $(MAKE) -C ta CROSS_COMPILE="$(TA_CROSS_COMPILE)" LDFLAGS=""
> > +-      $(MAKE) -C syslog CROSS_COMPILE="$(HOST_CROSS_COMPILE)"
> > ++      $(MAKE) -C syslog CROSS_COMPILE="$(HOST_CROSS_COMPILE)" --no-builtin-variables
> > +
> > + .PHONY: clean
> > + clean:
> > +diff --git a/plugins/host/Makefile b/plugins/host/Makefile
> > +index 7285104..76244c7 100644
> > +--- a/plugins/host/Makefile
> > ++++ b/plugins/host/Makefile
> > +@@ -20,7 +20,7 @@ BINARY = optee_example_plugins
> > + all: $(BINARY)
> > +
> > + $(BINARY): $(OBJS)
> > +-      $(CC) -o $@ $< $(LDADD)
> > ++      $(CC) $(LDFLAGS) -o $@ $< $(LDADD)
> > +
> > + .PHONY: clean
> > + clean:
> > +diff --git a/plugins/syslog/Makefile b/plugins/syslog/Makefile
> > +index 62d916a..71f5f92 100644
> > +--- a/plugins/syslog/Makefile
> > ++++ b/plugins/syslog/Makefile
> > +@@ -1,3 +1,11 @@
> > ++CC      ?= $(CROSS_COMPILE)gcc
> > ++LD      ?= $(CROSS_COMPILE)ld
> > ++AR      ?= $(CROSS_COMPILE)ar
> > ++NM      ?= $(CROSS_COMPILE)nm
> > ++OBJCOPY ?= $(CROSS_COMPILE)objcopy
> > ++OBJDUMP ?= $(CROSS_COMPILE)objdump
> > ++READELF ?= $(CROSS_COMPILE)readelf
> > ++
> > + PLUGIN_UUID = 96bcf744-4f72-4866-bf1d-8634fd9c65e5
> > +
> > + PLUGIN                        = $(PLUGIN_UUID).plugin
> > +@@ -6,17 +14,17 @@ PLUGIN_OBJ          = $(patsubst %.c, %.o, $(PLUGIN_SRS))
> > + PLUGIN_INCLUDES_DIR   = $(CURDIR) $(TEEC_EXPORT)/include
> > +
> > + PLUGIN_INCLUDES               = $(addprefix -I, $(PLUGIN_INCLUDES_DIR))
> > +-PLUGIN_CCFLAGS                = -Wall -fPIC
> > +-PLUGIN_LDFLAGS                = -shared
> > ++PLUGIN_CCFLAGS                = $(CFLAGS) -Wall -fPIC
> > ++PLUGIN_LDFLAGS                = $(LDFLAGS) -shared
> > +
> > + .PHONY: all
> > + all: $(PLUGIN)
> > +
> > + $(PLUGIN): $(PLUGIN_OBJ)
> > +-      $(CROSS_COMPILE)gcc $(PLUGIN_LDFLAGS) $(PLUGIN_OBJ) -o $@
> > ++      $(CC) $(PLUGIN_LDFLAGS) $(PLUGIN_OBJ) -o $@
> > +
> > + %.o: %.c
> > +-      $(CROSS_COMPILE)gcc $(PLUGIN_CCFLAGS) $(PLUGIN_INCLUDES) -c $*.c -o $*.o
> > ++      $(CC) $(PLUGIN_CCFLAGS) $(PLUGIN_INCLUDES) -c $*.c -o $*.o
> > +
> > + .PHONY: clean
> > + clean:
> > +--
> > +2.25.1
> > +
> > diff --git a/meta-arm/recipes-security/optee/optee-examples/0002-Makefile-Enable-plugins-installation-in-rootfs.patch b/meta-arm/recipes-security/optee/optee-examples/0002-Makefile-Enable-plugins-installation-in-rootfs.patch
> > new file mode 100644
> > index 0000000..8d1d60a
> > --- /dev/null
> > +++ b/meta-arm/recipes-security/optee/optee-examples/0002-Makefile-Enable-plugins-installation-in-rootfs.patch
> > @@ -0,0 +1,39 @@
> > +From a865f2e25e178fc2c4617eb1faf79ac922d02ffd Mon Sep 17 00:00:00 2001
> > +From: Sumit Garg <sumit.garg@linaro.org>
> > +Date: Tue, 20 Jul 2021 14:20:10 +0530
> > +Subject: [PATCH 2/2] Makefile: Enable plugins installation in rootfs
> > +
> > +Upstream-Status: Submitted [https://github.com/linaro-swg/optee_examples/pull/87]
> > +
> > +Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
> > +---
> > + Makefile | 5 +++++
> > + 1 file changed, 5 insertions(+)
> > +
> > +diff --git a/Makefile b/Makefile
> > +index a275842..b3f16aa 100644
> > +--- a/Makefile
> > ++++ b/Makefile
> > +@@ -25,14 +25,19 @@ prepare-for-rootfs: examples
> > +       @mkdir -p $(OUTPUT_DIR)
> > +       @mkdir -p $(OUTPUT_DIR)/ta
> > +       @mkdir -p $(OUTPUT_DIR)/ca
> > ++      @mkdir -p $(OUTPUT_DIR)/plugins
> > +       @for example in $(EXAMPLE_LIST); do \
> > +               if [ -e $$example/host/optee_example_$$example ]; then \
> > +                       cp -p $$example/host/optee_example_$$example $(OUTPUT_DIR)/ca/; \
> > +               fi; \
> > +               cp -pr $$example/ta/*.ta $(OUTPUT_DIR)/ta/; \
> > ++              if [ $$example == plugins ]; then \
> > ++                      cp -p plugins/syslog/*.plugin $(OUTPUT_DIR)/plugins/; \
> > ++              fi; \
> > +       done
> > +
> > + prepare-for-rootfs-clean:
> > +       @rm -rf $(OUTPUT_DIR)/ta
> > +       @rm -rf $(OUTPUT_DIR)/ca
> > ++      @rm -rf $(OUTPUT_DIR)/plugins
> > +       @rmdir --ignore-fail-on-non-empty $(OUTPUT_DIR) || test ! -e $(OUTPUT_DIR)
> > +--
> > +2.25.1
> > +
> > diff --git a/meta-arm/recipes-security/optee/optee-examples_3.11.0.bb b/meta-arm/recipes-security/optee/optee-examples_3.11.0.bb
> > deleted file mode 100644
> > index 72473ed..0000000
> > --- a/meta-arm/recipes-security/optee/optee-examples_3.11.0.bb
> > +++ /dev/null
> > @@ -1,4 +0,0 @@
> > -require optee-examples.inc
> > -
> > -SRCREV = "9a7dc598591990349d88b4dba3a37aadd6851295"
> > -
> > diff --git a/meta-arm/recipes-security/optee/optee-examples_3.14.0.bb b/meta-arm/recipes-security/optee/optee-examples_3.14.0.bb
> > new file mode 100644
> > index 0000000..f2b5f7d
> > --- /dev/null
> > +++ b/meta-arm/recipes-security/optee/optee-examples_3.14.0.bb
> > @@ -0,0 +1,4 @@
> > +require optee-examples.inc
> > +
> > +SRCREV = "e9c870525af8f7e7fccf575a0ca5394ce55adcec"
> > +
> > diff --git a/meta-arm/recipes-security/optee/optee-os/0001-libutils-provide-empty-__getauxval-implementation.patch b/meta-arm/recipes-security/optee/optee-os/0001-libutils-provide-empty-__getauxval-implementation.patch
> > deleted file mode 100644
> > index 0120f5c..0000000
> > --- a/meta-arm/recipes-security/optee/optee-os/0001-libutils-provide-empty-__getauxval-implementation.patch
> > +++ /dev/null
> > @@ -1,62 +0,0 @@
> > -Upstream-Status: Backport
> > -Signed-off-by: Ross Burton <ross.burton@arm.com>
> > -
> > -From 36e784f621bf5d5be9183beba35f39426277c110 Mon Sep 17 00:00:00 2001
> > -From: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
> > -Date: Tue, 13 Oct 2020 22:45:39 +0300
> > -Subject: [PATCH 1/3] libutils: provide empty __getauxval() implementation
> > -
> > -Never version of libgcc are built with LSE implementation in mind. To
> > -determine if LSE is available on platform it calls __getauxval(), so in
> > -some cases we can get undefined reference to __getauxval() error.
> > -
> > -Prominent case is libgcc_eh.a library, which is used by C++ TAs. Exception
> > -handler depends on atomic operations, so it tries to call
> > -init_have_lse_atomics() first. This function in turn calls __getauxval(),
> > -which causes linking error.
> > -
> > -In the future we can make __getauxval() to return actual platform
> > -capabilities.
> > -
> > -Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
> > -Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
> > -Reviewed-by: Jerome Forissier <jerome@forissier.org>
> > ----
> > - lib/libutils/ext/arch/arm/auxval.c | 12 ++++++++++++
> > - lib/libutils/ext/arch/arm/sub.mk   |  1 +
> > - 2 files changed, 13 insertions(+)
> > - create mode 100644 lib/libutils/ext/arch/arm/auxval.c
> > -
> > -diff --git a/lib/libutils/ext/arch/arm/auxval.c b/lib/libutils/ext/arch/arm/auxval.c
> > -new file mode 100644
> > -index 00000000..98bca850
> > ---- /dev/null
> > -+++ b/lib/libutils/ext/arch/arm/auxval.c
> > -@@ -0,0 +1,12 @@
> > -+// SPDX-License-Identifier: BSD-2-Clause
> > -+/*
> > -+ * Copyright (c) 2020, EPAM Systems
> > -+ */
> > -+
> > -+#include <compiler.h>
> > -+
> > -+unsigned long int __getauxval (unsigned long int type);
> > -+unsigned long int __getauxval (unsigned long int type __unused)
> > -+{
> > -+      return 0;
> > -+}
> > -diff --git a/lib/libutils/ext/arch/arm/sub.mk b/lib/libutils/ext/arch/arm/sub.mk
> > -index dc5eed67..2e779066 100644
> > ---- a/lib/libutils/ext/arch/arm/sub.mk
> > -+++ b/lib/libutils/ext/arch/arm/sub.mk
> > -@@ -3,6 +3,7 @@ srcs-$(CFG_ARM32_$(sm)) += aeabi_unwind.c
> > - endif
> > - srcs-$(CFG_ARM32_$(sm)) += atomic_a32.S
> > - srcs-$(CFG_ARM64_$(sm)) += atomic_a64.S
> > -+srcs-y += auxval.c
> > - ifneq ($(sm),ldelf) # TA, core
> > - srcs-$(CFG_ARM32_$(sm)) += mcount_a32.S
> > - srcs-$(CFG_ARM64_$(sm)) += mcount_a64.S
> > ---
> > -2.25.1
> > -
> > diff --git a/meta-arm/recipes-security/optee/optee-os/0002-link.mk-implement-support-for-libnames-after-libgcc-.patch b/meta-arm/recipes-security/optee/optee-os/0002-link.mk-implement-support-for-libnames-after-libgcc-.patch
> > deleted file mode 100644
> > index 11296c8..0000000
> > --- a/meta-arm/recipes-security/optee/optee-os/0002-link.mk-implement-support-for-libnames-after-libgcc-.patch
> > +++ /dev/null
> > @@ -1,55 +0,0 @@
> > -Upstream-Status: Backport
> > -Signed-off-by: Ross Burton <ross.burton@arm.com>
> > -
> > -From 73196b58ea6978ffa5e581738030f51c5789ef73 Mon Sep 17 00:00:00 2001
> > -From: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
> > -Date: Tue, 13 Oct 2020 22:54:13 +0300
> > -Subject: [PATCH 2/3] link.mk: implement support for libnames-after-libgcc
> > - variable
> > -
> > -Newer versions of libgcc depend on external __getauxval() symbol, which is
> > -now provided by libutils. But libgcc is linked after libutils, so linker
> > -can't resolve that symbol. We can't include libgcc into linking group with
> > -libtutils, because libgcc provides symbols that conflict with libutil's
> > -ones, like __aeabi_idiv with friends for instance.
> > -
> > -So, to resolve libgcc dependency on libutils we need to link with libutils
> > -second time. To make things more generic, we will introduce
> > -$(libnames-after-libgcc) variable for libraries that should be linked after
> > -libgcc.
> > -
> > -Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
> > -Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
> > -Reviewed-by: Jerome Forissier <jerome@forissier.org>
> > ----
> > - ta/arch/arm/link.mk | 6 +++++-
> > - 1 file changed, 5 insertions(+), 1 deletion(-)
> > -
> > -diff --git a/ta/arch/arm/link.mk b/ta/arch/arm/link.mk
> > -index 445c285d..3025acb1 100644
> > ---- a/ta/arch/arm/link.mk
> > -+++ b/ta/arch/arm/link.mk
> > -@@ -55,8 +55,11 @@ link-ldflags += --eh-frame-hdr
> > - link-ldadd += $(libstdc++$(sm)) $(libgcc_eh$(sm))
> > - endif
> > - link-ldadd += --end-group
> > --ldargs-$(user-ta-uuid).elf := $(link-ldflags) $(objs) $(link-ldadd) $(libgcc$(sm))
> > -
> > -+link-ldadd-after-libgcc += $(addprefix -l,$(libnames-after-libgcc))
> > -+
> > -+ldargs-$(user-ta-uuid).elf := $(link-ldflags) $(objs) $(link-ldadd) \
> > -+                              $(libgcc$(sm)) $(link-ldadd-after-libgcc)
> > -
> > - link-script-cppflags-$(sm) := \
> > -       $(filter-out $(CPPFLAGS_REMOVE) $(cppflags-remove), \
> > -@@ -76,6 +79,7 @@ $(link-script-pp$(sm)): $(link-script$(sm)) $(conf-file) $(link-script-pp-makefi
> > -               $(link-script-cppflags-$(sm)) $$< -o $$@
> > -
> > - $(link-out-dir$(sm))/$(user-ta-uuid).elf: $(objs) $(libdeps) \
> > -+                                        $(libdeps-after-libgcc) \
> > -                                         $(link-script-pp$(sm)) \
> > -                                         $(dynlistdep) \
> > -                                         $(additional-link-deps)
> > ---
> > -2.25.1
> > -
> > diff --git a/meta-arm/recipes-security/optee/optee-os/0003-ta_dev_kit.mk-make-sure-that-libutils-is-linked-seco.patch b/meta-arm/recipes-security/optee/optee-os/0003-ta_dev_kit.mk-make-sure-that-libutils-is-linked-seco.patch
> > deleted file mode 100644
> > index 88ba5f8..0000000
> > --- a/meta-arm/recipes-security/optee/optee-os/0003-ta_dev_kit.mk-make-sure-that-libutils-is-linked-seco.patch
> > +++ /dev/null
> > @@ -1,44 +0,0 @@
> > -Upstream-Status: Backport
> > -Signed-off-by: Ross Burton <ross.burton@arm.com>
> > -
> > -From f50962e3f56f0932662b2ffa10afe53339a335dd Mon Sep 17 00:00:00 2001
> > -From: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
> > -Date: Fri, 16 Oct 2020 16:36:08 +0300
> > -Subject: [PATCH 3/3] ta_dev_kit.mk: make sure that libutils is linked second
> > - time
> > -
> > -libgcc depends on __getauxval symbol from libuils. As, generally libutils
> > -is linked before libgcc, we will get "unresolved symbol" error. To resolve
> > -this dependency we need to link libutils second time - after libgcc.
> > -
> > -Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
> > -Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
> > -Reviewed-by: Jerome Forissier <jerome@forissier.org>
> > ----
> > - ta/mk/ta_dev_kit.mk | 10 ++++++++++
> > - 1 file changed, 10 insertions(+)
> > -
> > -diff --git a/ta/mk/ta_dev_kit.mk b/ta/mk/ta_dev_kit.mk
> > -index e28be677..d0e66317 100644
> > ---- a/ta/mk/ta_dev_kit.mk
> > -+++ b/ta/mk/ta_dev_kit.mk
> > -@@ -78,6 +78,16 @@ endif
> > - libnames += dl
> > - libdeps += $(ta-dev-kit-dir$(sm))/lib/libdl.a
> > -
> > -+# libutils provides __getauxval symbol which is needed by libgcc 10.x. We can't
> > -+# link libutils after libgcc, because libgcc will replace some symbols provided
> > -+# by libutils, which will cause further linking issues.
> > -+#
> > -+# But if we place libutils before libgcc, linker will not be able to resolve
> > -+# __getauxval. So we need to link with libutils twice: before and after libgcc.
> > -+# Hence it included both in $(libnames) and in $(libnames-after-libgcc)
> > -+libnames-after-libgcc += utils
> > -+libdeps-after-libgcc += $(ta-dev-kit-dir$(sm))/lib/libutils.a
> > -+
> > - # Pass config variable (CFG_) from conf.mk on the command line
> > - cppflags$(sm) += $(strip \
> > -       $(foreach var, $(filter CFG_%,$(.VARIABLES)), \
> > ---
> > -2.25.1
> > -
> > diff --git a/meta-arm/recipes-security/optee/optee-os_3.11.0.bb b/meta-arm/recipes-security/optee/optee-os_3.11.0.bb
> > deleted file mode 100644
> > index 13b3dc6..0000000
> > --- a/meta-arm/recipes-security/optee/optee-os_3.11.0.bb
> > +++ /dev/null
> > @@ -1,11 +0,0 @@
> > -require optee-os.inc
> > -
> > -SRCREV = "c4def2a8262a03244d9a88461699b9b8e43c6b55"
> > -
> > -SRC_URI_append = " \
> > -    file://0006-allow-setting-sysroot-for-libgcc-lookup.patch \
> > -    file://0007-allow-setting-sysroot-for-clang.patch \
> > -    file://0001-libutils-provide-empty-__getauxval-implementation.patch \
> > -    file://0002-link.mk-implement-support-for-libnames-after-libgcc-.patch \
> > -    file://0003-ta_dev_kit.mk-make-sure-that-libutils-is-linked-seco.patch \
> > -"
> > diff --git a/meta-arm/recipes-security/optee/optee-os_3.14.0.bb b/meta-arm/recipes-security/optee/optee-os_3.14.0.bb
> > new file mode 100644
> > index 0000000..3289e2c
> > --- /dev/null
> > +++ b/meta-arm/recipes-security/optee/optee-os_3.14.0.bb
> > @@ -0,0 +1,8 @@
> > +require optee-os.inc
> > +
> > +SRCREV = "d21befa5e53eae9db469eba1685f5aa5c6f92c2f"
> > +
> > +SRC_URI_append = " \
> > +    file://0006-allow-setting-sysroot-for-libgcc-lookup.patch \
> > +    file://0007-allow-setting-sysroot-for-clang.patch \
> > +"
> > diff --git a/meta-arm/recipes-security/optee/optee-test.inc b/meta-arm/recipes-security/optee/optee-test.inc
> > index f09b9d2..bcbcc06 100644
> > --- a/meta-arm/recipes-security/optee/optee-test.inc
> > +++ b/meta-arm/recipes-security/optee/optee-test.inc
> > @@ -8,17 +8,9 @@ LIC_FILES_CHKSUM = "file://${S}/LICENSE.md;md5=daa2bcccc666345ab8940aab1315a4fa"
> >  inherit python3native ptest
> >  require optee.inc
> >
> > -# Linking fails on musl due to C++/threads
> > -# https://github.com/OP-TEE/optee_test/issues/458#issuecomment-720540834
> > -# When upgraded we should be able to remove this limitation
> > -COMPATIBLE_HOST_libc-musl = 'null'
> > -
> >  DEPENDS = "optee-client optee-os python3-pycryptodome-native"
> >
> >  SRC_URI = "git://github.com/OP-TEE/optee_test.git \
> > -           file://0001-host-xtest-Adjust-order-of-including-compiler.h.patch \
> > -           file://0002-make-remove-Wno-unsafe-loop-for-clang.patch \
> > -           file://0003-make-remove-Wmissing-noreturn-for-clang.patch \
> >             file://run-ptest \
> >            "
> >
> > @@ -36,6 +28,7 @@ do_compile() {
> >      # Top level makefile doesn't seem to handle parallel make gracefully
> >      oe_runmake xtest
> >      oe_runmake ta
> > +    oe_runmake test_plugin
> >  }
> >  do_compile[cleandirs] = "${B}"
> >
> > @@ -46,9 +39,13 @@ do_install () {
> >      # default TEEC_LOAD_PATH is /lib
> >      mkdir -p ${D}${nonarch_base_libdir}/optee_armtz/
> >      install -D -p -m0444 ${B}/ta/*/*.ta ${D}${nonarch_base_libdir}/optee_armtz/
> > +    mkdir -p ${D}${libdir}/tee-supplicant/plugins
> > +    install -D -p -m0444 ${B}/supp_plugin/*.plugin ${D}${libdir}/tee-supplicant/plugins/
> >  }
> >
> > -FILES_${PN} += "${nonarch_base_libdir}/optee_armtz/"
> > +FILES_${PN} += "${nonarch_base_libdir}/optee_armtz/ \
> > +                ${libdir}/tee-supplicant/plugins/ \
> > +               "
> >
> >  # Imports machine specific configs from staging to build
> >  PACKAGE_ARCH = "${MACHINE_ARCH}"
> > diff --git a/meta-arm/recipes-security/optee/optee-test/0001-host-xtest-Adjust-order-of-including-compiler.h.patch b/meta-arm/recipes-security/optee/optee-test/0001-host-xtest-Adjust-order-of-including-compiler.h.patch
> > deleted file mode 100644
> > index 3c500d7..0000000
> > --- a/meta-arm/recipes-security/optee/optee-test/0001-host-xtest-Adjust-order-of-including-compiler.h.patch
> > +++ /dev/null
> > @@ -1,64 +0,0 @@
> > -From fc95b3ccbbfd336797ae2cfd6dd4dc58644e146f Mon Sep 17 00:00:00 2001
> > -From: Khem Raj <raj.khem@gmail.com>
> > -Date: Sat, 30 May 2020 17:52:18 -0700
> > -Subject: [PATCH] host/xtest: Adjust order of including compiler.h
> > -
> > -compiler.h defines some defines which violate libc namespace e.g.
> > -__unused, this works ok with glibc but fails in awkward ways with musl
> > -the reason is musl uses __unused in its internal structures and this
> > -define in compiler.h conflicts with system headers causing errors like
> > -
> > -recipe-sysroot/usr/include/bits/stat.h:17:19: error: expected identifier or '(' before '[' token unsigned __unused[2];
> > -                   ^
> > -including compiler.h afer sys/stat.h fixes the problem.
> > -
> > -Upstream-Status: Pending [https://github.com/OP-TEE/optee_test/issues/453]
> > -Signed-off-by: Khem Raj <raj.khem@gmail.com>
> > ----
> > - host/xtest/install_ta.c | 2 +-
> > - host/xtest/stats.c      | 2 +-
> > - 2 files changed, 2 insertions(+), 2 deletions(-)
> > -
> > -diff --git a/host/xtest/install_ta.c b/host/xtest/install_ta.c
> > -index 09a4c6d..6f7bb5c 100644
> > ---- a/host/xtest/install_ta.c
> > -+++ b/host/xtest/install_ta.c
> > -@@ -4,7 +4,6 @@
> > -  * SPDX-License-Identifier: BSD-2-Clause
> > -  */
> > -
> > --#include <compiler.h>
> > - #include <dirent.h>
> > - #include <err.h>
> > - #include <errno.h>
> > -@@ -20,6 +19,7 @@
> > - #include <sys/types.h>
> > - #include <tee_client_api.h>
> > - #include <unistd.h>
> > -+#include <compiler.h>
> > -
> > - #include "install_ta.h"
> > - #include "xtest_helpers.h"
> > -diff --git a/host/xtest/stats.c b/host/xtest/stats.c
> > -index 96b0b5f..db9bf25 100644
> > ---- a/host/xtest/stats.c
> > -+++ b/host/xtest/stats.c
> > -@@ -3,7 +3,6 @@
> > -  * Copyright (c) 2019, Linaro Limited
> > -  */
> > -
> > --#include <compiler.h>
> > - #include <dirent.h>
> > - #include <err.h>
> > - #include <errno.h>
> > -@@ -18,6 +17,7 @@
> > - #include <sys/types.h>
> > - #include <tee_client_api.h>
> > - #include <unistd.h>
> > -+#include <compiler.h>
> > - #include "xtest_test.h"
> > - #include "stats.h"
> > -
> > ---
> > -2.26.2
> > -
> > diff --git a/meta-arm/recipes-security/optee/optee-test/0002-make-remove-Wno-unsafe-loop-for-clang.patch b/meta-arm/recipes-security/optee/optee-test/0002-make-remove-Wno-unsafe-loop-for-clang.patch
> > deleted file mode 100644
> > index 17dd7d8..0000000
> > --- a/meta-arm/recipes-security/optee/optee-test/0002-make-remove-Wno-unsafe-loop-for-clang.patch
> > +++ /dev/null
> > @@ -1,31 +0,0 @@
> > -From 438533ce9da1df0b7c7914e64b39ffdc1da1ab79 Mon Sep 17 00:00:00 2001
> > -From: Brett Warren <brett.warran@arm.com>
> > -Date: Thu, 8 Oct 2020 10:03:25 +0100
> > -Subject: [PATCH] make: remove -Wmissing-noreturn for clang
> > -
> > -When compiling when clang, -Wmissing-noreturn causes an error because
> > -of non-compliant code. This option is removed to workaround this.
> > -
> > -Upstream-Status: Pending [https://github.com/OP-TEE/optee_test/issues/452]
> > -Changed-Id: 71cb511904547d790d1ea98f93bf8e5a6afcb36d
> > -Signed-off-by: Brett Warren <brett.warren@arm.com>
> > ----
> > - host/xtest/Makefile | 2 +-
> > - 1 file changed, 1 insertion(+), 1 deletion(-)
> > -
> > -diff --git a/host/xtest/Makefile b/host/xtest/Makefile
> > -index 3c206b0..96746de 100644
> > ---- a/host/xtest/Makefile
> > -+++ b/host/xtest/Makefile
> > -@@ -169,7 +169,7 @@ CFLAGS += -Wall -Wcast-align -Werror \
> > -         -Werror-implicit-function-declaration -Wextra -Wfloat-equal \
> > -         -Wformat-nonliteral -Wformat-security -Wformat=2 -Winit-self \
> > -         -Wmissing-declarations -Wmissing-format-attribute \
> > --        -Wmissing-include-dirs -Wmissing-noreturn \
> > -+        -Wmissing-include-dirs \
> > -         -Wmissing-prototypes -Wnested-externs -Wpointer-arith \
> > -         -Wshadow -Wstrict-prototypes -Wswitch-default \
> > -         -Wwrite-strings \
> > ---
> > -2.17.1
> > -
> > diff --git a/meta-arm/recipes-security/optee/optee-test/0003-make-remove-Wmissing-noreturn-for-clang.patch b/meta-arm/recipes-security/optee/optee-test/0003-make-remove-Wmissing-noreturn-for-clang.patch
> > deleted file mode 100644
> > index bbc303f..0000000
> > --- a/meta-arm/recipes-security/optee/optee-test/0003-make-remove-Wmissing-noreturn-for-clang.patch
> > +++ /dev/null
> > @@ -1,31 +0,0 @@
> > -From ed5a9d9f7a3e9e14ca0e8aea59008124ee0e5f96 Mon Sep 17 00:00:00 2001
> > -From: Brett Warren <brett.warren@arm.com>
> > -Date: Thu, 8 Oct 2020 10:20:52 +0100
> > -Subject: [PATCH] make: remove -Wno-unsafe-loop for clang
> > -
> > -When compiling with clang, the -Wno-unsafe-loop-optimizations option
> > -throws an error because clang doesn't recognise it. This option is
> > -removed to workaround this.
> > -
> > -Upstream-Status: Pending [https://github.com/OP-TEE/optee_test/issues/452]
> > -Change-Id: 5fe0892c73208aaffac8c9995cb3275936fb1ba6
> > -Signed-off-by: Brett Warren <brett.warren@arm.com>
> > ----
> > - host/xtest/Makefile | 1 -
> > - 1 file changed, 1 deletion(-)
> > -
> > -diff --git a/host/xtest/Makefile b/host/xtest/Makefile
> > -index 96746de..73731d0 100644
> > ---- a/host/xtest/Makefile
> > -+++ b/host/xtest/Makefile
> > -@@ -174,7 +174,6 @@ CFLAGS += -Wall -Wcast-align -Werror \
> > -         -Wshadow -Wstrict-prototypes -Wswitch-default \
> > -         -Wwrite-strings \
> > -         -Wno-declaration-after-statement \
> > --        -Wno-unsafe-loop-optimizations \
> > -         -Wno-missing-field-initializers -Wno-format-zero-length
> > - endif
> > -
> > ---
> > -2.17.1
> > -
> > diff --git a/meta-arm/recipes-security/optee/optee-test_3.11.0.bb b/meta-arm/recipes-security/optee/optee-test_3.11.0.bb
> > deleted file mode 100644
> > index 0f8b5b0..0000000
> > --- a/meta-arm/recipes-security/optee/optee-test_3.11.0.bb
> > +++ /dev/null
> > @@ -1,3 +0,0 @@
> > -require optee-test.inc
> > -
> > -SRCREV = "159e295d5cc3ad2275ab15fe544620f6604d4ba4"
> > diff --git a/meta-arm/recipes-security/optee/optee-test_3.14.0.bb b/meta-arm/recipes-security/optee/optee-test_3.14.0.bb
> > new file mode 100644
> > index 0000000..6367c27
> > --- /dev/null
> > +++ b/meta-arm/recipes-security/optee/optee-test_3.14.0.bb
> > @@ -0,0 +1,3 @@
> > +require optee-test.inc
> > +
> > +SRCREV = "f2eb88affbb7f028561b4fd5cbd049d5d704f741"
> > --
> > 2.25.1
> >
> >
> > 
> >

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [meta-arm] [PATCH] arm/optee: version uplift 3.11.0 -> 3.14.0
  2021-07-26  7:09   ` Sumit Garg
@ 2021-07-26 14:01     ` Jon Mason
  2021-07-27  6:52       ` Sumit Garg
  0 siblings, 1 reply; 11+ messages in thread
From: Jon Mason @ 2021-07-26 14:01 UTC (permalink / raw)
  To: Sumit Garg; +Cc: Ross Burton, meta-arm, Jon Mason, Ross Burton

On Mon, Jul 26, 2021 at 3:10 AM Sumit Garg <sumit.garg@linaro.org> wrote:
>
> Hi Ross,
>
> On Sat, 24 Jul 2021 at 00:36, Ross Burton <ross@burtonini.com> wrote:
> >
> > The optee-examples recipe is broken:
> >
> > install: cannot stat
> > '/builds/engineering/yocto/meta-arm/work/build/tmp/work/qemuarm64_secureboot-poky-linux/optee-examples/3.14.0-r0/build/plugins/*':
> > No such file or directory
> >
> > (qemuarm64-secureboot can build it)
> >
>
> Strangely, it works fine for me when building for
> qemuarm64-secureboot. Can you check if the following patches have been
> correctly applied in the corresponding work directory?
>
>            file://0001-plugins-Honour-default-cross-compiler-environment-se.patch
> \
>            file://0002-Makefile-Enable-plugins-installation-in-rootfs.patch \

I'm seeing the same issue Ross is describing.  I would expect a
warning or error if it couldn't find the patches while building, not
when installing.  Can you confirm you are building optee-examples, in
addition to core-image-minimal/base?
See https://gitlab.com/jonmason00/meta-arm/-/jobs/1444856281#L3594

Looks to me like the issue is with newly added line
https://gitlab.com/jonmason00/meta-arm/-/blob/master-next/meta-arm/recipes-security/optee/optee-examples.inc#L39

Thanks,
Jon

>
> -Sumit
>
> > Ross
> >
> > On Tue, 20 Jul 2021 at 11:07, Sumit Garg <sumit.garg@linaro.org> wrote:
> > >
> > > Brief description of changes:
> > > - Version uplift 3.11.0 -> 3.14.0.
> > > - Removed OP-TEE patches that has already been accepted upstream.
> > > - Added support for tee-supplicant plugin framework testing.
> > >
> > > Tested on qemuarm64_secureboot:
> > > $ xtest -l 15
> > > $ optee-examples_*
> > >
> > > Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
> > > ---
> > >  .../optee/optee-client_3.11.0.bb              |   3 -
> > >  .../optee/optee-client_3.14.0.bb              |   3 +
> > >  .../recipes-security/optee/optee-examples.inc |   9 +-
> > >  .../0001-make-Pass-ldflags-during-link.patch  | 103 ------------------
> > >  ...efault-cross-compiler-environment-se.patch |  84 ++++++++++++++
> > >  ...nable-plugins-installation-in-rootfs.patch |  39 +++++++
> > >  .../optee/optee-examples_3.11.0.bb            |   4 -
> > >  .../optee/optee-examples_3.14.0.bb            |   4 +
> > >  ...ide-empty-__getauxval-implementation.patch |  62 -----------
> > >  ...t-support-for-libnames-after-libgcc-.patch |  55 ----------
> > >  ...ke-sure-that-libutils-is-linked-seco.patch |  44 --------
> > >  .../recipes-security/optee/optee-os_3.11.0.bb |  11 --
> > >  .../recipes-security/optee/optee-os_3.14.0.bb |   8 ++
> > >  .../recipes-security/optee/optee-test.inc     |  15 +--
> > >  ...Adjust-order-of-including-compiler.h.patch |  64 -----------
> > >  ...ake-remove-Wno-unsafe-loop-for-clang.patch |  31 ------
> > >  ...e-remove-Wmissing-noreturn-for-clang.patch |  31 ------
> > >  .../optee/optee-test_3.11.0.bb                |   3 -
> > >  .../optee/optee-test_3.14.0.bb                |   3 +
> > >  19 files changed, 154 insertions(+), 422 deletions(-)
> > >  delete mode 100644 meta-arm/recipes-security/optee/optee-client_3.11.0.bb
> > >  create mode 100644 meta-arm/recipes-security/optee/optee-client_3.14.0.bb
> > >  delete mode 100644 meta-arm/recipes-security/optee/optee-examples/0001-make-Pass-ldflags-during-link.patch
> > >  create mode 100644 meta-arm/recipes-security/optee/optee-examples/0001-plugins-Honour-default-cross-compiler-environment-se.patch
> > >  create mode 100644 meta-arm/recipes-security/optee/optee-examples/0002-Makefile-Enable-plugins-installation-in-rootfs.patch
> > >  delete mode 100644 meta-arm/recipes-security/optee/optee-examples_3.11.0.bb
> > >  create mode 100644 meta-arm/recipes-security/optee/optee-examples_3.14.0.bb
> > >  delete mode 100644 meta-arm/recipes-security/optee/optee-os/0001-libutils-provide-empty-__getauxval-implementation.patch
> > >  delete mode 100644 meta-arm/recipes-security/optee/optee-os/0002-link.mk-implement-support-for-libnames-after-libgcc-.patch
> > >  delete mode 100644 meta-arm/recipes-security/optee/optee-os/0003-ta_dev_kit.mk-make-sure-that-libutils-is-linked-seco.patch
> > >  delete mode 100644 meta-arm/recipes-security/optee/optee-os_3.11.0.bb
> > >  create mode 100644 meta-arm/recipes-security/optee/optee-os_3.14.0.bb
> > >  delete mode 100644 meta-arm/recipes-security/optee/optee-test/0001-host-xtest-Adjust-order-of-including-compiler.h.patch
> > >  delete mode 100644 meta-arm/recipes-security/optee/optee-test/0002-make-remove-Wno-unsafe-loop-for-clang.patch
> > >  delete mode 100644 meta-arm/recipes-security/optee/optee-test/0003-make-remove-Wmissing-noreturn-for-clang.patch
> > >  delete mode 100644 meta-arm/recipes-security/optee/optee-test_3.11.0.bb
> > >  create mode 100644 meta-arm/recipes-security/optee/optee-test_3.14.0.bb
> > >
> > > diff --git a/meta-arm/recipes-security/optee/optee-client_3.11.0.bb b/meta-arm/recipes-security/optee/optee-client_3.11.0.bb
> > > deleted file mode 100644
> > > index f765d12..0000000
> > > --- a/meta-arm/recipes-security/optee/optee-client_3.11.0.bb
> > > +++ /dev/null
> > > @@ -1,3 +0,0 @@
> > > -require optee-client.inc
> > > -
> > > -SRCREV = "c0c925384c1d7e3558d27d2708857482952d7907"
> > > diff --git a/meta-arm/recipes-security/optee/optee-client_3.14.0.bb b/meta-arm/recipes-security/optee/optee-client_3.14.0.bb
> > > new file mode 100644
> > > index 0000000..be78b88
> > > --- /dev/null
> > > +++ b/meta-arm/recipes-security/optee/optee-client_3.14.0.bb
> > > @@ -0,0 +1,3 @@
> > > +require optee-client.inc
> > > +
> > > +SRCREV = "06e1b32f6a7028e039c625b07cfc25fda0c17d53"
> > > diff --git a/meta-arm/recipes-security/optee/optee-examples.inc b/meta-arm/recipes-security/optee/optee-examples.inc
> > > index 81c31bc..f2e53f3 100644
> > > --- a/meta-arm/recipes-security/optee/optee-examples.inc
> > > +++ b/meta-arm/recipes-security/optee/optee-examples.inc
> > > @@ -12,7 +12,8 @@ inherit python3native
> > >  require optee.inc
> > >
> > >  SRC_URI = "git://github.com/linaro-swg/optee_examples.git \
> > > -           file://0001-make-Pass-ldflags-during-link.patch \
> > > +           file://0001-plugins-Honour-default-cross-compiler-environment-se.patch \
> > > +           file://0002-Makefile-Enable-plugins-installation-in-rootfs.patch \
> > >            "
> > >
> > >  EXTRA_OEMAKE += "TA_DEV_KIT_DIR=${TA_DEV_KIT_DIR} \
> > > @@ -32,11 +33,15 @@ do_compile[cleandirs] = "${B}"
> > >  do_install () {
> > >      mkdir -p ${D}${nonarch_base_libdir}/optee_armtz
> > >      mkdir -p ${D}${bindir}
> > > +    mkdir -p ${D}${libdir}/tee-supplicant/plugins
> > >      install -D -p -m0755 ${B}/ca/* ${D}${bindir}
> > >      install -D -p -m0444 ${B}/ta/* ${D}${nonarch_base_libdir}/optee_armtz
> > > +    install -D -p -m0444 ${B}/plugins/* ${D}${libdir}/tee-supplicant/plugins
> > >  }
> > >
> > > -FILES_${PN} += "${nonarch_base_libdir}/optee_armtz/"
> > > +FILES_${PN} += "${nonarch_base_libdir}/optee_armtz/ \
> > > +                ${libdir}/tee-supplicant/plugins/ \
> > > +               "
> > >
> > >  # Imports machine specific configs from staging to build
> > >  PACKAGE_ARCH = "${MACHINE_ARCH}"
> > > diff --git a/meta-arm/recipes-security/optee/optee-examples/0001-make-Pass-ldflags-during-link.patch b/meta-arm/recipes-security/optee/optee-examples/0001-make-Pass-ldflags-during-link.patch
> > > deleted file mode 100644
> > > index 84202ef..0000000
> > > --- a/meta-arm/recipes-security/optee/optee-examples/0001-make-Pass-ldflags-during-link.patch
> > > +++ /dev/null
> > > @@ -1,103 +0,0 @@
> > > -From 29ae21de41f2fbab6dbecbbf408826b28de82df1 Mon Sep 17 00:00:00 2001
> > > -From: Khem Raj <raj.khem@gmail.com>
> > > -Date: Tue, 1 Sep 2020 21:09:56 -0700
> > > -Subject: [PATCH] make: Pass ldflags during link
> > > -
> > > -OpenEmbeeded needs to pass essential linker flags to set correct flags
> > > -for gnu_hash among others which sets the linking straight
> > > -using LDFLAGS varible here means, we can affect the linker flags
> > > -from build environment
> > > -
> > > -Upstream-Status: Submitted [https://github.com/linaro-swg/optee_examples/pull/85]
> > > -
> > > -Signed-off-by: Khem Raj <raj.khem@gmail.com>
> > > ----
> > > - acipher/host/Makefile        | 2 +-
> > > - aes/host/Makefile            | 2 +-
> > > - hello_world/host/Makefile    | 2 +-
> > > - hotp/host/Makefile           | 2 +-
> > > - random/host/Makefile         | 2 +-
> > > - secure_storage/host/Makefile | 2 +-
> > > - 6 files changed, 6 insertions(+), 6 deletions(-)
> > > -
> > > -diff --git a/acipher/host/Makefile b/acipher/host/Makefile
> > > -index 8f4bc8a..c2cabef 100644
> > > ---- a/acipher/host/Makefile
> > > -+++ b/acipher/host/Makefile
> > > -@@ -18,7 +18,7 @@ BINARY = optee_example_acipher
> > > - all: $(BINARY)
> > > -
> > > - $(BINARY): $(OBJS)
> > > --      $(CC) -o $@ $< $(LDADD)
> > > -+      $(CC) -o $@ $< $(LDFLAGS) $(LDADD)
> > > -
> > > - .PHONY: clean
> > > - clean:
> > > -diff --git a/aes/host/Makefile b/aes/host/Makefile
> > > -index dfeb4e8..f61c71b 100644
> > > ---- a/aes/host/Makefile
> > > -+++ b/aes/host/Makefile
> > > -@@ -18,7 +18,7 @@ BINARY = optee_example_aes
> > > - all: $(BINARY)
> > > -
> > > - $(BINARY): $(OBJS)
> > > --      $(CC) -o $@ $< $(LDADD)
> > > -+      $(CC) -o $@ $< $(LDFLAGS) $(LDADD)
> > > -
> > > - .PHONY: clean
> > > - clean:
> > > -diff --git a/hello_world/host/Makefile b/hello_world/host/Makefile
> > > -index c4c8239..69cf42c 100644
> > > ---- a/hello_world/host/Makefile
> > > -+++ b/hello_world/host/Makefile
> > > -@@ -18,7 +18,7 @@ BINARY = optee_example_hello_world
> > > - all: $(BINARY)
> > > -
> > > - $(BINARY): $(OBJS)
> > > --      $(CC) -o $@ $< $(LDADD)
> > > -+      $(CC) -o $@ $< $(LDFLAGS) $(LDADD)
> > > -
> > > - .PHONY: clean
> > > - clean:
> > > -diff --git a/hotp/host/Makefile b/hotp/host/Makefile
> > > -index cb7fd19..e7f013f 100644
> > > ---- a/hotp/host/Makefile
> > > -+++ b/hotp/host/Makefile
> > > -@@ -18,7 +18,7 @@ BINARY = optee_example_hotp
> > > - all: $(BINARY)
> > > -
> > > - $(BINARY): $(OBJS)
> > > --      $(CC) -o $@ $< $(LDADD)
> > > -+      $(CC) -o $@ $< $(LDFLAGS) $(LDADD)
> > > -
> > > - .PHONY: clean
> > > - clean:
> > > -diff --git a/random/host/Makefile b/random/host/Makefile
> > > -index fd407d9..9377f7a 100644
> > > ---- a/random/host/Makefile
> > > -+++ b/random/host/Makefile
> > > -@@ -18,7 +18,7 @@ BINARY = optee_example_random
> > > - all: $(BINARY)
> > > -
> > > - $(BINARY): $(OBJS)
> > > --      $(CC) -o $@ $< $(LDADD)
> > > -+      $(CC) -o $@ $< $(LDFLAGS) $(LDADD)
> > > -
> > > - .PHONY: clean
> > > - clean:
> > > -diff --git a/secure_storage/host/Makefile b/secure_storage/host/Makefile
> > > -index 29bfb87..b3265ae 100644
> > > ---- a/secure_storage/host/Makefile
> > > -+++ b/secure_storage/host/Makefile
> > > -@@ -18,7 +18,7 @@ BINARY = optee_example_secure_storage
> > > - all: $(BINARY)
> > > -
> > > - $(BINARY): $(OBJS)
> > > --      $(CC) -o $@ $< $(LDADD)
> > > -+      $(CC) -o $@ $< $(LDFLAGS) $(LDADD)
> > > -
> > > - .PHONY: clean
> > > - clean:
> > > ---
> > > -2.28.0
> > > -
> > > diff --git a/meta-arm/recipes-security/optee/optee-examples/0001-plugins-Honour-default-cross-compiler-environment-se.patch b/meta-arm/recipes-security/optee/optee-examples/0001-plugins-Honour-default-cross-compiler-environment-se.patch
> > > new file mode 100644
> > > index 0000000..033e48c
> > > --- /dev/null
> > > +++ b/meta-arm/recipes-security/optee/optee-examples/0001-plugins-Honour-default-cross-compiler-environment-se.patch
> > > @@ -0,0 +1,84 @@
> > > +From 79c826c249001700007a6dffe80c3d61ff4428ef Mon Sep 17 00:00:00 2001
> > > +From: Sumit Garg <sumit.garg@linaro.org>
> > > +Date: Tue, 20 Jul 2021 13:54:30 +0530
> > > +Subject: [PATCH 1/2] plugins: Honour default cross compiler environment setup
> > > +
> > > +Honour default $(CC), $(CFLAGS) and $(LDFLAGS) variables. Without this
> > > +plugins example fails to build for OE/Yocto.
> > > +
> > > +Upstream-Status: Submitted [https://github.com/linaro-swg/optee_examples/pull/87]
> > > +
> > > +Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
> > > +---
> > > + plugins/Makefile        |  2 +-
> > > + plugins/host/Makefile   |  2 +-
> > > + plugins/syslog/Makefile | 16 ++++++++++++----
> > > + 3 files changed, 14 insertions(+), 6 deletions(-)
> > > +
> > > +diff --git a/plugins/Makefile b/plugins/Makefile
> > > +index 2372b38..ea472b4 100644
> > > +--- a/plugins/Makefile
> > > ++++ b/plugins/Makefile
> > > +@@ -8,7 +8,7 @@ TA_CROSS_COMPILE ?= $(CROSS_COMPILE)
> > > + all:
> > > +       $(MAKE) -C host CROSS_COMPILE="$(HOST_CROSS_COMPILE)" --no-builtin-variables
> > > +       $(MAKE) -C ta CROSS_COMPILE="$(TA_CROSS_COMPILE)" LDFLAGS=""
> > > +-      $(MAKE) -C syslog CROSS_COMPILE="$(HOST_CROSS_COMPILE)"
> > > ++      $(MAKE) -C syslog CROSS_COMPILE="$(HOST_CROSS_COMPILE)" --no-builtin-variables
> > > +
> > > + .PHONY: clean
> > > + clean:
> > > +diff --git a/plugins/host/Makefile b/plugins/host/Makefile
> > > +index 7285104..76244c7 100644
> > > +--- a/plugins/host/Makefile
> > > ++++ b/plugins/host/Makefile
> > > +@@ -20,7 +20,7 @@ BINARY = optee_example_plugins
> > > + all: $(BINARY)
> > > +
> > > + $(BINARY): $(OBJS)
> > > +-      $(CC) -o $@ $< $(LDADD)
> > > ++      $(CC) $(LDFLAGS) -o $@ $< $(LDADD)
> > > +
> > > + .PHONY: clean
> > > + clean:
> > > +diff --git a/plugins/syslog/Makefile b/plugins/syslog/Makefile
> > > +index 62d916a..71f5f92 100644
> > > +--- a/plugins/syslog/Makefile
> > > ++++ b/plugins/syslog/Makefile
> > > +@@ -1,3 +1,11 @@
> > > ++CC      ?= $(CROSS_COMPILE)gcc
> > > ++LD      ?= $(CROSS_COMPILE)ld
> > > ++AR      ?= $(CROSS_COMPILE)ar
> > > ++NM      ?= $(CROSS_COMPILE)nm
> > > ++OBJCOPY ?= $(CROSS_COMPILE)objcopy
> > > ++OBJDUMP ?= $(CROSS_COMPILE)objdump
> > > ++READELF ?= $(CROSS_COMPILE)readelf
> > > ++
> > > + PLUGIN_UUID = 96bcf744-4f72-4866-bf1d-8634fd9c65e5
> > > +
> > > + PLUGIN                        = $(PLUGIN_UUID).plugin
> > > +@@ -6,17 +14,17 @@ PLUGIN_OBJ          = $(patsubst %.c, %.o, $(PLUGIN_SRS))
> > > + PLUGIN_INCLUDES_DIR   = $(CURDIR) $(TEEC_EXPORT)/include
> > > +
> > > + PLUGIN_INCLUDES               = $(addprefix -I, $(PLUGIN_INCLUDES_DIR))
> > > +-PLUGIN_CCFLAGS                = -Wall -fPIC
> > > +-PLUGIN_LDFLAGS                = -shared
> > > ++PLUGIN_CCFLAGS                = $(CFLAGS) -Wall -fPIC
> > > ++PLUGIN_LDFLAGS                = $(LDFLAGS) -shared
> > > +
> > > + .PHONY: all
> > > + all: $(PLUGIN)
> > > +
> > > + $(PLUGIN): $(PLUGIN_OBJ)
> > > +-      $(CROSS_COMPILE)gcc $(PLUGIN_LDFLAGS) $(PLUGIN_OBJ) -o $@
> > > ++      $(CC) $(PLUGIN_LDFLAGS) $(PLUGIN_OBJ) -o $@
> > > +
> > > + %.o: %.c
> > > +-      $(CROSS_COMPILE)gcc $(PLUGIN_CCFLAGS) $(PLUGIN_INCLUDES) -c $*.c -o $*.o
> > > ++      $(CC) $(PLUGIN_CCFLAGS) $(PLUGIN_INCLUDES) -c $*.c -o $*.o
> > > +
> > > + .PHONY: clean
> > > + clean:
> > > +--
> > > +2.25.1
> > > +
> > > diff --git a/meta-arm/recipes-security/optee/optee-examples/0002-Makefile-Enable-plugins-installation-in-rootfs.patch b/meta-arm/recipes-security/optee/optee-examples/0002-Makefile-Enable-plugins-installation-in-rootfs.patch
> > > new file mode 100644
> > > index 0000000..8d1d60a
> > > --- /dev/null
> > > +++ b/meta-arm/recipes-security/optee/optee-examples/0002-Makefile-Enable-plugins-installation-in-rootfs.patch
> > > @@ -0,0 +1,39 @@
> > > +From a865f2e25e178fc2c4617eb1faf79ac922d02ffd Mon Sep 17 00:00:00 2001
> > > +From: Sumit Garg <sumit.garg@linaro.org>
> > > +Date: Tue, 20 Jul 2021 14:20:10 +0530
> > > +Subject: [PATCH 2/2] Makefile: Enable plugins installation in rootfs
> > > +
> > > +Upstream-Status: Submitted [https://github.com/linaro-swg/optee_examples/pull/87]
> > > +
> > > +Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
> > > +---
> > > + Makefile | 5 +++++
> > > + 1 file changed, 5 insertions(+)
> > > +
> > > +diff --git a/Makefile b/Makefile
> > > +index a275842..b3f16aa 100644
> > > +--- a/Makefile
> > > ++++ b/Makefile
> > > +@@ -25,14 +25,19 @@ prepare-for-rootfs: examples
> > > +       @mkdir -p $(OUTPUT_DIR)
> > > +       @mkdir -p $(OUTPUT_DIR)/ta
> > > +       @mkdir -p $(OUTPUT_DIR)/ca
> > > ++      @mkdir -p $(OUTPUT_DIR)/plugins
> > > +       @for example in $(EXAMPLE_LIST); do \
> > > +               if [ -e $$example/host/optee_example_$$example ]; then \
> > > +                       cp -p $$example/host/optee_example_$$example $(OUTPUT_DIR)/ca/; \
> > > +               fi; \
> > > +               cp -pr $$example/ta/*.ta $(OUTPUT_DIR)/ta/; \
> > > ++              if [ $$example == plugins ]; then \
> > > ++                      cp -p plugins/syslog/*.plugin $(OUTPUT_DIR)/plugins/; \
> > > ++              fi; \
> > > +       done
> > > +
> > > + prepare-for-rootfs-clean:
> > > +       @rm -rf $(OUTPUT_DIR)/ta
> > > +       @rm -rf $(OUTPUT_DIR)/ca
> > > ++      @rm -rf $(OUTPUT_DIR)/plugins
> > > +       @rmdir --ignore-fail-on-non-empty $(OUTPUT_DIR) || test ! -e $(OUTPUT_DIR)
> > > +--
> > > +2.25.1
> > > +
> > > diff --git a/meta-arm/recipes-security/optee/optee-examples_3.11.0.bb b/meta-arm/recipes-security/optee/optee-examples_3.11.0.bb
> > > deleted file mode 100644
> > > index 72473ed..0000000
> > > --- a/meta-arm/recipes-security/optee/optee-examples_3.11.0.bb
> > > +++ /dev/null
> > > @@ -1,4 +0,0 @@
> > > -require optee-examples.inc
> > > -
> > > -SRCREV = "9a7dc598591990349d88b4dba3a37aadd6851295"
> > > -
> > > diff --git a/meta-arm/recipes-security/optee/optee-examples_3.14.0.bb b/meta-arm/recipes-security/optee/optee-examples_3.14.0.bb
> > > new file mode 100644
> > > index 0000000..f2b5f7d
> > > --- /dev/null
> > > +++ b/meta-arm/recipes-security/optee/optee-examples_3.14.0.bb
> > > @@ -0,0 +1,4 @@
> > > +require optee-examples.inc
> > > +
> > > +SRCREV = "e9c870525af8f7e7fccf575a0ca5394ce55adcec"
> > > +
> > > diff --git a/meta-arm/recipes-security/optee/optee-os/0001-libutils-provide-empty-__getauxval-implementation.patch b/meta-arm/recipes-security/optee/optee-os/0001-libutils-provide-empty-__getauxval-implementation.patch
> > > deleted file mode 100644
> > > index 0120f5c..0000000
> > > --- a/meta-arm/recipes-security/optee/optee-os/0001-libutils-provide-empty-__getauxval-implementation.patch
> > > +++ /dev/null
> > > @@ -1,62 +0,0 @@
> > > -Upstream-Status: Backport
> > > -Signed-off-by: Ross Burton <ross.burton@arm.com>
> > > -
> > > -From 36e784f621bf5d5be9183beba35f39426277c110 Mon Sep 17 00:00:00 2001
> > > -From: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
> > > -Date: Tue, 13 Oct 2020 22:45:39 +0300
> > > -Subject: [PATCH 1/3] libutils: provide empty __getauxval() implementation
> > > -
> > > -Never version of libgcc are built with LSE implementation in mind. To
> > > -determine if LSE is available on platform it calls __getauxval(), so in
> > > -some cases we can get undefined reference to __getauxval() error.
> > > -
> > > -Prominent case is libgcc_eh.a library, which is used by C++ TAs. Exception
> > > -handler depends on atomic operations, so it tries to call
> > > -init_have_lse_atomics() first. This function in turn calls __getauxval(),
> > > -which causes linking error.
> > > -
> > > -In the future we can make __getauxval() to return actual platform
> > > -capabilities.
> > > -
> > > -Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
> > > -Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
> > > -Reviewed-by: Jerome Forissier <jerome@forissier.org>
> > > ----
> > > - lib/libutils/ext/arch/arm/auxval.c | 12 ++++++++++++
> > > - lib/libutils/ext/arch/arm/sub.mk   |  1 +
> > > - 2 files changed, 13 insertions(+)
> > > - create mode 100644 lib/libutils/ext/arch/arm/auxval.c
> > > -
> > > -diff --git a/lib/libutils/ext/arch/arm/auxval.c b/lib/libutils/ext/arch/arm/auxval.c
> > > -new file mode 100644
> > > -index 00000000..98bca850
> > > ---- /dev/null
> > > -+++ b/lib/libutils/ext/arch/arm/auxval.c
> > > -@@ -0,0 +1,12 @@
> > > -+// SPDX-License-Identifier: BSD-2-Clause
> > > -+/*
> > > -+ * Copyright (c) 2020, EPAM Systems
> > > -+ */
> > > -+
> > > -+#include <compiler.h>
> > > -+
> > > -+unsigned long int __getauxval (unsigned long int type);
> > > -+unsigned long int __getauxval (unsigned long int type __unused)
> > > -+{
> > > -+      return 0;
> > > -+}
> > > -diff --git a/lib/libutils/ext/arch/arm/sub.mk b/lib/libutils/ext/arch/arm/sub.mk
> > > -index dc5eed67..2e779066 100644
> > > ---- a/lib/libutils/ext/arch/arm/sub.mk
> > > -+++ b/lib/libutils/ext/arch/arm/sub.mk
> > > -@@ -3,6 +3,7 @@ srcs-$(CFG_ARM32_$(sm)) += aeabi_unwind.c
> > > - endif
> > > - srcs-$(CFG_ARM32_$(sm)) += atomic_a32.S
> > > - srcs-$(CFG_ARM64_$(sm)) += atomic_a64.S
> > > -+srcs-y += auxval.c
> > > - ifneq ($(sm),ldelf) # TA, core
> > > - srcs-$(CFG_ARM32_$(sm)) += mcount_a32.S
> > > - srcs-$(CFG_ARM64_$(sm)) += mcount_a64.S
> > > ---
> > > -2.25.1
> > > -
> > > diff --git a/meta-arm/recipes-security/optee/optee-os/0002-link.mk-implement-support-for-libnames-after-libgcc-.patch b/meta-arm/recipes-security/optee/optee-os/0002-link.mk-implement-support-for-libnames-after-libgcc-.patch
> > > deleted file mode 100644
> > > index 11296c8..0000000
> > > --- a/meta-arm/recipes-security/optee/optee-os/0002-link.mk-implement-support-for-libnames-after-libgcc-.patch
> > > +++ /dev/null
> > > @@ -1,55 +0,0 @@
> > > -Upstream-Status: Backport
> > > -Signed-off-by: Ross Burton <ross.burton@arm.com>
> > > -
> > > -From 73196b58ea6978ffa5e581738030f51c5789ef73 Mon Sep 17 00:00:00 2001
> > > -From: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
> > > -Date: Tue, 13 Oct 2020 22:54:13 +0300
> > > -Subject: [PATCH 2/3] link.mk: implement support for libnames-after-libgcc
> > > - variable
> > > -
> > > -Newer versions of libgcc depend on external __getauxval() symbol, which is
> > > -now provided by libutils. But libgcc is linked after libutils, so linker
> > > -can't resolve that symbol. We can't include libgcc into linking group with
> > > -libtutils, because libgcc provides symbols that conflict with libutil's
> > > -ones, like __aeabi_idiv with friends for instance.
> > > -
> > > -So, to resolve libgcc dependency on libutils we need to link with libutils
> > > -second time. To make things more generic, we will introduce
> > > -$(libnames-after-libgcc) variable for libraries that should be linked after
> > > -libgcc.
> > > -
> > > -Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
> > > -Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
> > > -Reviewed-by: Jerome Forissier <jerome@forissier.org>
> > > ----
> > > - ta/arch/arm/link.mk | 6 +++++-
> > > - 1 file changed, 5 insertions(+), 1 deletion(-)
> > > -
> > > -diff --git a/ta/arch/arm/link.mk b/ta/arch/arm/link.mk
> > > -index 445c285d..3025acb1 100644
> > > ---- a/ta/arch/arm/link.mk
> > > -+++ b/ta/arch/arm/link.mk
> > > -@@ -55,8 +55,11 @@ link-ldflags += --eh-frame-hdr
> > > - link-ldadd += $(libstdc++$(sm)) $(libgcc_eh$(sm))
> > > - endif
> > > - link-ldadd += --end-group
> > > --ldargs-$(user-ta-uuid).elf := $(link-ldflags) $(objs) $(link-ldadd) $(libgcc$(sm))
> > > -
> > > -+link-ldadd-after-libgcc += $(addprefix -l,$(libnames-after-libgcc))
> > > -+
> > > -+ldargs-$(user-ta-uuid).elf := $(link-ldflags) $(objs) $(link-ldadd) \
> > > -+                              $(libgcc$(sm)) $(link-ldadd-after-libgcc)
> > > -
> > > - link-script-cppflags-$(sm) := \
> > > -       $(filter-out $(CPPFLAGS_REMOVE) $(cppflags-remove), \
> > > -@@ -76,6 +79,7 @@ $(link-script-pp$(sm)): $(link-script$(sm)) $(conf-file) $(link-script-pp-makefi
> > > -               $(link-script-cppflags-$(sm)) $$< -o $$@
> > > -
> > > - $(link-out-dir$(sm))/$(user-ta-uuid).elf: $(objs) $(libdeps) \
> > > -+                                        $(libdeps-after-libgcc) \
> > > -                                         $(link-script-pp$(sm)) \
> > > -                                         $(dynlistdep) \
> > > -                                         $(additional-link-deps)
> > > ---
> > > -2.25.1
> > > -
> > > diff --git a/meta-arm/recipes-security/optee/optee-os/0003-ta_dev_kit.mk-make-sure-that-libutils-is-linked-seco.patch b/meta-arm/recipes-security/optee/optee-os/0003-ta_dev_kit.mk-make-sure-that-libutils-is-linked-seco.patch
> > > deleted file mode 100644
> > > index 88ba5f8..0000000
> > > --- a/meta-arm/recipes-security/optee/optee-os/0003-ta_dev_kit.mk-make-sure-that-libutils-is-linked-seco.patch
> > > +++ /dev/null
> > > @@ -1,44 +0,0 @@
> > > -Upstream-Status: Backport
> > > -Signed-off-by: Ross Burton <ross.burton@arm.com>
> > > -
> > > -From f50962e3f56f0932662b2ffa10afe53339a335dd Mon Sep 17 00:00:00 2001
> > > -From: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
> > > -Date: Fri, 16 Oct 2020 16:36:08 +0300
> > > -Subject: [PATCH 3/3] ta_dev_kit.mk: make sure that libutils is linked second
> > > - time
> > > -
> > > -libgcc depends on __getauxval symbol from libuils. As, generally libutils
> > > -is linked before libgcc, we will get "unresolved symbol" error. To resolve
> > > -this dependency we need to link libutils second time - after libgcc.
> > > -
> > > -Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
> > > -Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
> > > -Reviewed-by: Jerome Forissier <jerome@forissier.org>
> > > ----
> > > - ta/mk/ta_dev_kit.mk | 10 ++++++++++
> > > - 1 file changed, 10 insertions(+)
> > > -
> > > -diff --git a/ta/mk/ta_dev_kit.mk b/ta/mk/ta_dev_kit.mk
> > > -index e28be677..d0e66317 100644
> > > ---- a/ta/mk/ta_dev_kit.mk
> > > -+++ b/ta/mk/ta_dev_kit.mk
> > > -@@ -78,6 +78,16 @@ endif
> > > - libnames += dl
> > > - libdeps += $(ta-dev-kit-dir$(sm))/lib/libdl.a
> > > -
> > > -+# libutils provides __getauxval symbol which is needed by libgcc 10.x. We can't
> > > -+# link libutils after libgcc, because libgcc will replace some symbols provided
> > > -+# by libutils, which will cause further linking issues.
> > > -+#
> > > -+# But if we place libutils before libgcc, linker will not be able to resolve
> > > -+# __getauxval. So we need to link with libutils twice: before and after libgcc.
> > > -+# Hence it included both in $(libnames) and in $(libnames-after-libgcc)
> > > -+libnames-after-libgcc += utils
> > > -+libdeps-after-libgcc += $(ta-dev-kit-dir$(sm))/lib/libutils.a
> > > -+
> > > - # Pass config variable (CFG_) from conf.mk on the command line
> > > - cppflags$(sm) += $(strip \
> > > -       $(foreach var, $(filter CFG_%,$(.VARIABLES)), \
> > > ---
> > > -2.25.1
> > > -
> > > diff --git a/meta-arm/recipes-security/optee/optee-os_3.11.0.bb b/meta-arm/recipes-security/optee/optee-os_3.11.0.bb
> > > deleted file mode 100644
> > > index 13b3dc6..0000000
> > > --- a/meta-arm/recipes-security/optee/optee-os_3.11.0.bb
> > > +++ /dev/null
> > > @@ -1,11 +0,0 @@
> > > -require optee-os.inc
> > > -
> > > -SRCREV = "c4def2a8262a03244d9a88461699b9b8e43c6b55"
> > > -
> > > -SRC_URI_append = " \
> > > -    file://0006-allow-setting-sysroot-for-libgcc-lookup.patch \
> > > -    file://0007-allow-setting-sysroot-for-clang.patch \
> > > -    file://0001-libutils-provide-empty-__getauxval-implementation.patch \
> > > -    file://0002-link.mk-implement-support-for-libnames-after-libgcc-.patch \
> > > -    file://0003-ta_dev_kit.mk-make-sure-that-libutils-is-linked-seco.patch \
> > > -"
> > > diff --git a/meta-arm/recipes-security/optee/optee-os_3.14.0.bb b/meta-arm/recipes-security/optee/optee-os_3.14.0.bb
> > > new file mode 100644
> > > index 0000000..3289e2c
> > > --- /dev/null
> > > +++ b/meta-arm/recipes-security/optee/optee-os_3.14.0.bb
> > > @@ -0,0 +1,8 @@
> > > +require optee-os.inc
> > > +
> > > +SRCREV = "d21befa5e53eae9db469eba1685f5aa5c6f92c2f"
> > > +
> > > +SRC_URI_append = " \
> > > +    file://0006-allow-setting-sysroot-for-libgcc-lookup.patch \
> > > +    file://0007-allow-setting-sysroot-for-clang.patch \
> > > +"
> > > diff --git a/meta-arm/recipes-security/optee/optee-test.inc b/meta-arm/recipes-security/optee/optee-test.inc
> > > index f09b9d2..bcbcc06 100644
> > > --- a/meta-arm/recipes-security/optee/optee-test.inc
> > > +++ b/meta-arm/recipes-security/optee/optee-test.inc
> > > @@ -8,17 +8,9 @@ LIC_FILES_CHKSUM = "file://${S}/LICENSE.md;md5=daa2bcccc666345ab8940aab1315a4fa"
> > >  inherit python3native ptest
> > >  require optee.inc
> > >
> > > -# Linking fails on musl due to C++/threads
> > > -# https://github.com/OP-TEE/optee_test/issues/458#issuecomment-720540834
> > > -# When upgraded we should be able to remove this limitation
> > > -COMPATIBLE_HOST_libc-musl = 'null'
> > > -
> > >  DEPENDS = "optee-client optee-os python3-pycryptodome-native"
> > >
> > >  SRC_URI = "git://github.com/OP-TEE/optee_test.git \
> > > -           file://0001-host-xtest-Adjust-order-of-including-compiler.h.patch \
> > > -           file://0002-make-remove-Wno-unsafe-loop-for-clang.patch \
> > > -           file://0003-make-remove-Wmissing-noreturn-for-clang.patch \
> > >             file://run-ptest \
> > >            "
> > >
> > > @@ -36,6 +28,7 @@ do_compile() {
> > >      # Top level makefile doesn't seem to handle parallel make gracefully
> > >      oe_runmake xtest
> > >      oe_runmake ta
> > > +    oe_runmake test_plugin
> > >  }
> > >  do_compile[cleandirs] = "${B}"
> > >
> > > @@ -46,9 +39,13 @@ do_install () {
> > >      # default TEEC_LOAD_PATH is /lib
> > >      mkdir -p ${D}${nonarch_base_libdir}/optee_armtz/
> > >      install -D -p -m0444 ${B}/ta/*/*.ta ${D}${nonarch_base_libdir}/optee_armtz/
> > > +    mkdir -p ${D}${libdir}/tee-supplicant/plugins
> > > +    install -D -p -m0444 ${B}/supp_plugin/*.plugin ${D}${libdir}/tee-supplicant/plugins/
> > >  }
> > >
> > > -FILES_${PN} += "${nonarch_base_libdir}/optee_armtz/"
> > > +FILES_${PN} += "${nonarch_base_libdir}/optee_armtz/ \
> > > +                ${libdir}/tee-supplicant/plugins/ \
> > > +               "
> > >
> > >  # Imports machine specific configs from staging to build
> > >  PACKAGE_ARCH = "${MACHINE_ARCH}"
> > > diff --git a/meta-arm/recipes-security/optee/optee-test/0001-host-xtest-Adjust-order-of-including-compiler.h.patch b/meta-arm/recipes-security/optee/optee-test/0001-host-xtest-Adjust-order-of-including-compiler.h.patch
> > > deleted file mode 100644
> > > index 3c500d7..0000000
> > > --- a/meta-arm/recipes-security/optee/optee-test/0001-host-xtest-Adjust-order-of-including-compiler.h.patch
> > > +++ /dev/null
> > > @@ -1,64 +0,0 @@
> > > -From fc95b3ccbbfd336797ae2cfd6dd4dc58644e146f Mon Sep 17 00:00:00 2001
> > > -From: Khem Raj <raj.khem@gmail.com>
> > > -Date: Sat, 30 May 2020 17:52:18 -0700
> > > -Subject: [PATCH] host/xtest: Adjust order of including compiler.h
> > > -
> > > -compiler.h defines some defines which violate libc namespace e.g.
> > > -__unused, this works ok with glibc but fails in awkward ways with musl
> > > -the reason is musl uses __unused in its internal structures and this
> > > -define in compiler.h conflicts with system headers causing errors like
> > > -
> > > -recipe-sysroot/usr/include/bits/stat.h:17:19: error: expected identifier or '(' before '[' token unsigned __unused[2];
> > > -                   ^
> > > -including compiler.h afer sys/stat.h fixes the problem.
> > > -
> > > -Upstream-Status: Pending [https://github.com/OP-TEE/optee_test/issues/453]
> > > -Signed-off-by: Khem Raj <raj.khem@gmail.com>
> > > ----
> > > - host/xtest/install_ta.c | 2 +-
> > > - host/xtest/stats.c      | 2 +-
> > > - 2 files changed, 2 insertions(+), 2 deletions(-)
> > > -
> > > -diff --git a/host/xtest/install_ta.c b/host/xtest/install_ta.c
> > > -index 09a4c6d..6f7bb5c 100644
> > > ---- a/host/xtest/install_ta.c
> > > -+++ b/host/xtest/install_ta.c
> > > -@@ -4,7 +4,6 @@
> > > -  * SPDX-License-Identifier: BSD-2-Clause
> > > -  */
> > > -
> > > --#include <compiler.h>
> > > - #include <dirent.h>
> > > - #include <err.h>
> > > - #include <errno.h>
> > > -@@ -20,6 +19,7 @@
> > > - #include <sys/types.h>
> > > - #include <tee_client_api.h>
> > > - #include <unistd.h>
> > > -+#include <compiler.h>
> > > -
> > > - #include "install_ta.h"
> > > - #include "xtest_helpers.h"
> > > -diff --git a/host/xtest/stats.c b/host/xtest/stats.c
> > > -index 96b0b5f..db9bf25 100644
> > > ---- a/host/xtest/stats.c
> > > -+++ b/host/xtest/stats.c
> > > -@@ -3,7 +3,6 @@
> > > -  * Copyright (c) 2019, Linaro Limited
> > > -  */
> > > -
> > > --#include <compiler.h>
> > > - #include <dirent.h>
> > > - #include <err.h>
> > > - #include <errno.h>
> > > -@@ -18,6 +17,7 @@
> > > - #include <sys/types.h>
> > > - #include <tee_client_api.h>
> > > - #include <unistd.h>
> > > -+#include <compiler.h>
> > > - #include "xtest_test.h"
> > > - #include "stats.h"
> > > -
> > > ---
> > > -2.26.2
> > > -
> > > diff --git a/meta-arm/recipes-security/optee/optee-test/0002-make-remove-Wno-unsafe-loop-for-clang.patch b/meta-arm/recipes-security/optee/optee-test/0002-make-remove-Wno-unsafe-loop-for-clang.patch
> > > deleted file mode 100644
> > > index 17dd7d8..0000000
> > > --- a/meta-arm/recipes-security/optee/optee-test/0002-make-remove-Wno-unsafe-loop-for-clang.patch
> > > +++ /dev/null
> > > @@ -1,31 +0,0 @@
> > > -From 438533ce9da1df0b7c7914e64b39ffdc1da1ab79 Mon Sep 17 00:00:00 2001
> > > -From: Brett Warren <brett.warran@arm.com>
> > > -Date: Thu, 8 Oct 2020 10:03:25 +0100
> > > -Subject: [PATCH] make: remove -Wmissing-noreturn for clang
> > > -
> > > -When compiling when clang, -Wmissing-noreturn causes an error because
> > > -of non-compliant code. This option is removed to workaround this.
> > > -
> > > -Upstream-Status: Pending [https://github.com/OP-TEE/optee_test/issues/452]
> > > -Changed-Id: 71cb511904547d790d1ea98f93bf8e5a6afcb36d
> > > -Signed-off-by: Brett Warren <brett.warren@arm.com>
> > > ----
> > > - host/xtest/Makefile | 2 +-
> > > - 1 file changed, 1 insertion(+), 1 deletion(-)
> > > -
> > > -diff --git a/host/xtest/Makefile b/host/xtest/Makefile
> > > -index 3c206b0..96746de 100644
> > > ---- a/host/xtest/Makefile
> > > -+++ b/host/xtest/Makefile
> > > -@@ -169,7 +169,7 @@ CFLAGS += -Wall -Wcast-align -Werror \
> > > -         -Werror-implicit-function-declaration -Wextra -Wfloat-equal \
> > > -         -Wformat-nonliteral -Wformat-security -Wformat=2 -Winit-self \
> > > -         -Wmissing-declarations -Wmissing-format-attribute \
> > > --        -Wmissing-include-dirs -Wmissing-noreturn \
> > > -+        -Wmissing-include-dirs \
> > > -         -Wmissing-prototypes -Wnested-externs -Wpointer-arith \
> > > -         -Wshadow -Wstrict-prototypes -Wswitch-default \
> > > -         -Wwrite-strings \
> > > ---
> > > -2.17.1
> > > -
> > > diff --git a/meta-arm/recipes-security/optee/optee-test/0003-make-remove-Wmissing-noreturn-for-clang.patch b/meta-arm/recipes-security/optee/optee-test/0003-make-remove-Wmissing-noreturn-for-clang.patch
> > > deleted file mode 100644
> > > index bbc303f..0000000
> > > --- a/meta-arm/recipes-security/optee/optee-test/0003-make-remove-Wmissing-noreturn-for-clang.patch
> > > +++ /dev/null
> > > @@ -1,31 +0,0 @@
> > > -From ed5a9d9f7a3e9e14ca0e8aea59008124ee0e5f96 Mon Sep 17 00:00:00 2001
> > > -From: Brett Warren <brett.warren@arm.com>
> > > -Date: Thu, 8 Oct 2020 10:20:52 +0100
> > > -Subject: [PATCH] make: remove -Wno-unsafe-loop for clang
> > > -
> > > -When compiling with clang, the -Wno-unsafe-loop-optimizations option
> > > -throws an error because clang doesn't recognise it. This option is
> > > -removed to workaround this.
> > > -
> > > -Upstream-Status: Pending [https://github.com/OP-TEE/optee_test/issues/452]
> > > -Change-Id: 5fe0892c73208aaffac8c9995cb3275936fb1ba6
> > > -Signed-off-by: Brett Warren <brett.warren@arm.com>
> > > ----
> > > - host/xtest/Makefile | 1 -
> > > - 1 file changed, 1 deletion(-)
> > > -
> > > -diff --git a/host/xtest/Makefile b/host/xtest/Makefile
> > > -index 96746de..73731d0 100644
> > > ---- a/host/xtest/Makefile
> > > -+++ b/host/xtest/Makefile
> > > -@@ -174,7 +174,6 @@ CFLAGS += -Wall -Wcast-align -Werror \
> > > -         -Wshadow -Wstrict-prototypes -Wswitch-default \
> > > -         -Wwrite-strings \
> > > -         -Wno-declaration-after-statement \
> > > --        -Wno-unsafe-loop-optimizations \
> > > -         -Wno-missing-field-initializers -Wno-format-zero-length
> > > - endif
> > > -
> > > ---
> > > -2.17.1
> > > -
> > > diff --git a/meta-arm/recipes-security/optee/optee-test_3.11.0.bb b/meta-arm/recipes-security/optee/optee-test_3.11.0.bb
> > > deleted file mode 100644
> > > index 0f8b5b0..0000000
> > > --- a/meta-arm/recipes-security/optee/optee-test_3.11.0.bb
> > > +++ /dev/null
> > > @@ -1,3 +0,0 @@
> > > -require optee-test.inc
> > > -
> > > -SRCREV = "159e295d5cc3ad2275ab15fe544620f6604d4ba4"
> > > diff --git a/meta-arm/recipes-security/optee/optee-test_3.14.0.bb b/meta-arm/recipes-security/optee/optee-test_3.14.0.bb
> > > new file mode 100644
> > > index 0000000..6367c27
> > > --- /dev/null
> > > +++ b/meta-arm/recipes-security/optee/optee-test_3.14.0.bb
> > > @@ -0,0 +1,3 @@
> > > +require optee-test.inc
> > > +
> > > +SRCREV = "f2eb88affbb7f028561b4fd5cbd049d5d704f741"
> > > --
> > > 2.25.1
> > >
> > >
> > >
> > >
>
> 
>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [meta-arm] [PATCH] arm/optee: version uplift 3.11.0 -> 3.14.0
  2021-07-26 14:01     ` Jon Mason
@ 2021-07-27  6:52       ` Sumit Garg
  2021-07-27 12:18         ` Ross Burton
  0 siblings, 1 reply; 11+ messages in thread
From: Sumit Garg @ 2021-07-27  6:52 UTC (permalink / raw)
  To: Jon Mason; +Cc: Ross Burton, meta-arm, Jon Mason, Ross Burton

Hi Jon,

On Mon, 26 Jul 2021 at 19:31, Jon Mason <jdmason@kudzu.us> wrote:
>
> On Mon, Jul 26, 2021 at 3:10 AM Sumit Garg <sumit.garg@linaro.org> wrote:
> >
> > Hi Ross,
> >
> > On Sat, 24 Jul 2021 at 00:36, Ross Burton <ross@burtonini.com> wrote:
> > >
> > > The optee-examples recipe is broken:
> > >
> > > install: cannot stat
> > > '/builds/engineering/yocto/meta-arm/work/build/tmp/work/qemuarm64_secureboot-poky-linux/optee-examples/3.14.0-r0/build/plugins/*':
> > > No such file or directory
> > >
> > > (qemuarm64-secureboot can build it)
> > >
> >
> > Strangely, it works fine for me when building for
> > qemuarm64-secureboot. Can you check if the following patches have been
> > correctly applied in the corresponding work directory?
> >
> >            file://0001-plugins-Honour-default-cross-compiler-environment-se.patch
> > \
> >            file://0002-Makefile-Enable-plugins-installation-in-rootfs.patch \
>
> I'm seeing the same issue Ross is describing.  I would expect a
> warning or error if it couldn't find the patches while building, not
> when installing.

Yeah you are correct but I am not able to figure the reason for this behaviour.

> Can you confirm you are building optee-examples, in
> addition to core-image-minimal/base?
> See https://gitlab.com/jonmason00/meta-arm/-/jobs/1444856281#L3594
>

Yeah I am building optee-examples in addition to core-image-minimal/base.

- Changes to default poky conf/local.conf:

MACHINE = "qemuarm64-secureboot"
CORE_IMAGE_EXTRA_INSTALL += "optee-examples optee-test"

- Changes to default poky conf/bblayers.conf with additional layers as:

meta-arm/meta-arm-toolchain
meta-arm/meta-arm

Here is optee-examples build folder directory structure for me:

$ tree tmp/work/qemuarm64_secureboot-poky-linux/optee-examples/3.14.0-r0/build/
tmp/work/qemuarm64_secureboot-poky-linux/optee-examples/3.14.0-r0/build/
├── ca
│   ├── optee_example_acipher
│   ├── optee_example_aes
│   ├── optee_example_hello_world
│   ├── optee_example_hotp
│   ├── optee_example_plugins
│   ├── optee_example_random
│   └── optee_example_secure_storage
├── plugins
│   └── 96bcf744-4f72-4866-bf1d-8634fd9c65e5.plugin
└── ta
    ├── 2a287631-de1b-4fdd-a55c-b9312e40769a.ta
    ├── 484d4143-2d53-4841-3120-4a6f636b6542.ta
    ├── 5dbac793-f574-4871-8ad3-04331ec17f24.ta
    ├── 8aaaf200-2450-11e4-abe2-0002a5d5c51b.ta
    ├── a734eed9-d6a1-4244-aa50-7c99719e7b7b.ta
    ├── b6c53aba-9669-4668-a7f2-205629d00f86.ta
    └── f4e750bb-1437-4fbf-8785-8d3580c34994.ta

3 directories, 15 files

> Looks to me like the issue is with newly added line
> https://gitlab.com/jonmason00/meta-arm/-/blob/master-next/meta-arm/recipes-security/optee/optee-examples.inc#L39
>

Looks like this link is pointing to a line where OP-TEE uprev patch
isn't applied. Were you referring to following line?

+    install -D -p -m0444 ${B}/plugins/* ${D}${libdir}/tee-supplicant/plugins

As evident from optee-examples build folder above, the plugins
directory shouldn't be empty for a successful optee-examples build.

-Sumit

> Thanks,
> Jon
>
> >
> > -Sumit
> >
> > > Ross
> > >
> > > On Tue, 20 Jul 2021 at 11:07, Sumit Garg <sumit.garg@linaro.org> wrote:
> > > >
> > > > Brief description of changes:
> > > > - Version uplift 3.11.0 -> 3.14.0.
> > > > - Removed OP-TEE patches that has already been accepted upstream.
> > > > - Added support for tee-supplicant plugin framework testing.
> > > >
> > > > Tested on qemuarm64_secureboot:
> > > > $ xtest -l 15
> > > > $ optee-examples_*
> > > >
> > > > Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
> > > > ---
> > > >  .../optee/optee-client_3.11.0.bb              |   3 -
> > > >  .../optee/optee-client_3.14.0.bb              |   3 +
> > > >  .../recipes-security/optee/optee-examples.inc |   9 +-
> > > >  .../0001-make-Pass-ldflags-during-link.patch  | 103 ------------------
> > > >  ...efault-cross-compiler-environment-se.patch |  84 ++++++++++++++
> > > >  ...nable-plugins-installation-in-rootfs.patch |  39 +++++++
> > > >  .../optee/optee-examples_3.11.0.bb            |   4 -
> > > >  .../optee/optee-examples_3.14.0.bb            |   4 +
> > > >  ...ide-empty-__getauxval-implementation.patch |  62 -----------
> > > >  ...t-support-for-libnames-after-libgcc-.patch |  55 ----------
> > > >  ...ke-sure-that-libutils-is-linked-seco.patch |  44 --------
> > > >  .../recipes-security/optee/optee-os_3.11.0.bb |  11 --
> > > >  .../recipes-security/optee/optee-os_3.14.0.bb |   8 ++
> > > >  .../recipes-security/optee/optee-test.inc     |  15 +--
> > > >  ...Adjust-order-of-including-compiler.h.patch |  64 -----------
> > > >  ...ake-remove-Wno-unsafe-loop-for-clang.patch |  31 ------
> > > >  ...e-remove-Wmissing-noreturn-for-clang.patch |  31 ------
> > > >  .../optee/optee-test_3.11.0.bb                |   3 -
> > > >  .../optee/optee-test_3.14.0.bb                |   3 +
> > > >  19 files changed, 154 insertions(+), 422 deletions(-)
> > > >  delete mode 100644 meta-arm/recipes-security/optee/optee-client_3.11.0.bb
> > > >  create mode 100644 meta-arm/recipes-security/optee/optee-client_3.14.0.bb
> > > >  delete mode 100644 meta-arm/recipes-security/optee/optee-examples/0001-make-Pass-ldflags-during-link.patch
> > > >  create mode 100644 meta-arm/recipes-security/optee/optee-examples/0001-plugins-Honour-default-cross-compiler-environment-se.patch
> > > >  create mode 100644 meta-arm/recipes-security/optee/optee-examples/0002-Makefile-Enable-plugins-installation-in-rootfs.patch
> > > >  delete mode 100644 meta-arm/recipes-security/optee/optee-examples_3.11.0.bb
> > > >  create mode 100644 meta-arm/recipes-security/optee/optee-examples_3.14.0.bb
> > > >  delete mode 100644 meta-arm/recipes-security/optee/optee-os/0001-libutils-provide-empty-__getauxval-implementation.patch
> > > >  delete mode 100644 meta-arm/recipes-security/optee/optee-os/0002-link.mk-implement-support-for-libnames-after-libgcc-.patch
> > > >  delete mode 100644 meta-arm/recipes-security/optee/optee-os/0003-ta_dev_kit.mk-make-sure-that-libutils-is-linked-seco.patch
> > > >  delete mode 100644 meta-arm/recipes-security/optee/optee-os_3.11.0.bb
> > > >  create mode 100644 meta-arm/recipes-security/optee/optee-os_3.14.0.bb
> > > >  delete mode 100644 meta-arm/recipes-security/optee/optee-test/0001-host-xtest-Adjust-order-of-including-compiler.h.patch
> > > >  delete mode 100644 meta-arm/recipes-security/optee/optee-test/0002-make-remove-Wno-unsafe-loop-for-clang.patch
> > > >  delete mode 100644 meta-arm/recipes-security/optee/optee-test/0003-make-remove-Wmissing-noreturn-for-clang.patch
> > > >  delete mode 100644 meta-arm/recipes-security/optee/optee-test_3.11.0.bb
> > > >  create mode 100644 meta-arm/recipes-security/optee/optee-test_3.14.0.bb
> > > >
> > > > diff --git a/meta-arm/recipes-security/optee/optee-client_3.11.0.bb b/meta-arm/recipes-security/optee/optee-client_3.11.0.bb
> > > > deleted file mode 100644
> > > > index f765d12..0000000
> > > > --- a/meta-arm/recipes-security/optee/optee-client_3.11.0.bb
> > > > +++ /dev/null
> > > > @@ -1,3 +0,0 @@
> > > > -require optee-client.inc
> > > > -
> > > > -SRCREV = "c0c925384c1d7e3558d27d2708857482952d7907"
> > > > diff --git a/meta-arm/recipes-security/optee/optee-client_3.14.0.bb b/meta-arm/recipes-security/optee/optee-client_3.14.0.bb
> > > > new file mode 100644
> > > > index 0000000..be78b88
> > > > --- /dev/null
> > > > +++ b/meta-arm/recipes-security/optee/optee-client_3.14.0.bb
> > > > @@ -0,0 +1,3 @@
> > > > +require optee-client.inc
> > > > +
> > > > +SRCREV = "06e1b32f6a7028e039c625b07cfc25fda0c17d53"
> > > > diff --git a/meta-arm/recipes-security/optee/optee-examples.inc b/meta-arm/recipes-security/optee/optee-examples.inc
> > > > index 81c31bc..f2e53f3 100644
> > > > --- a/meta-arm/recipes-security/optee/optee-examples.inc
> > > > +++ b/meta-arm/recipes-security/optee/optee-examples.inc
> > > > @@ -12,7 +12,8 @@ inherit python3native
> > > >  require optee.inc
> > > >
> > > >  SRC_URI = "git://github.com/linaro-swg/optee_examples.git \
> > > > -           file://0001-make-Pass-ldflags-during-link.patch \
> > > > +           file://0001-plugins-Honour-default-cross-compiler-environment-se.patch \
> > > > +           file://0002-Makefile-Enable-plugins-installation-in-rootfs.patch \
> > > >            "
> > > >
> > > >  EXTRA_OEMAKE += "TA_DEV_KIT_DIR=${TA_DEV_KIT_DIR} \
> > > > @@ -32,11 +33,15 @@ do_compile[cleandirs] = "${B}"
> > > >  do_install () {
> > > >      mkdir -p ${D}${nonarch_base_libdir}/optee_armtz
> > > >      mkdir -p ${D}${bindir}
> > > > +    mkdir -p ${D}${libdir}/tee-supplicant/plugins
> > > >      install -D -p -m0755 ${B}/ca/* ${D}${bindir}
> > > >      install -D -p -m0444 ${B}/ta/* ${D}${nonarch_base_libdir}/optee_armtz
> > > > +    install -D -p -m0444 ${B}/plugins/* ${D}${libdir}/tee-supplicant/plugins
> > > >  }
> > > >
> > > > -FILES_${PN} += "${nonarch_base_libdir}/optee_armtz/"
> > > > +FILES_${PN} += "${nonarch_base_libdir}/optee_armtz/ \
> > > > +                ${libdir}/tee-supplicant/plugins/ \
> > > > +               "
> > > >
> > > >  # Imports machine specific configs from staging to build
> > > >  PACKAGE_ARCH = "${MACHINE_ARCH}"
> > > > diff --git a/meta-arm/recipes-security/optee/optee-examples/0001-make-Pass-ldflags-during-link.patch b/meta-arm/recipes-security/optee/optee-examples/0001-make-Pass-ldflags-during-link.patch
> > > > deleted file mode 100644
> > > > index 84202ef..0000000
> > > > --- a/meta-arm/recipes-security/optee/optee-examples/0001-make-Pass-ldflags-during-link.patch
> > > > +++ /dev/null
> > > > @@ -1,103 +0,0 @@
> > > > -From 29ae21de41f2fbab6dbecbbf408826b28de82df1 Mon Sep 17 00:00:00 2001
> > > > -From: Khem Raj <raj.khem@gmail.com>
> > > > -Date: Tue, 1 Sep 2020 21:09:56 -0700
> > > > -Subject: [PATCH] make: Pass ldflags during link
> > > > -
> > > > -OpenEmbeeded needs to pass essential linker flags to set correct flags
> > > > -for gnu_hash among others which sets the linking straight
> > > > -using LDFLAGS varible here means, we can affect the linker flags
> > > > -from build environment
> > > > -
> > > > -Upstream-Status: Submitted [https://github.com/linaro-swg/optee_examples/pull/85]
> > > > -
> > > > -Signed-off-by: Khem Raj <raj.khem@gmail.com>
> > > > ----
> > > > - acipher/host/Makefile        | 2 +-
> > > > - aes/host/Makefile            | 2 +-
> > > > - hello_world/host/Makefile    | 2 +-
> > > > - hotp/host/Makefile           | 2 +-
> > > > - random/host/Makefile         | 2 +-
> > > > - secure_storage/host/Makefile | 2 +-
> > > > - 6 files changed, 6 insertions(+), 6 deletions(-)
> > > > -
> > > > -diff --git a/acipher/host/Makefile b/acipher/host/Makefile
> > > > -index 8f4bc8a..c2cabef 100644
> > > > ---- a/acipher/host/Makefile
> > > > -+++ b/acipher/host/Makefile
> > > > -@@ -18,7 +18,7 @@ BINARY = optee_example_acipher
> > > > - all: $(BINARY)
> > > > -
> > > > - $(BINARY): $(OBJS)
> > > > --      $(CC) -o $@ $< $(LDADD)
> > > > -+      $(CC) -o $@ $< $(LDFLAGS) $(LDADD)
> > > > -
> > > > - .PHONY: clean
> > > > - clean:
> > > > -diff --git a/aes/host/Makefile b/aes/host/Makefile
> > > > -index dfeb4e8..f61c71b 100644
> > > > ---- a/aes/host/Makefile
> > > > -+++ b/aes/host/Makefile
> > > > -@@ -18,7 +18,7 @@ BINARY = optee_example_aes
> > > > - all: $(BINARY)
> > > > -
> > > > - $(BINARY): $(OBJS)
> > > > --      $(CC) -o $@ $< $(LDADD)
> > > > -+      $(CC) -o $@ $< $(LDFLAGS) $(LDADD)
> > > > -
> > > > - .PHONY: clean
> > > > - clean:
> > > > -diff --git a/hello_world/host/Makefile b/hello_world/host/Makefile
> > > > -index c4c8239..69cf42c 100644
> > > > ---- a/hello_world/host/Makefile
> > > > -+++ b/hello_world/host/Makefile
> > > > -@@ -18,7 +18,7 @@ BINARY = optee_example_hello_world
> > > > - all: $(BINARY)
> > > > -
> > > > - $(BINARY): $(OBJS)
> > > > --      $(CC) -o $@ $< $(LDADD)
> > > > -+      $(CC) -o $@ $< $(LDFLAGS) $(LDADD)
> > > > -
> > > > - .PHONY: clean
> > > > - clean:
> > > > -diff --git a/hotp/host/Makefile b/hotp/host/Makefile
> > > > -index cb7fd19..e7f013f 100644
> > > > ---- a/hotp/host/Makefile
> > > > -+++ b/hotp/host/Makefile
> > > > -@@ -18,7 +18,7 @@ BINARY = optee_example_hotp
> > > > - all: $(BINARY)
> > > > -
> > > > - $(BINARY): $(OBJS)
> > > > --      $(CC) -o $@ $< $(LDADD)
> > > > -+      $(CC) -o $@ $< $(LDFLAGS) $(LDADD)
> > > > -
> > > > - .PHONY: clean
> > > > - clean:
> > > > -diff --git a/random/host/Makefile b/random/host/Makefile
> > > > -index fd407d9..9377f7a 100644
> > > > ---- a/random/host/Makefile
> > > > -+++ b/random/host/Makefile
> > > > -@@ -18,7 +18,7 @@ BINARY = optee_example_random
> > > > - all: $(BINARY)
> > > > -
> > > > - $(BINARY): $(OBJS)
> > > > --      $(CC) -o $@ $< $(LDADD)
> > > > -+      $(CC) -o $@ $< $(LDFLAGS) $(LDADD)
> > > > -
> > > > - .PHONY: clean
> > > > - clean:
> > > > -diff --git a/secure_storage/host/Makefile b/secure_storage/host/Makefile
> > > > -index 29bfb87..b3265ae 100644
> > > > ---- a/secure_storage/host/Makefile
> > > > -+++ b/secure_storage/host/Makefile
> > > > -@@ -18,7 +18,7 @@ BINARY = optee_example_secure_storage
> > > > - all: $(BINARY)
> > > > -
> > > > - $(BINARY): $(OBJS)
> > > > --      $(CC) -o $@ $< $(LDADD)
> > > > -+      $(CC) -o $@ $< $(LDFLAGS) $(LDADD)
> > > > -
> > > > - .PHONY: clean
> > > > - clean:
> > > > ---
> > > > -2.28.0
> > > > -
> > > > diff --git a/meta-arm/recipes-security/optee/optee-examples/0001-plugins-Honour-default-cross-compiler-environment-se.patch b/meta-arm/recipes-security/optee/optee-examples/0001-plugins-Honour-default-cross-compiler-environment-se.patch
> > > > new file mode 100644
> > > > index 0000000..033e48c
> > > > --- /dev/null
> > > > +++ b/meta-arm/recipes-security/optee/optee-examples/0001-plugins-Honour-default-cross-compiler-environment-se.patch
> > > > @@ -0,0 +1,84 @@
> > > > +From 79c826c249001700007a6dffe80c3d61ff4428ef Mon Sep 17 00:00:00 2001
> > > > +From: Sumit Garg <sumit.garg@linaro.org>
> > > > +Date: Tue, 20 Jul 2021 13:54:30 +0530
> > > > +Subject: [PATCH 1/2] plugins: Honour default cross compiler environment setup
> > > > +
> > > > +Honour default $(CC), $(CFLAGS) and $(LDFLAGS) variables. Without this
> > > > +plugins example fails to build for OE/Yocto.
> > > > +
> > > > +Upstream-Status: Submitted [https://github.com/linaro-swg/optee_examples/pull/87]
> > > > +
> > > > +Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
> > > > +---
> > > > + plugins/Makefile        |  2 +-
> > > > + plugins/host/Makefile   |  2 +-
> > > > + plugins/syslog/Makefile | 16 ++++++++++++----
> > > > + 3 files changed, 14 insertions(+), 6 deletions(-)
> > > > +
> > > > +diff --git a/plugins/Makefile b/plugins/Makefile
> > > > +index 2372b38..ea472b4 100644
> > > > +--- a/plugins/Makefile
> > > > ++++ b/plugins/Makefile
> > > > +@@ -8,7 +8,7 @@ TA_CROSS_COMPILE ?= $(CROSS_COMPILE)
> > > > + all:
> > > > +       $(MAKE) -C host CROSS_COMPILE="$(HOST_CROSS_COMPILE)" --no-builtin-variables
> > > > +       $(MAKE) -C ta CROSS_COMPILE="$(TA_CROSS_COMPILE)" LDFLAGS=""
> > > > +-      $(MAKE) -C syslog CROSS_COMPILE="$(HOST_CROSS_COMPILE)"
> > > > ++      $(MAKE) -C syslog CROSS_COMPILE="$(HOST_CROSS_COMPILE)" --no-builtin-variables
> > > > +
> > > > + .PHONY: clean
> > > > + clean:
> > > > +diff --git a/plugins/host/Makefile b/plugins/host/Makefile
> > > > +index 7285104..76244c7 100644
> > > > +--- a/plugins/host/Makefile
> > > > ++++ b/plugins/host/Makefile
> > > > +@@ -20,7 +20,7 @@ BINARY = optee_example_plugins
> > > > + all: $(BINARY)
> > > > +
> > > > + $(BINARY): $(OBJS)
> > > > +-      $(CC) -o $@ $< $(LDADD)
> > > > ++      $(CC) $(LDFLAGS) -o $@ $< $(LDADD)
> > > > +
> > > > + .PHONY: clean
> > > > + clean:
> > > > +diff --git a/plugins/syslog/Makefile b/plugins/syslog/Makefile
> > > > +index 62d916a..71f5f92 100644
> > > > +--- a/plugins/syslog/Makefile
> > > > ++++ b/plugins/syslog/Makefile
> > > > +@@ -1,3 +1,11 @@
> > > > ++CC      ?= $(CROSS_COMPILE)gcc
> > > > ++LD      ?= $(CROSS_COMPILE)ld
> > > > ++AR      ?= $(CROSS_COMPILE)ar
> > > > ++NM      ?= $(CROSS_COMPILE)nm
> > > > ++OBJCOPY ?= $(CROSS_COMPILE)objcopy
> > > > ++OBJDUMP ?= $(CROSS_COMPILE)objdump
> > > > ++READELF ?= $(CROSS_COMPILE)readelf
> > > > ++
> > > > + PLUGIN_UUID = 96bcf744-4f72-4866-bf1d-8634fd9c65e5
> > > > +
> > > > + PLUGIN                        = $(PLUGIN_UUID).plugin
> > > > +@@ -6,17 +14,17 @@ PLUGIN_OBJ          = $(patsubst %.c, %.o, $(PLUGIN_SRS))
> > > > + PLUGIN_INCLUDES_DIR   = $(CURDIR) $(TEEC_EXPORT)/include
> > > > +
> > > > + PLUGIN_INCLUDES               = $(addprefix -I, $(PLUGIN_INCLUDES_DIR))
> > > > +-PLUGIN_CCFLAGS                = -Wall -fPIC
> > > > +-PLUGIN_LDFLAGS                = -shared
> > > > ++PLUGIN_CCFLAGS                = $(CFLAGS) -Wall -fPIC
> > > > ++PLUGIN_LDFLAGS                = $(LDFLAGS) -shared
> > > > +
> > > > + .PHONY: all
> > > > + all: $(PLUGIN)
> > > > +
> > > > + $(PLUGIN): $(PLUGIN_OBJ)
> > > > +-      $(CROSS_COMPILE)gcc $(PLUGIN_LDFLAGS) $(PLUGIN_OBJ) -o $@
> > > > ++      $(CC) $(PLUGIN_LDFLAGS) $(PLUGIN_OBJ) -o $@
> > > > +
> > > > + %.o: %.c
> > > > +-      $(CROSS_COMPILE)gcc $(PLUGIN_CCFLAGS) $(PLUGIN_INCLUDES) -c $*.c -o $*.o
> > > > ++      $(CC) $(PLUGIN_CCFLAGS) $(PLUGIN_INCLUDES) -c $*.c -o $*.o
> > > > +
> > > > + .PHONY: clean
> > > > + clean:
> > > > +--
> > > > +2.25.1
> > > > +
> > > > diff --git a/meta-arm/recipes-security/optee/optee-examples/0002-Makefile-Enable-plugins-installation-in-rootfs.patch b/meta-arm/recipes-security/optee/optee-examples/0002-Makefile-Enable-plugins-installation-in-rootfs.patch
> > > > new file mode 100644
> > > > index 0000000..8d1d60a
> > > > --- /dev/null
> > > > +++ b/meta-arm/recipes-security/optee/optee-examples/0002-Makefile-Enable-plugins-installation-in-rootfs.patch
> > > > @@ -0,0 +1,39 @@
> > > > +From a865f2e25e178fc2c4617eb1faf79ac922d02ffd Mon Sep 17 00:00:00 2001
> > > > +From: Sumit Garg <sumit.garg@linaro.org>
> > > > +Date: Tue, 20 Jul 2021 14:20:10 +0530
> > > > +Subject: [PATCH 2/2] Makefile: Enable plugins installation in rootfs
> > > > +
> > > > +Upstream-Status: Submitted [https://github.com/linaro-swg/optee_examples/pull/87]
> > > > +
> > > > +Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
> > > > +---
> > > > + Makefile | 5 +++++
> > > > + 1 file changed, 5 insertions(+)
> > > > +
> > > > +diff --git a/Makefile b/Makefile
> > > > +index a275842..b3f16aa 100644
> > > > +--- a/Makefile
> > > > ++++ b/Makefile
> > > > +@@ -25,14 +25,19 @@ prepare-for-rootfs: examples
> > > > +       @mkdir -p $(OUTPUT_DIR)
> > > > +       @mkdir -p $(OUTPUT_DIR)/ta
> > > > +       @mkdir -p $(OUTPUT_DIR)/ca
> > > > ++      @mkdir -p $(OUTPUT_DIR)/plugins
> > > > +       @for example in $(EXAMPLE_LIST); do \
> > > > +               if [ -e $$example/host/optee_example_$$example ]; then \
> > > > +                       cp -p $$example/host/optee_example_$$example $(OUTPUT_DIR)/ca/; \
> > > > +               fi; \
> > > > +               cp -pr $$example/ta/*.ta $(OUTPUT_DIR)/ta/; \
> > > > ++              if [ $$example == plugins ]; then \
> > > > ++                      cp -p plugins/syslog/*.plugin $(OUTPUT_DIR)/plugins/; \
> > > > ++              fi; \
> > > > +       done
> > > > +
> > > > + prepare-for-rootfs-clean:
> > > > +       @rm -rf $(OUTPUT_DIR)/ta
> > > > +       @rm -rf $(OUTPUT_DIR)/ca
> > > > ++      @rm -rf $(OUTPUT_DIR)/plugins
> > > > +       @rmdir --ignore-fail-on-non-empty $(OUTPUT_DIR) || test ! -e $(OUTPUT_DIR)
> > > > +--
> > > > +2.25.1
> > > > +
> > > > diff --git a/meta-arm/recipes-security/optee/optee-examples_3.11.0.bb b/meta-arm/recipes-security/optee/optee-examples_3.11.0.bb
> > > > deleted file mode 100644
> > > > index 72473ed..0000000
> > > > --- a/meta-arm/recipes-security/optee/optee-examples_3.11.0.bb
> > > > +++ /dev/null
> > > > @@ -1,4 +0,0 @@
> > > > -require optee-examples.inc
> > > > -
> > > > -SRCREV = "9a7dc598591990349d88b4dba3a37aadd6851295"
> > > > -
> > > > diff --git a/meta-arm/recipes-security/optee/optee-examples_3.14.0.bb b/meta-arm/recipes-security/optee/optee-examples_3.14.0.bb
> > > > new file mode 100644
> > > > index 0000000..f2b5f7d
> > > > --- /dev/null
> > > > +++ b/meta-arm/recipes-security/optee/optee-examples_3.14.0.bb
> > > > @@ -0,0 +1,4 @@
> > > > +require optee-examples.inc
> > > > +
> > > > +SRCREV = "e9c870525af8f7e7fccf575a0ca5394ce55adcec"
> > > > +
> > > > diff --git a/meta-arm/recipes-security/optee/optee-os/0001-libutils-provide-empty-__getauxval-implementation.patch b/meta-arm/recipes-security/optee/optee-os/0001-libutils-provide-empty-__getauxval-implementation.patch
> > > > deleted file mode 100644
> > > > index 0120f5c..0000000
> > > > --- a/meta-arm/recipes-security/optee/optee-os/0001-libutils-provide-empty-__getauxval-implementation.patch
> > > > +++ /dev/null
> > > > @@ -1,62 +0,0 @@
> > > > -Upstream-Status: Backport
> > > > -Signed-off-by: Ross Burton <ross.burton@arm.com>
> > > > -
> > > > -From 36e784f621bf5d5be9183beba35f39426277c110 Mon Sep 17 00:00:00 2001
> > > > -From: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
> > > > -Date: Tue, 13 Oct 2020 22:45:39 +0300
> > > > -Subject: [PATCH 1/3] libutils: provide empty __getauxval() implementation
> > > > -
> > > > -Never version of libgcc are built with LSE implementation in mind. To
> > > > -determine if LSE is available on platform it calls __getauxval(), so in
> > > > -some cases we can get undefined reference to __getauxval() error.
> > > > -
> > > > -Prominent case is libgcc_eh.a library, which is used by C++ TAs. Exception
> > > > -handler depends on atomic operations, so it tries to call
> > > > -init_have_lse_atomics() first. This function in turn calls __getauxval(),
> > > > -which causes linking error.
> > > > -
> > > > -In the future we can make __getauxval() to return actual platform
> > > > -capabilities.
> > > > -
> > > > -Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
> > > > -Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
> > > > -Reviewed-by: Jerome Forissier <jerome@forissier.org>
> > > > ----
> > > > - lib/libutils/ext/arch/arm/auxval.c | 12 ++++++++++++
> > > > - lib/libutils/ext/arch/arm/sub.mk   |  1 +
> > > > - 2 files changed, 13 insertions(+)
> > > > - create mode 100644 lib/libutils/ext/arch/arm/auxval.c
> > > > -
> > > > -diff --git a/lib/libutils/ext/arch/arm/auxval.c b/lib/libutils/ext/arch/arm/auxval.c
> > > > -new file mode 100644
> > > > -index 00000000..98bca850
> > > > ---- /dev/null
> > > > -+++ b/lib/libutils/ext/arch/arm/auxval.c
> > > > -@@ -0,0 +1,12 @@
> > > > -+// SPDX-License-Identifier: BSD-2-Clause
> > > > -+/*
> > > > -+ * Copyright (c) 2020, EPAM Systems
> > > > -+ */
> > > > -+
> > > > -+#include <compiler.h>
> > > > -+
> > > > -+unsigned long int __getauxval (unsigned long int type);
> > > > -+unsigned long int __getauxval (unsigned long int type __unused)
> > > > -+{
> > > > -+      return 0;
> > > > -+}
> > > > -diff --git a/lib/libutils/ext/arch/arm/sub.mk b/lib/libutils/ext/arch/arm/sub.mk
> > > > -index dc5eed67..2e779066 100644
> > > > ---- a/lib/libutils/ext/arch/arm/sub.mk
> > > > -+++ b/lib/libutils/ext/arch/arm/sub.mk
> > > > -@@ -3,6 +3,7 @@ srcs-$(CFG_ARM32_$(sm)) += aeabi_unwind.c
> > > > - endif
> > > > - srcs-$(CFG_ARM32_$(sm)) += atomic_a32.S
> > > > - srcs-$(CFG_ARM64_$(sm)) += atomic_a64.S
> > > > -+srcs-y += auxval.c
> > > > - ifneq ($(sm),ldelf) # TA, core
> > > > - srcs-$(CFG_ARM32_$(sm)) += mcount_a32.S
> > > > - srcs-$(CFG_ARM64_$(sm)) += mcount_a64.S
> > > > ---
> > > > -2.25.1
> > > > -
> > > > diff --git a/meta-arm/recipes-security/optee/optee-os/0002-link.mk-implement-support-for-libnames-after-libgcc-.patch b/meta-arm/recipes-security/optee/optee-os/0002-link.mk-implement-support-for-libnames-after-libgcc-.patch
> > > > deleted file mode 100644
> > > > index 11296c8..0000000
> > > > --- a/meta-arm/recipes-security/optee/optee-os/0002-link.mk-implement-support-for-libnames-after-libgcc-.patch
> > > > +++ /dev/null
> > > > @@ -1,55 +0,0 @@
> > > > -Upstream-Status: Backport
> > > > -Signed-off-by: Ross Burton <ross.burton@arm.com>
> > > > -
> > > > -From 73196b58ea6978ffa5e581738030f51c5789ef73 Mon Sep 17 00:00:00 2001
> > > > -From: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
> > > > -Date: Tue, 13 Oct 2020 22:54:13 +0300
> > > > -Subject: [PATCH 2/3] link.mk: implement support for libnames-after-libgcc
> > > > - variable
> > > > -
> > > > -Newer versions of libgcc depend on external __getauxval() symbol, which is
> > > > -now provided by libutils. But libgcc is linked after libutils, so linker
> > > > -can't resolve that symbol. We can't include libgcc into linking group with
> > > > -libtutils, because libgcc provides symbols that conflict with libutil's
> > > > -ones, like __aeabi_idiv with friends for instance.
> > > > -
> > > > -So, to resolve libgcc dependency on libutils we need to link with libutils
> > > > -second time. To make things more generic, we will introduce
> > > > -$(libnames-after-libgcc) variable for libraries that should be linked after
> > > > -libgcc.
> > > > -
> > > > -Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
> > > > -Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
> > > > -Reviewed-by: Jerome Forissier <jerome@forissier.org>
> > > > ----
> > > > - ta/arch/arm/link.mk | 6 +++++-
> > > > - 1 file changed, 5 insertions(+), 1 deletion(-)
> > > > -
> > > > -diff --git a/ta/arch/arm/link.mk b/ta/arch/arm/link.mk
> > > > -index 445c285d..3025acb1 100644
> > > > ---- a/ta/arch/arm/link.mk
> > > > -+++ b/ta/arch/arm/link.mk
> > > > -@@ -55,8 +55,11 @@ link-ldflags += --eh-frame-hdr
> > > > - link-ldadd += $(libstdc++$(sm)) $(libgcc_eh$(sm))
> > > > - endif
> > > > - link-ldadd += --end-group
> > > > --ldargs-$(user-ta-uuid).elf := $(link-ldflags) $(objs) $(link-ldadd) $(libgcc$(sm))
> > > > -
> > > > -+link-ldadd-after-libgcc += $(addprefix -l,$(libnames-after-libgcc))
> > > > -+
> > > > -+ldargs-$(user-ta-uuid).elf := $(link-ldflags) $(objs) $(link-ldadd) \
> > > > -+                              $(libgcc$(sm)) $(link-ldadd-after-libgcc)
> > > > -
> > > > - link-script-cppflags-$(sm) := \
> > > > -       $(filter-out $(CPPFLAGS_REMOVE) $(cppflags-remove), \
> > > > -@@ -76,6 +79,7 @@ $(link-script-pp$(sm)): $(link-script$(sm)) $(conf-file) $(link-script-pp-makefi
> > > > -               $(link-script-cppflags-$(sm)) $$< -o $$@
> > > > -
> > > > - $(link-out-dir$(sm))/$(user-ta-uuid).elf: $(objs) $(libdeps) \
> > > > -+                                        $(libdeps-after-libgcc) \
> > > > -                                         $(link-script-pp$(sm)) \
> > > > -                                         $(dynlistdep) \
> > > > -                                         $(additional-link-deps)
> > > > ---
> > > > -2.25.1
> > > > -
> > > > diff --git a/meta-arm/recipes-security/optee/optee-os/0003-ta_dev_kit.mk-make-sure-that-libutils-is-linked-seco.patch b/meta-arm/recipes-security/optee/optee-os/0003-ta_dev_kit.mk-make-sure-that-libutils-is-linked-seco.patch
> > > > deleted file mode 100644
> > > > index 88ba5f8..0000000
> > > > --- a/meta-arm/recipes-security/optee/optee-os/0003-ta_dev_kit.mk-make-sure-that-libutils-is-linked-seco.patch
> > > > +++ /dev/null
> > > > @@ -1,44 +0,0 @@
> > > > -Upstream-Status: Backport
> > > > -Signed-off-by: Ross Burton <ross.burton@arm.com>
> > > > -
> > > > -From f50962e3f56f0932662b2ffa10afe53339a335dd Mon Sep 17 00:00:00 2001
> > > > -From: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
> > > > -Date: Fri, 16 Oct 2020 16:36:08 +0300
> > > > -Subject: [PATCH 3/3] ta_dev_kit.mk: make sure that libutils is linked second
> > > > - time
> > > > -
> > > > -libgcc depends on __getauxval symbol from libuils. As, generally libutils
> > > > -is linked before libgcc, we will get "unresolved symbol" error. To resolve
> > > > -this dependency we need to link libutils second time - after libgcc.
> > > > -
> > > > -Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
> > > > -Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
> > > > -Reviewed-by: Jerome Forissier <jerome@forissier.org>
> > > > ----
> > > > - ta/mk/ta_dev_kit.mk | 10 ++++++++++
> > > > - 1 file changed, 10 insertions(+)
> > > > -
> > > > -diff --git a/ta/mk/ta_dev_kit.mk b/ta/mk/ta_dev_kit.mk
> > > > -index e28be677..d0e66317 100644
> > > > ---- a/ta/mk/ta_dev_kit.mk
> > > > -+++ b/ta/mk/ta_dev_kit.mk
> > > > -@@ -78,6 +78,16 @@ endif
> > > > - libnames += dl
> > > > - libdeps += $(ta-dev-kit-dir$(sm))/lib/libdl.a
> > > > -
> > > > -+# libutils provides __getauxval symbol which is needed by libgcc 10.x. We can't
> > > > -+# link libutils after libgcc, because libgcc will replace some symbols provided
> > > > -+# by libutils, which will cause further linking issues.
> > > > -+#
> > > > -+# But if we place libutils before libgcc, linker will not be able to resolve
> > > > -+# __getauxval. So we need to link with libutils twice: before and after libgcc.
> > > > -+# Hence it included both in $(libnames) and in $(libnames-after-libgcc)
> > > > -+libnames-after-libgcc += utils
> > > > -+libdeps-after-libgcc += $(ta-dev-kit-dir$(sm))/lib/libutils.a
> > > > -+
> > > > - # Pass config variable (CFG_) from conf.mk on the command line
> > > > - cppflags$(sm) += $(strip \
> > > > -       $(foreach var, $(filter CFG_%,$(.VARIABLES)), \
> > > > ---
> > > > -2.25.1
> > > > -
> > > > diff --git a/meta-arm/recipes-security/optee/optee-os_3.11.0.bb b/meta-arm/recipes-security/optee/optee-os_3.11.0.bb
> > > > deleted file mode 100644
> > > > index 13b3dc6..0000000
> > > > --- a/meta-arm/recipes-security/optee/optee-os_3.11.0.bb
> > > > +++ /dev/null
> > > > @@ -1,11 +0,0 @@
> > > > -require optee-os.inc
> > > > -
> > > > -SRCREV = "c4def2a8262a03244d9a88461699b9b8e43c6b55"
> > > > -
> > > > -SRC_URI_append = " \
> > > > -    file://0006-allow-setting-sysroot-for-libgcc-lookup.patch \
> > > > -    file://0007-allow-setting-sysroot-for-clang.patch \
> > > > -    file://0001-libutils-provide-empty-__getauxval-implementation.patch \
> > > > -    file://0002-link.mk-implement-support-for-libnames-after-libgcc-.patch \
> > > > -    file://0003-ta_dev_kit.mk-make-sure-that-libutils-is-linked-seco.patch \
> > > > -"
> > > > diff --git a/meta-arm/recipes-security/optee/optee-os_3.14.0.bb b/meta-arm/recipes-security/optee/optee-os_3.14.0.bb
> > > > new file mode 100644
> > > > index 0000000..3289e2c
> > > > --- /dev/null
> > > > +++ b/meta-arm/recipes-security/optee/optee-os_3.14.0.bb
> > > > @@ -0,0 +1,8 @@
> > > > +require optee-os.inc
> > > > +
> > > > +SRCREV = "d21befa5e53eae9db469eba1685f5aa5c6f92c2f"
> > > > +
> > > > +SRC_URI_append = " \
> > > > +    file://0006-allow-setting-sysroot-for-libgcc-lookup.patch \
> > > > +    file://0007-allow-setting-sysroot-for-clang.patch \
> > > > +"
> > > > diff --git a/meta-arm/recipes-security/optee/optee-test.inc b/meta-arm/recipes-security/optee/optee-test.inc
> > > > index f09b9d2..bcbcc06 100644
> > > > --- a/meta-arm/recipes-security/optee/optee-test.inc
> > > > +++ b/meta-arm/recipes-security/optee/optee-test.inc
> > > > @@ -8,17 +8,9 @@ LIC_FILES_CHKSUM = "file://${S}/LICENSE.md;md5=daa2bcccc666345ab8940aab1315a4fa"
> > > >  inherit python3native ptest
> > > >  require optee.inc
> > > >
> > > > -# Linking fails on musl due to C++/threads
> > > > -# https://github.com/OP-TEE/optee_test/issues/458#issuecomment-720540834
> > > > -# When upgraded we should be able to remove this limitation
> > > > -COMPATIBLE_HOST_libc-musl = 'null'
> > > > -
> > > >  DEPENDS = "optee-client optee-os python3-pycryptodome-native"
> > > >
> > > >  SRC_URI = "git://github.com/OP-TEE/optee_test.git \
> > > > -           file://0001-host-xtest-Adjust-order-of-including-compiler.h.patch \
> > > > -           file://0002-make-remove-Wno-unsafe-loop-for-clang.patch \
> > > > -           file://0003-make-remove-Wmissing-noreturn-for-clang.patch \
> > > >             file://run-ptest \
> > > >            "
> > > >
> > > > @@ -36,6 +28,7 @@ do_compile() {
> > > >      # Top level makefile doesn't seem to handle parallel make gracefully
> > > >      oe_runmake xtest
> > > >      oe_runmake ta
> > > > +    oe_runmake test_plugin
> > > >  }
> > > >  do_compile[cleandirs] = "${B}"
> > > >
> > > > @@ -46,9 +39,13 @@ do_install () {
> > > >      # default TEEC_LOAD_PATH is /lib
> > > >      mkdir -p ${D}${nonarch_base_libdir}/optee_armtz/
> > > >      install -D -p -m0444 ${B}/ta/*/*.ta ${D}${nonarch_base_libdir}/optee_armtz/
> > > > +    mkdir -p ${D}${libdir}/tee-supplicant/plugins
> > > > +    install -D -p -m0444 ${B}/supp_plugin/*.plugin ${D}${libdir}/tee-supplicant/plugins/
> > > >  }
> > > >
> > > > -FILES_${PN} += "${nonarch_base_libdir}/optee_armtz/"
> > > > +FILES_${PN} += "${nonarch_base_libdir}/optee_armtz/ \
> > > > +                ${libdir}/tee-supplicant/plugins/ \
> > > > +               "
> > > >
> > > >  # Imports machine specific configs from staging to build
> > > >  PACKAGE_ARCH = "${MACHINE_ARCH}"
> > > > diff --git a/meta-arm/recipes-security/optee/optee-test/0001-host-xtest-Adjust-order-of-including-compiler.h.patch b/meta-arm/recipes-security/optee/optee-test/0001-host-xtest-Adjust-order-of-including-compiler.h.patch
> > > > deleted file mode 100644
> > > > index 3c500d7..0000000
> > > > --- a/meta-arm/recipes-security/optee/optee-test/0001-host-xtest-Adjust-order-of-including-compiler.h.patch
> > > > +++ /dev/null
> > > > @@ -1,64 +0,0 @@
> > > > -From fc95b3ccbbfd336797ae2cfd6dd4dc58644e146f Mon Sep 17 00:00:00 2001
> > > > -From: Khem Raj <raj.khem@gmail.com>
> > > > -Date: Sat, 30 May 2020 17:52:18 -0700
> > > > -Subject: [PATCH] host/xtest: Adjust order of including compiler.h
> > > > -
> > > > -compiler.h defines some defines which violate libc namespace e.g.
> > > > -__unused, this works ok with glibc but fails in awkward ways with musl
> > > > -the reason is musl uses __unused in its internal structures and this
> > > > -define in compiler.h conflicts with system headers causing errors like
> > > > -
> > > > -recipe-sysroot/usr/include/bits/stat.h:17:19: error: expected identifier or '(' before '[' token unsigned __unused[2];
> > > > -                   ^
> > > > -including compiler.h afer sys/stat.h fixes the problem.
> > > > -
> > > > -Upstream-Status: Pending [https://github.com/OP-TEE/optee_test/issues/453]
> > > > -Signed-off-by: Khem Raj <raj.khem@gmail.com>
> > > > ----
> > > > - host/xtest/install_ta.c | 2 +-
> > > > - host/xtest/stats.c      | 2 +-
> > > > - 2 files changed, 2 insertions(+), 2 deletions(-)
> > > > -
> > > > -diff --git a/host/xtest/install_ta.c b/host/xtest/install_ta.c
> > > > -index 09a4c6d..6f7bb5c 100644
> > > > ---- a/host/xtest/install_ta.c
> > > > -+++ b/host/xtest/install_ta.c
> > > > -@@ -4,7 +4,6 @@
> > > > -  * SPDX-License-Identifier: BSD-2-Clause
> > > > -  */
> > > > -
> > > > --#include <compiler.h>
> > > > - #include <dirent.h>
> > > > - #include <err.h>
> > > > - #include <errno.h>
> > > > -@@ -20,6 +19,7 @@
> > > > - #include <sys/types.h>
> > > > - #include <tee_client_api.h>
> > > > - #include <unistd.h>
> > > > -+#include <compiler.h>
> > > > -
> > > > - #include "install_ta.h"
> > > > - #include "xtest_helpers.h"
> > > > -diff --git a/host/xtest/stats.c b/host/xtest/stats.c
> > > > -index 96b0b5f..db9bf25 100644
> > > > ---- a/host/xtest/stats.c
> > > > -+++ b/host/xtest/stats.c
> > > > -@@ -3,7 +3,6 @@
> > > > -  * Copyright (c) 2019, Linaro Limited
> > > > -  */
> > > > -
> > > > --#include <compiler.h>
> > > > - #include <dirent.h>
> > > > - #include <err.h>
> > > > - #include <errno.h>
> > > > -@@ -18,6 +17,7 @@
> > > > - #include <sys/types.h>
> > > > - #include <tee_client_api.h>
> > > > - #include <unistd.h>
> > > > -+#include <compiler.h>
> > > > - #include "xtest_test.h"
> > > > - #include "stats.h"
> > > > -
> > > > ---
> > > > -2.26.2
> > > > -
> > > > diff --git a/meta-arm/recipes-security/optee/optee-test/0002-make-remove-Wno-unsafe-loop-for-clang.patch b/meta-arm/recipes-security/optee/optee-test/0002-make-remove-Wno-unsafe-loop-for-clang.patch
> > > > deleted file mode 100644
> > > > index 17dd7d8..0000000
> > > > --- a/meta-arm/recipes-security/optee/optee-test/0002-make-remove-Wno-unsafe-loop-for-clang.patch
> > > > +++ /dev/null
> > > > @@ -1,31 +0,0 @@
> > > > -From 438533ce9da1df0b7c7914e64b39ffdc1da1ab79 Mon Sep 17 00:00:00 2001
> > > > -From: Brett Warren <brett.warran@arm.com>
> > > > -Date: Thu, 8 Oct 2020 10:03:25 +0100
> > > > -Subject: [PATCH] make: remove -Wmissing-noreturn for clang
> > > > -
> > > > -When compiling when clang, -Wmissing-noreturn causes an error because
> > > > -of non-compliant code. This option is removed to workaround this.
> > > > -
> > > > -Upstream-Status: Pending [https://github.com/OP-TEE/optee_test/issues/452]
> > > > -Changed-Id: 71cb511904547d790d1ea98f93bf8e5a6afcb36d
> > > > -Signed-off-by: Brett Warren <brett.warren@arm.com>
> > > > ----
> > > > - host/xtest/Makefile | 2 +-
> > > > - 1 file changed, 1 insertion(+), 1 deletion(-)
> > > > -
> > > > -diff --git a/host/xtest/Makefile b/host/xtest/Makefile
> > > > -index 3c206b0..96746de 100644
> > > > ---- a/host/xtest/Makefile
> > > > -+++ b/host/xtest/Makefile
> > > > -@@ -169,7 +169,7 @@ CFLAGS += -Wall -Wcast-align -Werror \
> > > > -         -Werror-implicit-function-declaration -Wextra -Wfloat-equal \
> > > > -         -Wformat-nonliteral -Wformat-security -Wformat=2 -Winit-self \
> > > > -         -Wmissing-declarations -Wmissing-format-attribute \
> > > > --        -Wmissing-include-dirs -Wmissing-noreturn \
> > > > -+        -Wmissing-include-dirs \
> > > > -         -Wmissing-prototypes -Wnested-externs -Wpointer-arith \
> > > > -         -Wshadow -Wstrict-prototypes -Wswitch-default \
> > > > -         -Wwrite-strings \
> > > > ---
> > > > -2.17.1
> > > > -
> > > > diff --git a/meta-arm/recipes-security/optee/optee-test/0003-make-remove-Wmissing-noreturn-for-clang.patch b/meta-arm/recipes-security/optee/optee-test/0003-make-remove-Wmissing-noreturn-for-clang.patch
> > > > deleted file mode 100644
> > > > index bbc303f..0000000
> > > > --- a/meta-arm/recipes-security/optee/optee-test/0003-make-remove-Wmissing-noreturn-for-clang.patch
> > > > +++ /dev/null
> > > > @@ -1,31 +0,0 @@
> > > > -From ed5a9d9f7a3e9e14ca0e8aea59008124ee0e5f96 Mon Sep 17 00:00:00 2001
> > > > -From: Brett Warren <brett.warren@arm.com>
> > > > -Date: Thu, 8 Oct 2020 10:20:52 +0100
> > > > -Subject: [PATCH] make: remove -Wno-unsafe-loop for clang
> > > > -
> > > > -When compiling with clang, the -Wno-unsafe-loop-optimizations option
> > > > -throws an error because clang doesn't recognise it. This option is
> > > > -removed to workaround this.
> > > > -
> > > > -Upstream-Status: Pending [https://github.com/OP-TEE/optee_test/issues/452]
> > > > -Change-Id: 5fe0892c73208aaffac8c9995cb3275936fb1ba6
> > > > -Signed-off-by: Brett Warren <brett.warren@arm.com>
> > > > ----
> > > > - host/xtest/Makefile | 1 -
> > > > - 1 file changed, 1 deletion(-)
> > > > -
> > > > -diff --git a/host/xtest/Makefile b/host/xtest/Makefile
> > > > -index 96746de..73731d0 100644
> > > > ---- a/host/xtest/Makefile
> > > > -+++ b/host/xtest/Makefile
> > > > -@@ -174,7 +174,6 @@ CFLAGS += -Wall -Wcast-align -Werror \
> > > > -         -Wshadow -Wstrict-prototypes -Wswitch-default \
> > > > -         -Wwrite-strings \
> > > > -         -Wno-declaration-after-statement \
> > > > --        -Wno-unsafe-loop-optimizations \
> > > > -         -Wno-missing-field-initializers -Wno-format-zero-length
> > > > - endif
> > > > -
> > > > ---
> > > > -2.17.1
> > > > -
> > > > diff --git a/meta-arm/recipes-security/optee/optee-test_3.11.0.bb b/meta-arm/recipes-security/optee/optee-test_3.11.0.bb
> > > > deleted file mode 100644
> > > > index 0f8b5b0..0000000
> > > > --- a/meta-arm/recipes-security/optee/optee-test_3.11.0.bb
> > > > +++ /dev/null
> > > > @@ -1,3 +0,0 @@
> > > > -require optee-test.inc
> > > > -
> > > > -SRCREV = "159e295d5cc3ad2275ab15fe544620f6604d4ba4"
> > > > diff --git a/meta-arm/recipes-security/optee/optee-test_3.14.0.bb b/meta-arm/recipes-security/optee/optee-test_3.14.0.bb
> > > > new file mode 100644
> > > > index 0000000..6367c27
> > > > --- /dev/null
> > > > +++ b/meta-arm/recipes-security/optee/optee-test_3.14.0.bb
> > > > @@ -0,0 +1,3 @@
> > > > +require optee-test.inc
> > > > +
> > > > +SRCREV = "f2eb88affbb7f028561b4fd5cbd049d5d704f741"
> > > > --
> > > > 2.25.1
> > > >
> > > >
> > > >
> > > >
> >
> > 
> >

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [meta-arm] [PATCH] arm/optee: version uplift 3.11.0 -> 3.14.0
  2021-07-27  6:52       ` Sumit Garg
@ 2021-07-27 12:18         ` Ross Burton
  2021-07-27 12:22           ` Ross Burton
  0 siblings, 1 reply; 11+ messages in thread
From: Ross Burton @ 2021-07-27 12:18 UTC (permalink / raw)
  To: Sumit Garg; +Cc: Jon Mason, meta-arm, Jon Mason, Ross Burton

Ah, this might be the problem from log.do_compile:

Copying example CA and TA binaries to
/yocto/ross/build/tmp/work/qemuarm64_secureboot-poky-linux/optee-examples/3.14.0-r0/build...
/bin/sh: 6: [: acipher: unexpected operator
/bin/sh: 6: [: plugins: unexpected operator
/bin/sh: 6: [: hello_world: unexpected operator
/bin/sh: 6: [: hotp: unexpected operator
/bin/sh: 6: [: aes: unexpected operator
/bin/sh: 6: [: random: unexpected operator
/bin/sh: 6: [: secure_storage: unexpected operator

Ross

On Tue, 27 Jul 2021 at 07:52, Sumit Garg <sumit.garg@linaro.org> wrote:
>
> Hi Jon,
>
> On Mon, 26 Jul 2021 at 19:31, Jon Mason <jdmason@kudzu.us> wrote:
> >
> > On Mon, Jul 26, 2021 at 3:10 AM Sumit Garg <sumit.garg@linaro.org> wrote:
> > >
> > > Hi Ross,
> > >
> > > On Sat, 24 Jul 2021 at 00:36, Ross Burton <ross@burtonini.com> wrote:
> > > >
> > > > The optee-examples recipe is broken:
> > > >
> > > > install: cannot stat
> > > > '/builds/engineering/yocto/meta-arm/work/build/tmp/work/qemuarm64_secureboot-poky-linux/optee-examples/3.14.0-r0/build/plugins/*':
> > > > No such file or directory
> > > >
> > > > (qemuarm64-secureboot can build it)
> > > >
> > >
> > > Strangely, it works fine for me when building for
> > > qemuarm64-secureboot. Can you check if the following patches have been
> > > correctly applied in the corresponding work directory?
> > >
> > >            file://0001-plugins-Honour-default-cross-compiler-environment-se.patch
> > > \
> > >            file://0002-Makefile-Enable-plugins-installation-in-rootfs.patch \
> >
> > I'm seeing the same issue Ross is describing.  I would expect a
> > warning or error if it couldn't find the patches while building, not
> > when installing.
>
> Yeah you are correct but I am not able to figure the reason for this behaviour.
>
> > Can you confirm you are building optee-examples, in
> > addition to core-image-minimal/base?
> > See https://gitlab.com/jonmason00/meta-arm/-/jobs/1444856281#L3594
> >
>
> Yeah I am building optee-examples in addition to core-image-minimal/base.
>
> - Changes to default poky conf/local.conf:
>
> MACHINE = "qemuarm64-secureboot"
> CORE_IMAGE_EXTRA_INSTALL += "optee-examples optee-test"
>
> - Changes to default poky conf/bblayers.conf with additional layers as:
>
> meta-arm/meta-arm-toolchain
> meta-arm/meta-arm
>
> Here is optee-examples build folder directory structure for me:
>
> $ tree tmp/work/qemuarm64_secureboot-poky-linux/optee-examples/3.14.0-r0/build/
> tmp/work/qemuarm64_secureboot-poky-linux/optee-examples/3.14.0-r0/build/
> ├── ca
> │   ├── optee_example_acipher
> │   ├── optee_example_aes
> │   ├── optee_example_hello_world
> │   ├── optee_example_hotp
> │   ├── optee_example_plugins
> │   ├── optee_example_random
> │   └── optee_example_secure_storage
> ├── plugins
> │   └── 96bcf744-4f72-4866-bf1d-8634fd9c65e5.plugin
> └── ta
>     ├── 2a287631-de1b-4fdd-a55c-b9312e40769a.ta
>     ├── 484d4143-2d53-4841-3120-4a6f636b6542.ta
>     ├── 5dbac793-f574-4871-8ad3-04331ec17f24.ta
>     ├── 8aaaf200-2450-11e4-abe2-0002a5d5c51b.ta
>     ├── a734eed9-d6a1-4244-aa50-7c99719e7b7b.ta
>     ├── b6c53aba-9669-4668-a7f2-205629d00f86.ta
>     └── f4e750bb-1437-4fbf-8785-8d3580c34994.ta
>
> 3 directories, 15 files
>
> > Looks to me like the issue is with newly added line
> > https://gitlab.com/jonmason00/meta-arm/-/blob/master-next/meta-arm/recipes-security/optee/optee-examples.inc#L39
> >
>
> Looks like this link is pointing to a line where OP-TEE uprev patch
> isn't applied. Were you referring to following line?
>
> +    install -D -p -m0444 ${B}/plugins/* ${D}${libdir}/tee-supplicant/plugins
>
> As evident from optee-examples build folder above, the plugins
> directory shouldn't be empty for a successful optee-examples build.
>
> -Sumit
>
> > Thanks,
> > Jon
> >
> > >
> > > -Sumit
> > >
> > > > Ross
> > > >
> > > > On Tue, 20 Jul 2021 at 11:07, Sumit Garg <sumit.garg@linaro.org> wrote:
> > > > >
> > > > > Brief description of changes:
> > > > > - Version uplift 3.11.0 -> 3.14.0.
> > > > > - Removed OP-TEE patches that has already been accepted upstream.
> > > > > - Added support for tee-supplicant plugin framework testing.
> > > > >
> > > > > Tested on qemuarm64_secureboot:
> > > > > $ xtest -l 15
> > > > > $ optee-examples_*
> > > > >
> > > > > Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
> > > > > ---
> > > > >  .../optee/optee-client_3.11.0.bb              |   3 -
> > > > >  .../optee/optee-client_3.14.0.bb              |   3 +
> > > > >  .../recipes-security/optee/optee-examples.inc |   9 +-
> > > > >  .../0001-make-Pass-ldflags-during-link.patch  | 103 ------------------
> > > > >  ...efault-cross-compiler-environment-se.patch |  84 ++++++++++++++
> > > > >  ...nable-plugins-installation-in-rootfs.patch |  39 +++++++
> > > > >  .../optee/optee-examples_3.11.0.bb            |   4 -
> > > > >  .../optee/optee-examples_3.14.0.bb            |   4 +
> > > > >  ...ide-empty-__getauxval-implementation.patch |  62 -----------
> > > > >  ...t-support-for-libnames-after-libgcc-.patch |  55 ----------
> > > > >  ...ke-sure-that-libutils-is-linked-seco.patch |  44 --------
> > > > >  .../recipes-security/optee/optee-os_3.11.0.bb |  11 --
> > > > >  .../recipes-security/optee/optee-os_3.14.0.bb |   8 ++
> > > > >  .../recipes-security/optee/optee-test.inc     |  15 +--
> > > > >  ...Adjust-order-of-including-compiler.h.patch |  64 -----------
> > > > >  ...ake-remove-Wno-unsafe-loop-for-clang.patch |  31 ------
> > > > >  ...e-remove-Wmissing-noreturn-for-clang.patch |  31 ------
> > > > >  .../optee/optee-test_3.11.0.bb                |   3 -
> > > > >  .../optee/optee-test_3.14.0.bb                |   3 +
> > > > >  19 files changed, 154 insertions(+), 422 deletions(-)
> > > > >  delete mode 100644 meta-arm/recipes-security/optee/optee-client_3.11.0.bb
> > > > >  create mode 100644 meta-arm/recipes-security/optee/optee-client_3.14.0.bb
> > > > >  delete mode 100644 meta-arm/recipes-security/optee/optee-examples/0001-make-Pass-ldflags-during-link.patch
> > > > >  create mode 100644 meta-arm/recipes-security/optee/optee-examples/0001-plugins-Honour-default-cross-compiler-environment-se.patch
> > > > >  create mode 100644 meta-arm/recipes-security/optee/optee-examples/0002-Makefile-Enable-plugins-installation-in-rootfs.patch
> > > > >  delete mode 100644 meta-arm/recipes-security/optee/optee-examples_3.11.0.bb
> > > > >  create mode 100644 meta-arm/recipes-security/optee/optee-examples_3.14.0.bb
> > > > >  delete mode 100644 meta-arm/recipes-security/optee/optee-os/0001-libutils-provide-empty-__getauxval-implementation.patch
> > > > >  delete mode 100644 meta-arm/recipes-security/optee/optee-os/0002-link.mk-implement-support-for-libnames-after-libgcc-.patch
> > > > >  delete mode 100644 meta-arm/recipes-security/optee/optee-os/0003-ta_dev_kit.mk-make-sure-that-libutils-is-linked-seco.patch
> > > > >  delete mode 100644 meta-arm/recipes-security/optee/optee-os_3.11.0.bb
> > > > >  create mode 100644 meta-arm/recipes-security/optee/optee-os_3.14.0.bb
> > > > >  delete mode 100644 meta-arm/recipes-security/optee/optee-test/0001-host-xtest-Adjust-order-of-including-compiler.h.patch
> > > > >  delete mode 100644 meta-arm/recipes-security/optee/optee-test/0002-make-remove-Wno-unsafe-loop-for-clang.patch
> > > > >  delete mode 100644 meta-arm/recipes-security/optee/optee-test/0003-make-remove-Wmissing-noreturn-for-clang.patch
> > > > >  delete mode 100644 meta-arm/recipes-security/optee/optee-test_3.11.0.bb
> > > > >  create mode 100644 meta-arm/recipes-security/optee/optee-test_3.14.0.bb
> > > > >
> > > > > diff --git a/meta-arm/recipes-security/optee/optee-client_3.11.0.bb b/meta-arm/recipes-security/optee/optee-client_3.11.0.bb
> > > > > deleted file mode 100644
> > > > > index f765d12..0000000
> > > > > --- a/meta-arm/recipes-security/optee/optee-client_3.11.0.bb
> > > > > +++ /dev/null
> > > > > @@ -1,3 +0,0 @@
> > > > > -require optee-client.inc
> > > > > -
> > > > > -SRCREV = "c0c925384c1d7e3558d27d2708857482952d7907"
> > > > > diff --git a/meta-arm/recipes-security/optee/optee-client_3.14.0.bb b/meta-arm/recipes-security/optee/optee-client_3.14.0.bb
> > > > > new file mode 100644
> > > > > index 0000000..be78b88
> > > > > --- /dev/null
> > > > > +++ b/meta-arm/recipes-security/optee/optee-client_3.14.0.bb
> > > > > @@ -0,0 +1,3 @@
> > > > > +require optee-client.inc
> > > > > +
> > > > > +SRCREV = "06e1b32f6a7028e039c625b07cfc25fda0c17d53"
> > > > > diff --git a/meta-arm/recipes-security/optee/optee-examples.inc b/meta-arm/recipes-security/optee/optee-examples.inc
> > > > > index 81c31bc..f2e53f3 100644
> > > > > --- a/meta-arm/recipes-security/optee/optee-examples.inc
> > > > > +++ b/meta-arm/recipes-security/optee/optee-examples.inc
> > > > > @@ -12,7 +12,8 @@ inherit python3native
> > > > >  require optee.inc
> > > > >
> > > > >  SRC_URI = "git://github.com/linaro-swg/optee_examples.git \
> > > > > -           file://0001-make-Pass-ldflags-during-link.patch \
> > > > > +           file://0001-plugins-Honour-default-cross-compiler-environment-se.patch \
> > > > > +           file://0002-Makefile-Enable-plugins-installation-in-rootfs.patch \
> > > > >            "
> > > > >
> > > > >  EXTRA_OEMAKE += "TA_DEV_KIT_DIR=${TA_DEV_KIT_DIR} \
> > > > > @@ -32,11 +33,15 @@ do_compile[cleandirs] = "${B}"
> > > > >  do_install () {
> > > > >      mkdir -p ${D}${nonarch_base_libdir}/optee_armtz
> > > > >      mkdir -p ${D}${bindir}
> > > > > +    mkdir -p ${D}${libdir}/tee-supplicant/plugins
> > > > >      install -D -p -m0755 ${B}/ca/* ${D}${bindir}
> > > > >      install -D -p -m0444 ${B}/ta/* ${D}${nonarch_base_libdir}/optee_armtz
> > > > > +    install -D -p -m0444 ${B}/plugins/* ${D}${libdir}/tee-supplicant/plugins
> > > > >  }
> > > > >
> > > > > -FILES_${PN} += "${nonarch_base_libdir}/optee_armtz/"
> > > > > +FILES_${PN} += "${nonarch_base_libdir}/optee_armtz/ \
> > > > > +                ${libdir}/tee-supplicant/plugins/ \
> > > > > +               "
> > > > >
> > > > >  # Imports machine specific configs from staging to build
> > > > >  PACKAGE_ARCH = "${MACHINE_ARCH}"
> > > > > diff --git a/meta-arm/recipes-security/optee/optee-examples/0001-make-Pass-ldflags-during-link.patch b/meta-arm/recipes-security/optee/optee-examples/0001-make-Pass-ldflags-during-link.patch
> > > > > deleted file mode 100644
> > > > > index 84202ef..0000000
> > > > > --- a/meta-arm/recipes-security/optee/optee-examples/0001-make-Pass-ldflags-during-link.patch
> > > > > +++ /dev/null
> > > > > @@ -1,103 +0,0 @@
> > > > > -From 29ae21de41f2fbab6dbecbbf408826b28de82df1 Mon Sep 17 00:00:00 2001
> > > > > -From: Khem Raj <raj.khem@gmail.com>
> > > > > -Date: Tue, 1 Sep 2020 21:09:56 -0700
> > > > > -Subject: [PATCH] make: Pass ldflags during link
> > > > > -
> > > > > -OpenEmbeeded needs to pass essential linker flags to set correct flags
> > > > > -for gnu_hash among others which sets the linking straight
> > > > > -using LDFLAGS varible here means, we can affect the linker flags
> > > > > -from build environment
> > > > > -
> > > > > -Upstream-Status: Submitted [https://github.com/linaro-swg/optee_examples/pull/85]
> > > > > -
> > > > > -Signed-off-by: Khem Raj <raj.khem@gmail.com>
> > > > > ----
> > > > > - acipher/host/Makefile        | 2 +-
> > > > > - aes/host/Makefile            | 2 +-
> > > > > - hello_world/host/Makefile    | 2 +-
> > > > > - hotp/host/Makefile           | 2 +-
> > > > > - random/host/Makefile         | 2 +-
> > > > > - secure_storage/host/Makefile | 2 +-
> > > > > - 6 files changed, 6 insertions(+), 6 deletions(-)
> > > > > -
> > > > > -diff --git a/acipher/host/Makefile b/acipher/host/Makefile
> > > > > -index 8f4bc8a..c2cabef 100644
> > > > > ---- a/acipher/host/Makefile
> > > > > -+++ b/acipher/host/Makefile
> > > > > -@@ -18,7 +18,7 @@ BINARY = optee_example_acipher
> > > > > - all: $(BINARY)
> > > > > -
> > > > > - $(BINARY): $(OBJS)
> > > > > --      $(CC) -o $@ $< $(LDADD)
> > > > > -+      $(CC) -o $@ $< $(LDFLAGS) $(LDADD)
> > > > > -
> > > > > - .PHONY: clean
> > > > > - clean:
> > > > > -diff --git a/aes/host/Makefile b/aes/host/Makefile
> > > > > -index dfeb4e8..f61c71b 100644
> > > > > ---- a/aes/host/Makefile
> > > > > -+++ b/aes/host/Makefile
> > > > > -@@ -18,7 +18,7 @@ BINARY = optee_example_aes
> > > > > - all: $(BINARY)
> > > > > -
> > > > > - $(BINARY): $(OBJS)
> > > > > --      $(CC) -o $@ $< $(LDADD)
> > > > > -+      $(CC) -o $@ $< $(LDFLAGS) $(LDADD)
> > > > > -
> > > > > - .PHONY: clean
> > > > > - clean:
> > > > > -diff --git a/hello_world/host/Makefile b/hello_world/host/Makefile
> > > > > -index c4c8239..69cf42c 100644
> > > > > ---- a/hello_world/host/Makefile
> > > > > -+++ b/hello_world/host/Makefile
> > > > > -@@ -18,7 +18,7 @@ BINARY = optee_example_hello_world
> > > > > - all: $(BINARY)
> > > > > -
> > > > > - $(BINARY): $(OBJS)
> > > > > --      $(CC) -o $@ $< $(LDADD)
> > > > > -+      $(CC) -o $@ $< $(LDFLAGS) $(LDADD)
> > > > > -
> > > > > - .PHONY: clean
> > > > > - clean:
> > > > > -diff --git a/hotp/host/Makefile b/hotp/host/Makefile
> > > > > -index cb7fd19..e7f013f 100644
> > > > > ---- a/hotp/host/Makefile
> > > > > -+++ b/hotp/host/Makefile
> > > > > -@@ -18,7 +18,7 @@ BINARY = optee_example_hotp
> > > > > - all: $(BINARY)
> > > > > -
> > > > > - $(BINARY): $(OBJS)
> > > > > --      $(CC) -o $@ $< $(LDADD)
> > > > > -+      $(CC) -o $@ $< $(LDFLAGS) $(LDADD)
> > > > > -
> > > > > - .PHONY: clean
> > > > > - clean:
> > > > > -diff --git a/random/host/Makefile b/random/host/Makefile
> > > > > -index fd407d9..9377f7a 100644
> > > > > ---- a/random/host/Makefile
> > > > > -+++ b/random/host/Makefile
> > > > > -@@ -18,7 +18,7 @@ BINARY = optee_example_random
> > > > > - all: $(BINARY)
> > > > > -
> > > > > - $(BINARY): $(OBJS)
> > > > > --      $(CC) -o $@ $< $(LDADD)
> > > > > -+      $(CC) -o $@ $< $(LDFLAGS) $(LDADD)
> > > > > -
> > > > > - .PHONY: clean
> > > > > - clean:
> > > > > -diff --git a/secure_storage/host/Makefile b/secure_storage/host/Makefile
> > > > > -index 29bfb87..b3265ae 100644
> > > > > ---- a/secure_storage/host/Makefile
> > > > > -+++ b/secure_storage/host/Makefile
> > > > > -@@ -18,7 +18,7 @@ BINARY = optee_example_secure_storage
> > > > > - all: $(BINARY)
> > > > > -
> > > > > - $(BINARY): $(OBJS)
> > > > > --      $(CC) -o $@ $< $(LDADD)
> > > > > -+      $(CC) -o $@ $< $(LDFLAGS) $(LDADD)
> > > > > -
> > > > > - .PHONY: clean
> > > > > - clean:
> > > > > ---
> > > > > -2.28.0
> > > > > -
> > > > > diff --git a/meta-arm/recipes-security/optee/optee-examples/0001-plugins-Honour-default-cross-compiler-environment-se.patch b/meta-arm/recipes-security/optee/optee-examples/0001-plugins-Honour-default-cross-compiler-environment-se.patch
> > > > > new file mode 100644
> > > > > index 0000000..033e48c
> > > > > --- /dev/null
> > > > > +++ b/meta-arm/recipes-security/optee/optee-examples/0001-plugins-Honour-default-cross-compiler-environment-se.patch
> > > > > @@ -0,0 +1,84 @@
> > > > > +From 79c826c249001700007a6dffe80c3d61ff4428ef Mon Sep 17 00:00:00 2001
> > > > > +From: Sumit Garg <sumit.garg@linaro.org>
> > > > > +Date: Tue, 20 Jul 2021 13:54:30 +0530
> > > > > +Subject: [PATCH 1/2] plugins: Honour default cross compiler environment setup
> > > > > +
> > > > > +Honour default $(CC), $(CFLAGS) and $(LDFLAGS) variables. Without this
> > > > > +plugins example fails to build for OE/Yocto.
> > > > > +
> > > > > +Upstream-Status: Submitted [https://github.com/linaro-swg/optee_examples/pull/87]
> > > > > +
> > > > > +Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
> > > > > +---
> > > > > + plugins/Makefile        |  2 +-
> > > > > + plugins/host/Makefile   |  2 +-
> > > > > + plugins/syslog/Makefile | 16 ++++++++++++----
> > > > > + 3 files changed, 14 insertions(+), 6 deletions(-)
> > > > > +
> > > > > +diff --git a/plugins/Makefile b/plugins/Makefile
> > > > > +index 2372b38..ea472b4 100644
> > > > > +--- a/plugins/Makefile
> > > > > ++++ b/plugins/Makefile
> > > > > +@@ -8,7 +8,7 @@ TA_CROSS_COMPILE ?= $(CROSS_COMPILE)
> > > > > + all:
> > > > > +       $(MAKE) -C host CROSS_COMPILE="$(HOST_CROSS_COMPILE)" --no-builtin-variables
> > > > > +       $(MAKE) -C ta CROSS_COMPILE="$(TA_CROSS_COMPILE)" LDFLAGS=""
> > > > > +-      $(MAKE) -C syslog CROSS_COMPILE="$(HOST_CROSS_COMPILE)"
> > > > > ++      $(MAKE) -C syslog CROSS_COMPILE="$(HOST_CROSS_COMPILE)" --no-builtin-variables
> > > > > +
> > > > > + .PHONY: clean
> > > > > + clean:
> > > > > +diff --git a/plugins/host/Makefile b/plugins/host/Makefile
> > > > > +index 7285104..76244c7 100644
> > > > > +--- a/plugins/host/Makefile
> > > > > ++++ b/plugins/host/Makefile
> > > > > +@@ -20,7 +20,7 @@ BINARY = optee_example_plugins
> > > > > + all: $(BINARY)
> > > > > +
> > > > > + $(BINARY): $(OBJS)
> > > > > +-      $(CC) -o $@ $< $(LDADD)
> > > > > ++      $(CC) $(LDFLAGS) -o $@ $< $(LDADD)
> > > > > +
> > > > > + .PHONY: clean
> > > > > + clean:
> > > > > +diff --git a/plugins/syslog/Makefile b/plugins/syslog/Makefile
> > > > > +index 62d916a..71f5f92 100644
> > > > > +--- a/plugins/syslog/Makefile
> > > > > ++++ b/plugins/syslog/Makefile
> > > > > +@@ -1,3 +1,11 @@
> > > > > ++CC      ?= $(CROSS_COMPILE)gcc
> > > > > ++LD      ?= $(CROSS_COMPILE)ld
> > > > > ++AR      ?= $(CROSS_COMPILE)ar
> > > > > ++NM      ?= $(CROSS_COMPILE)nm
> > > > > ++OBJCOPY ?= $(CROSS_COMPILE)objcopy
> > > > > ++OBJDUMP ?= $(CROSS_COMPILE)objdump
> > > > > ++READELF ?= $(CROSS_COMPILE)readelf
> > > > > ++
> > > > > + PLUGIN_UUID = 96bcf744-4f72-4866-bf1d-8634fd9c65e5
> > > > > +
> > > > > + PLUGIN                        = $(PLUGIN_UUID).plugin
> > > > > +@@ -6,17 +14,17 @@ PLUGIN_OBJ          = $(patsubst %.c, %.o, $(PLUGIN_SRS))
> > > > > + PLUGIN_INCLUDES_DIR   = $(CURDIR) $(TEEC_EXPORT)/include
> > > > > +
> > > > > + PLUGIN_INCLUDES               = $(addprefix -I, $(PLUGIN_INCLUDES_DIR))
> > > > > +-PLUGIN_CCFLAGS                = -Wall -fPIC
> > > > > +-PLUGIN_LDFLAGS                = -shared
> > > > > ++PLUGIN_CCFLAGS                = $(CFLAGS) -Wall -fPIC
> > > > > ++PLUGIN_LDFLAGS                = $(LDFLAGS) -shared
> > > > > +
> > > > > + .PHONY: all
> > > > > + all: $(PLUGIN)
> > > > > +
> > > > > + $(PLUGIN): $(PLUGIN_OBJ)
> > > > > +-      $(CROSS_COMPILE)gcc $(PLUGIN_LDFLAGS) $(PLUGIN_OBJ) -o $@
> > > > > ++      $(CC) $(PLUGIN_LDFLAGS) $(PLUGIN_OBJ) -o $@
> > > > > +
> > > > > + %.o: %.c
> > > > > +-      $(CROSS_COMPILE)gcc $(PLUGIN_CCFLAGS) $(PLUGIN_INCLUDES) -c $*.c -o $*.o
> > > > > ++      $(CC) $(PLUGIN_CCFLAGS) $(PLUGIN_INCLUDES) -c $*.c -o $*.o
> > > > > +
> > > > > + .PHONY: clean
> > > > > + clean:
> > > > > +--
> > > > > +2.25.1
> > > > > +
> > > > > diff --git a/meta-arm/recipes-security/optee/optee-examples/0002-Makefile-Enable-plugins-installation-in-rootfs.patch b/meta-arm/recipes-security/optee/optee-examples/0002-Makefile-Enable-plugins-installation-in-rootfs.patch
> > > > > new file mode 100644
> > > > > index 0000000..8d1d60a
> > > > > --- /dev/null
> > > > > +++ b/meta-arm/recipes-security/optee/optee-examples/0002-Makefile-Enable-plugins-installation-in-rootfs.patch
> > > > > @@ -0,0 +1,39 @@
> > > > > +From a865f2e25e178fc2c4617eb1faf79ac922d02ffd Mon Sep 17 00:00:00 2001
> > > > > +From: Sumit Garg <sumit.garg@linaro.org>
> > > > > +Date: Tue, 20 Jul 2021 14:20:10 +0530
> > > > > +Subject: [PATCH 2/2] Makefile: Enable plugins installation in rootfs
> > > > > +
> > > > > +Upstream-Status: Submitted [https://github.com/linaro-swg/optee_examples/pull/87]
> > > > > +
> > > > > +Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
> > > > > +---
> > > > > + Makefile | 5 +++++
> > > > > + 1 file changed, 5 insertions(+)
> > > > > +
> > > > > +diff --git a/Makefile b/Makefile
> > > > > +index a275842..b3f16aa 100644
> > > > > +--- a/Makefile
> > > > > ++++ b/Makefile
> > > > > +@@ -25,14 +25,19 @@ prepare-for-rootfs: examples
> > > > > +       @mkdir -p $(OUTPUT_DIR)
> > > > > +       @mkdir -p $(OUTPUT_DIR)/ta
> > > > > +       @mkdir -p $(OUTPUT_DIR)/ca
> > > > > ++      @mkdir -p $(OUTPUT_DIR)/plugins
> > > > > +       @for example in $(EXAMPLE_LIST); do \
> > > > > +               if [ -e $$example/host/optee_example_$$example ]; then \
> > > > > +                       cp -p $$example/host/optee_example_$$example $(OUTPUT_DIR)/ca/; \
> > > > > +               fi; \
> > > > > +               cp -pr $$example/ta/*.ta $(OUTPUT_DIR)/ta/; \
> > > > > ++              if [ $$example == plugins ]; then \
> > > > > ++                      cp -p plugins/syslog/*.plugin $(OUTPUT_DIR)/plugins/; \
> > > > > ++              fi; \
> > > > > +       done
> > > > > +
> > > > > + prepare-for-rootfs-clean:
> > > > > +       @rm -rf $(OUTPUT_DIR)/ta
> > > > > +       @rm -rf $(OUTPUT_DIR)/ca
> > > > > ++      @rm -rf $(OUTPUT_DIR)/plugins
> > > > > +       @rmdir --ignore-fail-on-non-empty $(OUTPUT_DIR) || test ! -e $(OUTPUT_DIR)
> > > > > +--
> > > > > +2.25.1
> > > > > +
> > > > > diff --git a/meta-arm/recipes-security/optee/optee-examples_3.11.0.bb b/meta-arm/recipes-security/optee/optee-examples_3.11.0.bb
> > > > > deleted file mode 100644
> > > > > index 72473ed..0000000
> > > > > --- a/meta-arm/recipes-security/optee/optee-examples_3.11.0.bb
> > > > > +++ /dev/null
> > > > > @@ -1,4 +0,0 @@
> > > > > -require optee-examples.inc
> > > > > -
> > > > > -SRCREV = "9a7dc598591990349d88b4dba3a37aadd6851295"
> > > > > -
> > > > > diff --git a/meta-arm/recipes-security/optee/optee-examples_3.14.0.bb b/meta-arm/recipes-security/optee/optee-examples_3.14.0.bb
> > > > > new file mode 100644
> > > > > index 0000000..f2b5f7d
> > > > > --- /dev/null
> > > > > +++ b/meta-arm/recipes-security/optee/optee-examples_3.14.0.bb
> > > > > @@ -0,0 +1,4 @@
> > > > > +require optee-examples.inc
> > > > > +
> > > > > +SRCREV = "e9c870525af8f7e7fccf575a0ca5394ce55adcec"
> > > > > +
> > > > > diff --git a/meta-arm/recipes-security/optee/optee-os/0001-libutils-provide-empty-__getauxval-implementation.patch b/meta-arm/recipes-security/optee/optee-os/0001-libutils-provide-empty-__getauxval-implementation.patch
> > > > > deleted file mode 100644
> > > > > index 0120f5c..0000000
> > > > > --- a/meta-arm/recipes-security/optee/optee-os/0001-libutils-provide-empty-__getauxval-implementation.patch
> > > > > +++ /dev/null
> > > > > @@ -1,62 +0,0 @@
> > > > > -Upstream-Status: Backport
> > > > > -Signed-off-by: Ross Burton <ross.burton@arm.com>
> > > > > -
> > > > > -From 36e784f621bf5d5be9183beba35f39426277c110 Mon Sep 17 00:00:00 2001
> > > > > -From: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
> > > > > -Date: Tue, 13 Oct 2020 22:45:39 +0300
> > > > > -Subject: [PATCH 1/3] libutils: provide empty __getauxval() implementation
> > > > > -
> > > > > -Never version of libgcc are built with LSE implementation in mind. To
> > > > > -determine if LSE is available on platform it calls __getauxval(), so in
> > > > > -some cases we can get undefined reference to __getauxval() error.
> > > > > -
> > > > > -Prominent case is libgcc_eh.a library, which is used by C++ TAs. Exception
> > > > > -handler depends on atomic operations, so it tries to call
> > > > > -init_have_lse_atomics() first. This function in turn calls __getauxval(),
> > > > > -which causes linking error.
> > > > > -
> > > > > -In the future we can make __getauxval() to return actual platform
> > > > > -capabilities.
> > > > > -
> > > > > -Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
> > > > > -Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
> > > > > -Reviewed-by: Jerome Forissier <jerome@forissier.org>
> > > > > ----
> > > > > - lib/libutils/ext/arch/arm/auxval.c | 12 ++++++++++++
> > > > > - lib/libutils/ext/arch/arm/sub.mk   |  1 +
> > > > > - 2 files changed, 13 insertions(+)
> > > > > - create mode 100644 lib/libutils/ext/arch/arm/auxval.c
> > > > > -
> > > > > -diff --git a/lib/libutils/ext/arch/arm/auxval.c b/lib/libutils/ext/arch/arm/auxval.c
> > > > > -new file mode 100644
> > > > > -index 00000000..98bca850
> > > > > ---- /dev/null
> > > > > -+++ b/lib/libutils/ext/arch/arm/auxval.c
> > > > > -@@ -0,0 +1,12 @@
> > > > > -+// SPDX-License-Identifier: BSD-2-Clause
> > > > > -+/*
> > > > > -+ * Copyright (c) 2020, EPAM Systems
> > > > > -+ */
> > > > > -+
> > > > > -+#include <compiler.h>
> > > > > -+
> > > > > -+unsigned long int __getauxval (unsigned long int type);
> > > > > -+unsigned long int __getauxval (unsigned long int type __unused)
> > > > > -+{
> > > > > -+      return 0;
> > > > > -+}
> > > > > -diff --git a/lib/libutils/ext/arch/arm/sub.mk b/lib/libutils/ext/arch/arm/sub.mk
> > > > > -index dc5eed67..2e779066 100644
> > > > > ---- a/lib/libutils/ext/arch/arm/sub.mk
> > > > > -+++ b/lib/libutils/ext/arch/arm/sub.mk
> > > > > -@@ -3,6 +3,7 @@ srcs-$(CFG_ARM32_$(sm)) += aeabi_unwind.c
> > > > > - endif
> > > > > - srcs-$(CFG_ARM32_$(sm)) += atomic_a32.S
> > > > > - srcs-$(CFG_ARM64_$(sm)) += atomic_a64.S
> > > > > -+srcs-y += auxval.c
> > > > > - ifneq ($(sm),ldelf) # TA, core
> > > > > - srcs-$(CFG_ARM32_$(sm)) += mcount_a32.S
> > > > > - srcs-$(CFG_ARM64_$(sm)) += mcount_a64.S
> > > > > ---
> > > > > -2.25.1
> > > > > -
> > > > > diff --git a/meta-arm/recipes-security/optee/optee-os/0002-link.mk-implement-support-for-libnames-after-libgcc-.patch b/meta-arm/recipes-security/optee/optee-os/0002-link.mk-implement-support-for-libnames-after-libgcc-.patch
> > > > > deleted file mode 100644
> > > > > index 11296c8..0000000
> > > > > --- a/meta-arm/recipes-security/optee/optee-os/0002-link.mk-implement-support-for-libnames-after-libgcc-.patch
> > > > > +++ /dev/null
> > > > > @@ -1,55 +0,0 @@
> > > > > -Upstream-Status: Backport
> > > > > -Signed-off-by: Ross Burton <ross.burton@arm.com>
> > > > > -
> > > > > -From 73196b58ea6978ffa5e581738030f51c5789ef73 Mon Sep 17 00:00:00 2001
> > > > > -From: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
> > > > > -Date: Tue, 13 Oct 2020 22:54:13 +0300
> > > > > -Subject: [PATCH 2/3] link.mk: implement support for libnames-after-libgcc
> > > > > - variable
> > > > > -
> > > > > -Newer versions of libgcc depend on external __getauxval() symbol, which is
> > > > > -now provided by libutils. But libgcc is linked after libutils, so linker
> > > > > -can't resolve that symbol. We can't include libgcc into linking group with
> > > > > -libtutils, because libgcc provides symbols that conflict with libutil's
> > > > > -ones, like __aeabi_idiv with friends for instance.
> > > > > -
> > > > > -So, to resolve libgcc dependency on libutils we need to link with libutils
> > > > > -second time. To make things more generic, we will introduce
> > > > > -$(libnames-after-libgcc) variable for libraries that should be linked after
> > > > > -libgcc.
> > > > > -
> > > > > -Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
> > > > > -Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
> > > > > -Reviewed-by: Jerome Forissier <jerome@forissier.org>
> > > > > ----
> > > > > - ta/arch/arm/link.mk | 6 +++++-
> > > > > - 1 file changed, 5 insertions(+), 1 deletion(-)
> > > > > -
> > > > > -diff --git a/ta/arch/arm/link.mk b/ta/arch/arm/link.mk
> > > > > -index 445c285d..3025acb1 100644
> > > > > ---- a/ta/arch/arm/link.mk
> > > > > -+++ b/ta/arch/arm/link.mk
> > > > > -@@ -55,8 +55,11 @@ link-ldflags += --eh-frame-hdr
> > > > > - link-ldadd += $(libstdc++$(sm)) $(libgcc_eh$(sm))
> > > > > - endif
> > > > > - link-ldadd += --end-group
> > > > > --ldargs-$(user-ta-uuid).elf := $(link-ldflags) $(objs) $(link-ldadd) $(libgcc$(sm))
> > > > > -
> > > > > -+link-ldadd-after-libgcc += $(addprefix -l,$(libnames-after-libgcc))
> > > > > -+
> > > > > -+ldargs-$(user-ta-uuid).elf := $(link-ldflags) $(objs) $(link-ldadd) \
> > > > > -+                              $(libgcc$(sm)) $(link-ldadd-after-libgcc)
> > > > > -
> > > > > - link-script-cppflags-$(sm) := \
> > > > > -       $(filter-out $(CPPFLAGS_REMOVE) $(cppflags-remove), \
> > > > > -@@ -76,6 +79,7 @@ $(link-script-pp$(sm)): $(link-script$(sm)) $(conf-file) $(link-script-pp-makefi
> > > > > -               $(link-script-cppflags-$(sm)) $$< -o $$@
> > > > > -
> > > > > - $(link-out-dir$(sm))/$(user-ta-uuid).elf: $(objs) $(libdeps) \
> > > > > -+                                        $(libdeps-after-libgcc) \
> > > > > -                                         $(link-script-pp$(sm)) \
> > > > > -                                         $(dynlistdep) \
> > > > > -                                         $(additional-link-deps)
> > > > > ---
> > > > > -2.25.1
> > > > > -
> > > > > diff --git a/meta-arm/recipes-security/optee/optee-os/0003-ta_dev_kit.mk-make-sure-that-libutils-is-linked-seco.patch b/meta-arm/recipes-security/optee/optee-os/0003-ta_dev_kit.mk-make-sure-that-libutils-is-linked-seco.patch
> > > > > deleted file mode 100644
> > > > > index 88ba5f8..0000000
> > > > > --- a/meta-arm/recipes-security/optee/optee-os/0003-ta_dev_kit.mk-make-sure-that-libutils-is-linked-seco.patch
> > > > > +++ /dev/null
> > > > > @@ -1,44 +0,0 @@
> > > > > -Upstream-Status: Backport
> > > > > -Signed-off-by: Ross Burton <ross.burton@arm.com>
> > > > > -
> > > > > -From f50962e3f56f0932662b2ffa10afe53339a335dd Mon Sep 17 00:00:00 2001
> > > > > -From: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
> > > > > -Date: Fri, 16 Oct 2020 16:36:08 +0300
> > > > > -Subject: [PATCH 3/3] ta_dev_kit.mk: make sure that libutils is linked second
> > > > > - time
> > > > > -
> > > > > -libgcc depends on __getauxval symbol from libuils. As, generally libutils
> > > > > -is linked before libgcc, we will get "unresolved symbol" error. To resolve
> > > > > -this dependency we need to link libutils second time - after libgcc.
> > > > > -
> > > > > -Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
> > > > > -Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
> > > > > -Reviewed-by: Jerome Forissier <jerome@forissier.org>
> > > > > ----
> > > > > - ta/mk/ta_dev_kit.mk | 10 ++++++++++
> > > > > - 1 file changed, 10 insertions(+)
> > > > > -
> > > > > -diff --git a/ta/mk/ta_dev_kit.mk b/ta/mk/ta_dev_kit.mk
> > > > > -index e28be677..d0e66317 100644
> > > > > ---- a/ta/mk/ta_dev_kit.mk
> > > > > -+++ b/ta/mk/ta_dev_kit.mk
> > > > > -@@ -78,6 +78,16 @@ endif
> > > > > - libnames += dl
> > > > > - libdeps += $(ta-dev-kit-dir$(sm))/lib/libdl.a
> > > > > -
> > > > > -+# libutils provides __getauxval symbol which is needed by libgcc 10.x. We can't
> > > > > -+# link libutils after libgcc, because libgcc will replace some symbols provided
> > > > > -+# by libutils, which will cause further linking issues.
> > > > > -+#
> > > > > -+# But if we place libutils before libgcc, linker will not be able to resolve
> > > > > -+# __getauxval. So we need to link with libutils twice: before and after libgcc.
> > > > > -+# Hence it included both in $(libnames) and in $(libnames-after-libgcc)
> > > > > -+libnames-after-libgcc += utils
> > > > > -+libdeps-after-libgcc += $(ta-dev-kit-dir$(sm))/lib/libutils.a
> > > > > -+
> > > > > - # Pass config variable (CFG_) from conf.mk on the command line
> > > > > - cppflags$(sm) += $(strip \
> > > > > -       $(foreach var, $(filter CFG_%,$(.VARIABLES)), \
> > > > > ---
> > > > > -2.25.1
> > > > > -
> > > > > diff --git a/meta-arm/recipes-security/optee/optee-os_3.11.0.bb b/meta-arm/recipes-security/optee/optee-os_3.11.0.bb
> > > > > deleted file mode 100644
> > > > > index 13b3dc6..0000000
> > > > > --- a/meta-arm/recipes-security/optee/optee-os_3.11.0.bb
> > > > > +++ /dev/null
> > > > > @@ -1,11 +0,0 @@
> > > > > -require optee-os.inc
> > > > > -
> > > > > -SRCREV = "c4def2a8262a03244d9a88461699b9b8e43c6b55"
> > > > > -
> > > > > -SRC_URI_append = " \
> > > > > -    file://0006-allow-setting-sysroot-for-libgcc-lookup.patch \
> > > > > -    file://0007-allow-setting-sysroot-for-clang.patch \
> > > > > -    file://0001-libutils-provide-empty-__getauxval-implementation.patch \
> > > > > -    file://0002-link.mk-implement-support-for-libnames-after-libgcc-.patch \
> > > > > -    file://0003-ta_dev_kit.mk-make-sure-that-libutils-is-linked-seco.patch \
> > > > > -"
> > > > > diff --git a/meta-arm/recipes-security/optee/optee-os_3.14.0.bb b/meta-arm/recipes-security/optee/optee-os_3.14.0.bb
> > > > > new file mode 100644
> > > > > index 0000000..3289e2c
> > > > > --- /dev/null
> > > > > +++ b/meta-arm/recipes-security/optee/optee-os_3.14.0.bb
> > > > > @@ -0,0 +1,8 @@
> > > > > +require optee-os.inc
> > > > > +
> > > > > +SRCREV = "d21befa5e53eae9db469eba1685f5aa5c6f92c2f"
> > > > > +
> > > > > +SRC_URI_append = " \
> > > > > +    file://0006-allow-setting-sysroot-for-libgcc-lookup.patch \
> > > > > +    file://0007-allow-setting-sysroot-for-clang.patch \
> > > > > +"
> > > > > diff --git a/meta-arm/recipes-security/optee/optee-test.inc b/meta-arm/recipes-security/optee/optee-test.inc
> > > > > index f09b9d2..bcbcc06 100644
> > > > > --- a/meta-arm/recipes-security/optee/optee-test.inc
> > > > > +++ b/meta-arm/recipes-security/optee/optee-test.inc
> > > > > @@ -8,17 +8,9 @@ LIC_FILES_CHKSUM = "file://${S}/LICENSE.md;md5=daa2bcccc666345ab8940aab1315a4fa"
> > > > >  inherit python3native ptest
> > > > >  require optee.inc
> > > > >
> > > > > -# Linking fails on musl due to C++/threads
> > > > > -# https://github.com/OP-TEE/optee_test/issues/458#issuecomment-720540834
> > > > > -# When upgraded we should be able to remove this limitation
> > > > > -COMPATIBLE_HOST_libc-musl = 'null'
> > > > > -
> > > > >  DEPENDS = "optee-client optee-os python3-pycryptodome-native"
> > > > >
> > > > >  SRC_URI = "git://github.com/OP-TEE/optee_test.git \
> > > > > -           file://0001-host-xtest-Adjust-order-of-including-compiler.h.patch \
> > > > > -           file://0002-make-remove-Wno-unsafe-loop-for-clang.patch \
> > > > > -           file://0003-make-remove-Wmissing-noreturn-for-clang.patch \
> > > > >             file://run-ptest \
> > > > >            "
> > > > >
> > > > > @@ -36,6 +28,7 @@ do_compile() {
> > > > >      # Top level makefile doesn't seem to handle parallel make gracefully
> > > > >      oe_runmake xtest
> > > > >      oe_runmake ta
> > > > > +    oe_runmake test_plugin
> > > > >  }
> > > > >  do_compile[cleandirs] = "${B}"
> > > > >
> > > > > @@ -46,9 +39,13 @@ do_install () {
> > > > >      # default TEEC_LOAD_PATH is /lib
> > > > >      mkdir -p ${D}${nonarch_base_libdir}/optee_armtz/
> > > > >      install -D -p -m0444 ${B}/ta/*/*.ta ${D}${nonarch_base_libdir}/optee_armtz/
> > > > > +    mkdir -p ${D}${libdir}/tee-supplicant/plugins
> > > > > +    install -D -p -m0444 ${B}/supp_plugin/*.plugin ${D}${libdir}/tee-supplicant/plugins/
> > > > >  }
> > > > >
> > > > > -FILES_${PN} += "${nonarch_base_libdir}/optee_armtz/"
> > > > > +FILES_${PN} += "${nonarch_base_libdir}/optee_armtz/ \
> > > > > +                ${libdir}/tee-supplicant/plugins/ \
> > > > > +               "
> > > > >
> > > > >  # Imports machine specific configs from staging to build
> > > > >  PACKAGE_ARCH = "${MACHINE_ARCH}"
> > > > > diff --git a/meta-arm/recipes-security/optee/optee-test/0001-host-xtest-Adjust-order-of-including-compiler.h.patch b/meta-arm/recipes-security/optee/optee-test/0001-host-xtest-Adjust-order-of-including-compiler.h.patch
> > > > > deleted file mode 100644
> > > > > index 3c500d7..0000000
> > > > > --- a/meta-arm/recipes-security/optee/optee-test/0001-host-xtest-Adjust-order-of-including-compiler.h.patch
> > > > > +++ /dev/null
> > > > > @@ -1,64 +0,0 @@
> > > > > -From fc95b3ccbbfd336797ae2cfd6dd4dc58644e146f Mon Sep 17 00:00:00 2001
> > > > > -From: Khem Raj <raj.khem@gmail.com>
> > > > > -Date: Sat, 30 May 2020 17:52:18 -0700
> > > > > -Subject: [PATCH] host/xtest: Adjust order of including compiler.h
> > > > > -
> > > > > -compiler.h defines some defines which violate libc namespace e.g.
> > > > > -__unused, this works ok with glibc but fails in awkward ways with musl
> > > > > -the reason is musl uses __unused in its internal structures and this
> > > > > -define in compiler.h conflicts with system headers causing errors like
> > > > > -
> > > > > -recipe-sysroot/usr/include/bits/stat.h:17:19: error: expected identifier or '(' before '[' token unsigned __unused[2];
> > > > > -                   ^
> > > > > -including compiler.h afer sys/stat.h fixes the problem.
> > > > > -
> > > > > -Upstream-Status: Pending [https://github.com/OP-TEE/optee_test/issues/453]
> > > > > -Signed-off-by: Khem Raj <raj.khem@gmail.com>
> > > > > ----
> > > > > - host/xtest/install_ta.c | 2 +-
> > > > > - host/xtest/stats.c      | 2 +-
> > > > > - 2 files changed, 2 insertions(+), 2 deletions(-)
> > > > > -
> > > > > -diff --git a/host/xtest/install_ta.c b/host/xtest/install_ta.c
> > > > > -index 09a4c6d..6f7bb5c 100644
> > > > > ---- a/host/xtest/install_ta.c
> > > > > -+++ b/host/xtest/install_ta.c
> > > > > -@@ -4,7 +4,6 @@
> > > > > -  * SPDX-License-Identifier: BSD-2-Clause
> > > > > -  */
> > > > > -
> > > > > --#include <compiler.h>
> > > > > - #include <dirent.h>
> > > > > - #include <err.h>
> > > > > - #include <errno.h>
> > > > > -@@ -20,6 +19,7 @@
> > > > > - #include <sys/types.h>
> > > > > - #include <tee_client_api.h>
> > > > > - #include <unistd.h>
> > > > > -+#include <compiler.h>
> > > > > -
> > > > > - #include "install_ta.h"
> > > > > - #include "xtest_helpers.h"
> > > > > -diff --git a/host/xtest/stats.c b/host/xtest/stats.c
> > > > > -index 96b0b5f..db9bf25 100644
> > > > > ---- a/host/xtest/stats.c
> > > > > -+++ b/host/xtest/stats.c
> > > > > -@@ -3,7 +3,6 @@
> > > > > -  * Copyright (c) 2019, Linaro Limited
> > > > > -  */
> > > > > -
> > > > > --#include <compiler.h>
> > > > > - #include <dirent.h>
> > > > > - #include <err.h>
> > > > > - #include <errno.h>
> > > > > -@@ -18,6 +17,7 @@
> > > > > - #include <sys/types.h>
> > > > > - #include <tee_client_api.h>
> > > > > - #include <unistd.h>
> > > > > -+#include <compiler.h>
> > > > > - #include "xtest_test.h"
> > > > > - #include "stats.h"
> > > > > -
> > > > > ---
> > > > > -2.26.2
> > > > > -
> > > > > diff --git a/meta-arm/recipes-security/optee/optee-test/0002-make-remove-Wno-unsafe-loop-for-clang.patch b/meta-arm/recipes-security/optee/optee-test/0002-make-remove-Wno-unsafe-loop-for-clang.patch
> > > > > deleted file mode 100644
> > > > > index 17dd7d8..0000000
> > > > > --- a/meta-arm/recipes-security/optee/optee-test/0002-make-remove-Wno-unsafe-loop-for-clang.patch
> > > > > +++ /dev/null
> > > > > @@ -1,31 +0,0 @@
> > > > > -From 438533ce9da1df0b7c7914e64b39ffdc1da1ab79 Mon Sep 17 00:00:00 2001
> > > > > -From: Brett Warren <brett.warran@arm.com>
> > > > > -Date: Thu, 8 Oct 2020 10:03:25 +0100
> > > > > -Subject: [PATCH] make: remove -Wmissing-noreturn for clang
> > > > > -
> > > > > -When compiling when clang, -Wmissing-noreturn causes an error because
> > > > > -of non-compliant code. This option is removed to workaround this.
> > > > > -
> > > > > -Upstream-Status: Pending [https://github.com/OP-TEE/optee_test/issues/452]
> > > > > -Changed-Id: 71cb511904547d790d1ea98f93bf8e5a6afcb36d
> > > > > -Signed-off-by: Brett Warren <brett.warren@arm.com>
> > > > > ----
> > > > > - host/xtest/Makefile | 2 +-
> > > > > - 1 file changed, 1 insertion(+), 1 deletion(-)
> > > > > -
> > > > > -diff --git a/host/xtest/Makefile b/host/xtest/Makefile
> > > > > -index 3c206b0..96746de 100644
> > > > > ---- a/host/xtest/Makefile
> > > > > -+++ b/host/xtest/Makefile
> > > > > -@@ -169,7 +169,7 @@ CFLAGS += -Wall -Wcast-align -Werror \
> > > > > -         -Werror-implicit-function-declaration -Wextra -Wfloat-equal \
> > > > > -         -Wformat-nonliteral -Wformat-security -Wformat=2 -Winit-self \
> > > > > -         -Wmissing-declarations -Wmissing-format-attribute \
> > > > > --        -Wmissing-include-dirs -Wmissing-noreturn \
> > > > > -+        -Wmissing-include-dirs \
> > > > > -         -Wmissing-prototypes -Wnested-externs -Wpointer-arith \
> > > > > -         -Wshadow -Wstrict-prototypes -Wswitch-default \
> > > > > -         -Wwrite-strings \
> > > > > ---
> > > > > -2.17.1
> > > > > -
> > > > > diff --git a/meta-arm/recipes-security/optee/optee-test/0003-make-remove-Wmissing-noreturn-for-clang.patch b/meta-arm/recipes-security/optee/optee-test/0003-make-remove-Wmissing-noreturn-for-clang.patch
> > > > > deleted file mode 100644
> > > > > index bbc303f..0000000
> > > > > --- a/meta-arm/recipes-security/optee/optee-test/0003-make-remove-Wmissing-noreturn-for-clang.patch
> > > > > +++ /dev/null
> > > > > @@ -1,31 +0,0 @@
> > > > > -From ed5a9d9f7a3e9e14ca0e8aea59008124ee0e5f96 Mon Sep 17 00:00:00 2001
> > > > > -From: Brett Warren <brett.warren@arm.com>
> > > > > -Date: Thu, 8 Oct 2020 10:20:52 +0100
> > > > > -Subject: [PATCH] make: remove -Wno-unsafe-loop for clang
> > > > > -
> > > > > -When compiling with clang, the -Wno-unsafe-loop-optimizations option
> > > > > -throws an error because clang doesn't recognise it. This option is
> > > > > -removed to workaround this.
> > > > > -
> > > > > -Upstream-Status: Pending [https://github.com/OP-TEE/optee_test/issues/452]
> > > > > -Change-Id: 5fe0892c73208aaffac8c9995cb3275936fb1ba6
> > > > > -Signed-off-by: Brett Warren <brett.warren@arm.com>
> > > > > ----
> > > > > - host/xtest/Makefile | 1 -
> > > > > - 1 file changed, 1 deletion(-)
> > > > > -
> > > > > -diff --git a/host/xtest/Makefile b/host/xtest/Makefile
> > > > > -index 96746de..73731d0 100644
> > > > > ---- a/host/xtest/Makefile
> > > > > -+++ b/host/xtest/Makefile
> > > > > -@@ -174,7 +174,6 @@ CFLAGS += -Wall -Wcast-align -Werror \
> > > > > -         -Wshadow -Wstrict-prototypes -Wswitch-default \
> > > > > -         -Wwrite-strings \
> > > > > -         -Wno-declaration-after-statement \
> > > > > --        -Wno-unsafe-loop-optimizations \
> > > > > -         -Wno-missing-field-initializers -Wno-format-zero-length
> > > > > - endif
> > > > > -
> > > > > ---
> > > > > -2.17.1
> > > > > -
> > > > > diff --git a/meta-arm/recipes-security/optee/optee-test_3.11.0.bb b/meta-arm/recipes-security/optee/optee-test_3.11.0.bb
> > > > > deleted file mode 100644
> > > > > index 0f8b5b0..0000000
> > > > > --- a/meta-arm/recipes-security/optee/optee-test_3.11.0.bb
> > > > > +++ /dev/null
> > > > > @@ -1,3 +0,0 @@
> > > > > -require optee-test.inc
> > > > > -
> > > > > -SRCREV = "159e295d5cc3ad2275ab15fe544620f6604d4ba4"
> > > > > diff --git a/meta-arm/recipes-security/optee/optee-test_3.14.0.bb b/meta-arm/recipes-security/optee/optee-test_3.14.0.bb
> > > > > new file mode 100644
> > > > > index 0000000..6367c27
> > > > > --- /dev/null
> > > > > +++ b/meta-arm/recipes-security/optee/optee-test_3.14.0.bb
> > > > > @@ -0,0 +1,3 @@
> > > > > +require optee-test.inc
> > > > > +
> > > > > +SRCREV = "f2eb88affbb7f028561b4fd5cbd049d5d704f741"
> > > > > --
> > > > > 2.25.1
> > > > >
> > > > >
> > > > >
> > > > >
> > >
> > > 
> > >

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [meta-arm] [PATCH] arm/optee: version uplift 3.11.0 -> 3.14.0
  2021-07-27 12:18         ` Ross Burton
@ 2021-07-27 12:22           ` Ross Burton
  2021-07-27 12:37             ` Sumit Garg
  0 siblings, 1 reply; 11+ messages in thread
From: Ross Burton @ 2021-07-27 12:22 UTC (permalink / raw)
  To: Sumit Garg; +Cc: Jon Mason, meta-arm, Jon Mason, Ross Burton

Yes, that was it.  == is a bashism, this line should use = instead:

https://github.com/linaro-swg/optee_examples/blob/master/Makefile#L34

And a makefile that doesn't eat errors would be helpful too.

Ross

On Tue, 27 Jul 2021 at 13:18, Ross Burton <ross@burtonini.com> wrote:
>
> Ah, this might be the problem from log.do_compile:
>
> Copying example CA and TA binaries to
> /yocto/ross/build/tmp/work/qemuarm64_secureboot-poky-linux/optee-examples/3.14.0-r0/build...
> /bin/sh: 6: [: acipher: unexpected operator
> /bin/sh: 6: [: plugins: unexpected operator
> /bin/sh: 6: [: hello_world: unexpected operator
> /bin/sh: 6: [: hotp: unexpected operator
> /bin/sh: 6: [: aes: unexpected operator
> /bin/sh: 6: [: random: unexpected operator
> /bin/sh: 6: [: secure_storage: unexpected operator
>
> Ross
>
> On Tue, 27 Jul 2021 at 07:52, Sumit Garg <sumit.garg@linaro.org> wrote:
> >
> > Hi Jon,
> >
> > On Mon, 26 Jul 2021 at 19:31, Jon Mason <jdmason@kudzu.us> wrote:
> > >
> > > On Mon, Jul 26, 2021 at 3:10 AM Sumit Garg <sumit.garg@linaro.org> wrote:
> > > >
> > > > Hi Ross,
> > > >
> > > > On Sat, 24 Jul 2021 at 00:36, Ross Burton <ross@burtonini.com> wrote:
> > > > >
> > > > > The optee-examples recipe is broken:
> > > > >
> > > > > install: cannot stat
> > > > > '/builds/engineering/yocto/meta-arm/work/build/tmp/work/qemuarm64_secureboot-poky-linux/optee-examples/3.14.0-r0/build/plugins/*':
> > > > > No such file or directory
> > > > >
> > > > > (qemuarm64-secureboot can build it)
> > > > >
> > > >
> > > > Strangely, it works fine for me when building for
> > > > qemuarm64-secureboot. Can you check if the following patches have been
> > > > correctly applied in the corresponding work directory?
> > > >
> > > >            file://0001-plugins-Honour-default-cross-compiler-environment-se.patch
> > > > \
> > > >            file://0002-Makefile-Enable-plugins-installation-in-rootfs.patch \
> > >
> > > I'm seeing the same issue Ross is describing.  I would expect a
> > > warning or error if it couldn't find the patches while building, not
> > > when installing.
> >
> > Yeah you are correct but I am not able to figure the reason for this behaviour.
> >
> > > Can you confirm you are building optee-examples, in
> > > addition to core-image-minimal/base?
> > > See https://gitlab.com/jonmason00/meta-arm/-/jobs/1444856281#L3594
> > >
> >
> > Yeah I am building optee-examples in addition to core-image-minimal/base.
> >
> > - Changes to default poky conf/local.conf:
> >
> > MACHINE = "qemuarm64-secureboot"
> > CORE_IMAGE_EXTRA_INSTALL += "optee-examples optee-test"
> >
> > - Changes to default poky conf/bblayers.conf with additional layers as:
> >
> > meta-arm/meta-arm-toolchain
> > meta-arm/meta-arm
> >
> > Here is optee-examples build folder directory structure for me:
> >
> > $ tree tmp/work/qemuarm64_secureboot-poky-linux/optee-examples/3.14.0-r0/build/
> > tmp/work/qemuarm64_secureboot-poky-linux/optee-examples/3.14.0-r0/build/
> > ├── ca
> > │   ├── optee_example_acipher
> > │   ├── optee_example_aes
> > │   ├── optee_example_hello_world
> > │   ├── optee_example_hotp
> > │   ├── optee_example_plugins
> > │   ├── optee_example_random
> > │   └── optee_example_secure_storage
> > ├── plugins
> > │   └── 96bcf744-4f72-4866-bf1d-8634fd9c65e5.plugin
> > └── ta
> >     ├── 2a287631-de1b-4fdd-a55c-b9312e40769a.ta
> >     ├── 484d4143-2d53-4841-3120-4a6f636b6542.ta
> >     ├── 5dbac793-f574-4871-8ad3-04331ec17f24.ta
> >     ├── 8aaaf200-2450-11e4-abe2-0002a5d5c51b.ta
> >     ├── a734eed9-d6a1-4244-aa50-7c99719e7b7b.ta
> >     ├── b6c53aba-9669-4668-a7f2-205629d00f86.ta
> >     └── f4e750bb-1437-4fbf-8785-8d3580c34994.ta
> >
> > 3 directories, 15 files
> >
> > > Looks to me like the issue is with newly added line
> > > https://gitlab.com/jonmason00/meta-arm/-/blob/master-next/meta-arm/recipes-security/optee/optee-examples.inc#L39
> > >
> >
> > Looks like this link is pointing to a line where OP-TEE uprev patch
> > isn't applied. Were you referring to following line?
> >
> > +    install -D -p -m0444 ${B}/plugins/* ${D}${libdir}/tee-supplicant/plugins
> >
> > As evident from optee-examples build folder above, the plugins
> > directory shouldn't be empty for a successful optee-examples build.
> >
> > -Sumit
> >
> > > Thanks,
> > > Jon
> > >
> > > >
> > > > -Sumit
> > > >
> > > > > Ross
> > > > >
> > > > > On Tue, 20 Jul 2021 at 11:07, Sumit Garg <sumit.garg@linaro.org> wrote:
> > > > > >
> > > > > > Brief description of changes:
> > > > > > - Version uplift 3.11.0 -> 3.14.0.
> > > > > > - Removed OP-TEE patches that has already been accepted upstream.
> > > > > > - Added support for tee-supplicant plugin framework testing.
> > > > > >
> > > > > > Tested on qemuarm64_secureboot:
> > > > > > $ xtest -l 15
> > > > > > $ optee-examples_*
> > > > > >
> > > > > > Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
> > > > > > ---
> > > > > >  .../optee/optee-client_3.11.0.bb              |   3 -
> > > > > >  .../optee/optee-client_3.14.0.bb              |   3 +
> > > > > >  .../recipes-security/optee/optee-examples.inc |   9 +-
> > > > > >  .../0001-make-Pass-ldflags-during-link.patch  | 103 ------------------
> > > > > >  ...efault-cross-compiler-environment-se.patch |  84 ++++++++++++++
> > > > > >  ...nable-plugins-installation-in-rootfs.patch |  39 +++++++
> > > > > >  .../optee/optee-examples_3.11.0.bb            |   4 -
> > > > > >  .../optee/optee-examples_3.14.0.bb            |   4 +
> > > > > >  ...ide-empty-__getauxval-implementation.patch |  62 -----------
> > > > > >  ...t-support-for-libnames-after-libgcc-.patch |  55 ----------
> > > > > >  ...ke-sure-that-libutils-is-linked-seco.patch |  44 --------
> > > > > >  .../recipes-security/optee/optee-os_3.11.0.bb |  11 --
> > > > > >  .../recipes-security/optee/optee-os_3.14.0.bb |   8 ++
> > > > > >  .../recipes-security/optee/optee-test.inc     |  15 +--
> > > > > >  ...Adjust-order-of-including-compiler.h.patch |  64 -----------
> > > > > >  ...ake-remove-Wno-unsafe-loop-for-clang.patch |  31 ------
> > > > > >  ...e-remove-Wmissing-noreturn-for-clang.patch |  31 ------
> > > > > >  .../optee/optee-test_3.11.0.bb                |   3 -
> > > > > >  .../optee/optee-test_3.14.0.bb                |   3 +
> > > > > >  19 files changed, 154 insertions(+), 422 deletions(-)
> > > > > >  delete mode 100644 meta-arm/recipes-security/optee/optee-client_3.11.0.bb
> > > > > >  create mode 100644 meta-arm/recipes-security/optee/optee-client_3.14.0.bb
> > > > > >  delete mode 100644 meta-arm/recipes-security/optee/optee-examples/0001-make-Pass-ldflags-during-link.patch
> > > > > >  create mode 100644 meta-arm/recipes-security/optee/optee-examples/0001-plugins-Honour-default-cross-compiler-environment-se.patch
> > > > > >  create mode 100644 meta-arm/recipes-security/optee/optee-examples/0002-Makefile-Enable-plugins-installation-in-rootfs.patch
> > > > > >  delete mode 100644 meta-arm/recipes-security/optee/optee-examples_3.11.0.bb
> > > > > >  create mode 100644 meta-arm/recipes-security/optee/optee-examples_3.14.0.bb
> > > > > >  delete mode 100644 meta-arm/recipes-security/optee/optee-os/0001-libutils-provide-empty-__getauxval-implementation.patch
> > > > > >  delete mode 100644 meta-arm/recipes-security/optee/optee-os/0002-link.mk-implement-support-for-libnames-after-libgcc-.patch
> > > > > >  delete mode 100644 meta-arm/recipes-security/optee/optee-os/0003-ta_dev_kit.mk-make-sure-that-libutils-is-linked-seco.patch
> > > > > >  delete mode 100644 meta-arm/recipes-security/optee/optee-os_3.11.0.bb
> > > > > >  create mode 100644 meta-arm/recipes-security/optee/optee-os_3.14.0.bb
> > > > > >  delete mode 100644 meta-arm/recipes-security/optee/optee-test/0001-host-xtest-Adjust-order-of-including-compiler.h.patch
> > > > > >  delete mode 100644 meta-arm/recipes-security/optee/optee-test/0002-make-remove-Wno-unsafe-loop-for-clang.patch
> > > > > >  delete mode 100644 meta-arm/recipes-security/optee/optee-test/0003-make-remove-Wmissing-noreturn-for-clang.patch
> > > > > >  delete mode 100644 meta-arm/recipes-security/optee/optee-test_3.11.0.bb
> > > > > >  create mode 100644 meta-arm/recipes-security/optee/optee-test_3.14.0.bb
> > > > > >
> > > > > > diff --git a/meta-arm/recipes-security/optee/optee-client_3.11.0.bb b/meta-arm/recipes-security/optee/optee-client_3.11.0.bb
> > > > > > deleted file mode 100644
> > > > > > index f765d12..0000000
> > > > > > --- a/meta-arm/recipes-security/optee/optee-client_3.11.0.bb
> > > > > > +++ /dev/null
> > > > > > @@ -1,3 +0,0 @@
> > > > > > -require optee-client.inc
> > > > > > -
> > > > > > -SRCREV = "c0c925384c1d7e3558d27d2708857482952d7907"
> > > > > > diff --git a/meta-arm/recipes-security/optee/optee-client_3.14.0.bb b/meta-arm/recipes-security/optee/optee-client_3.14.0.bb
> > > > > > new file mode 100644
> > > > > > index 0000000..be78b88
> > > > > > --- /dev/null
> > > > > > +++ b/meta-arm/recipes-security/optee/optee-client_3.14.0.bb
> > > > > > @@ -0,0 +1,3 @@
> > > > > > +require optee-client.inc
> > > > > > +
> > > > > > +SRCREV = "06e1b32f6a7028e039c625b07cfc25fda0c17d53"
> > > > > > diff --git a/meta-arm/recipes-security/optee/optee-examples.inc b/meta-arm/recipes-security/optee/optee-examples.inc
> > > > > > index 81c31bc..f2e53f3 100644
> > > > > > --- a/meta-arm/recipes-security/optee/optee-examples.inc
> > > > > > +++ b/meta-arm/recipes-security/optee/optee-examples.inc
> > > > > > @@ -12,7 +12,8 @@ inherit python3native
> > > > > >  require optee.inc
> > > > > >
> > > > > >  SRC_URI = "git://github.com/linaro-swg/optee_examples.git \
> > > > > > -           file://0001-make-Pass-ldflags-during-link.patch \
> > > > > > +           file://0001-plugins-Honour-default-cross-compiler-environment-se.patch \
> > > > > > +           file://0002-Makefile-Enable-plugins-installation-in-rootfs.patch \
> > > > > >            "
> > > > > >
> > > > > >  EXTRA_OEMAKE += "TA_DEV_KIT_DIR=${TA_DEV_KIT_DIR} \
> > > > > > @@ -32,11 +33,15 @@ do_compile[cleandirs] = "${B}"
> > > > > >  do_install () {
> > > > > >      mkdir -p ${D}${nonarch_base_libdir}/optee_armtz
> > > > > >      mkdir -p ${D}${bindir}
> > > > > > +    mkdir -p ${D}${libdir}/tee-supplicant/plugins
> > > > > >      install -D -p -m0755 ${B}/ca/* ${D}${bindir}
> > > > > >      install -D -p -m0444 ${B}/ta/* ${D}${nonarch_base_libdir}/optee_armtz
> > > > > > +    install -D -p -m0444 ${B}/plugins/* ${D}${libdir}/tee-supplicant/plugins
> > > > > >  }
> > > > > >
> > > > > > -FILES_${PN} += "${nonarch_base_libdir}/optee_armtz/"
> > > > > > +FILES_${PN} += "${nonarch_base_libdir}/optee_armtz/ \
> > > > > > +                ${libdir}/tee-supplicant/plugins/ \
> > > > > > +               "
> > > > > >
> > > > > >  # Imports machine specific configs from staging to build
> > > > > >  PACKAGE_ARCH = "${MACHINE_ARCH}"
> > > > > > diff --git a/meta-arm/recipes-security/optee/optee-examples/0001-make-Pass-ldflags-during-link.patch b/meta-arm/recipes-security/optee/optee-examples/0001-make-Pass-ldflags-during-link.patch
> > > > > > deleted file mode 100644
> > > > > > index 84202ef..0000000
> > > > > > --- a/meta-arm/recipes-security/optee/optee-examples/0001-make-Pass-ldflags-during-link.patch
> > > > > > +++ /dev/null
> > > > > > @@ -1,103 +0,0 @@
> > > > > > -From 29ae21de41f2fbab6dbecbbf408826b28de82df1 Mon Sep 17 00:00:00 2001
> > > > > > -From: Khem Raj <raj.khem@gmail.com>
> > > > > > -Date: Tue, 1 Sep 2020 21:09:56 -0700
> > > > > > -Subject: [PATCH] make: Pass ldflags during link
> > > > > > -
> > > > > > -OpenEmbeeded needs to pass essential linker flags to set correct flags
> > > > > > -for gnu_hash among others which sets the linking straight
> > > > > > -using LDFLAGS varible here means, we can affect the linker flags
> > > > > > -from build environment
> > > > > > -
> > > > > > -Upstream-Status: Submitted [https://github.com/linaro-swg/optee_examples/pull/85]
> > > > > > -
> > > > > > -Signed-off-by: Khem Raj <raj.khem@gmail.com>
> > > > > > ----
> > > > > > - acipher/host/Makefile        | 2 +-
> > > > > > - aes/host/Makefile            | 2 +-
> > > > > > - hello_world/host/Makefile    | 2 +-
> > > > > > - hotp/host/Makefile           | 2 +-
> > > > > > - random/host/Makefile         | 2 +-
> > > > > > - secure_storage/host/Makefile | 2 +-
> > > > > > - 6 files changed, 6 insertions(+), 6 deletions(-)
> > > > > > -
> > > > > > -diff --git a/acipher/host/Makefile b/acipher/host/Makefile
> > > > > > -index 8f4bc8a..c2cabef 100644
> > > > > > ---- a/acipher/host/Makefile
> > > > > > -+++ b/acipher/host/Makefile
> > > > > > -@@ -18,7 +18,7 @@ BINARY = optee_example_acipher
> > > > > > - all: $(BINARY)
> > > > > > -
> > > > > > - $(BINARY): $(OBJS)
> > > > > > --      $(CC) -o $@ $< $(LDADD)
> > > > > > -+      $(CC) -o $@ $< $(LDFLAGS) $(LDADD)
> > > > > > -
> > > > > > - .PHONY: clean
> > > > > > - clean:
> > > > > > -diff --git a/aes/host/Makefile b/aes/host/Makefile
> > > > > > -index dfeb4e8..f61c71b 100644
> > > > > > ---- a/aes/host/Makefile
> > > > > > -+++ b/aes/host/Makefile
> > > > > > -@@ -18,7 +18,7 @@ BINARY = optee_example_aes
> > > > > > - all: $(BINARY)
> > > > > > -
> > > > > > - $(BINARY): $(OBJS)
> > > > > > --      $(CC) -o $@ $< $(LDADD)
> > > > > > -+      $(CC) -o $@ $< $(LDFLAGS) $(LDADD)
> > > > > > -
> > > > > > - .PHONY: clean
> > > > > > - clean:
> > > > > > -diff --git a/hello_world/host/Makefile b/hello_world/host/Makefile
> > > > > > -index c4c8239..69cf42c 100644
> > > > > > ---- a/hello_world/host/Makefile
> > > > > > -+++ b/hello_world/host/Makefile
> > > > > > -@@ -18,7 +18,7 @@ BINARY = optee_example_hello_world
> > > > > > - all: $(BINARY)
> > > > > > -
> > > > > > - $(BINARY): $(OBJS)
> > > > > > --      $(CC) -o $@ $< $(LDADD)
> > > > > > -+      $(CC) -o $@ $< $(LDFLAGS) $(LDADD)
> > > > > > -
> > > > > > - .PHONY: clean
> > > > > > - clean:
> > > > > > -diff --git a/hotp/host/Makefile b/hotp/host/Makefile
> > > > > > -index cb7fd19..e7f013f 100644
> > > > > > ---- a/hotp/host/Makefile
> > > > > > -+++ b/hotp/host/Makefile
> > > > > > -@@ -18,7 +18,7 @@ BINARY = optee_example_hotp
> > > > > > - all: $(BINARY)
> > > > > > -
> > > > > > - $(BINARY): $(OBJS)
> > > > > > --      $(CC) -o $@ $< $(LDADD)
> > > > > > -+      $(CC) -o $@ $< $(LDFLAGS) $(LDADD)
> > > > > > -
> > > > > > - .PHONY: clean
> > > > > > - clean:
> > > > > > -diff --git a/random/host/Makefile b/random/host/Makefile
> > > > > > -index fd407d9..9377f7a 100644
> > > > > > ---- a/random/host/Makefile
> > > > > > -+++ b/random/host/Makefile
> > > > > > -@@ -18,7 +18,7 @@ BINARY = optee_example_random
> > > > > > - all: $(BINARY)
> > > > > > -
> > > > > > - $(BINARY): $(OBJS)
> > > > > > --      $(CC) -o $@ $< $(LDADD)
> > > > > > -+      $(CC) -o $@ $< $(LDFLAGS) $(LDADD)
> > > > > > -
> > > > > > - .PHONY: clean
> > > > > > - clean:
> > > > > > -diff --git a/secure_storage/host/Makefile b/secure_storage/host/Makefile
> > > > > > -index 29bfb87..b3265ae 100644
> > > > > > ---- a/secure_storage/host/Makefile
> > > > > > -+++ b/secure_storage/host/Makefile
> > > > > > -@@ -18,7 +18,7 @@ BINARY = optee_example_secure_storage
> > > > > > - all: $(BINARY)
> > > > > > -
> > > > > > - $(BINARY): $(OBJS)
> > > > > > --      $(CC) -o $@ $< $(LDADD)
> > > > > > -+      $(CC) -o $@ $< $(LDFLAGS) $(LDADD)
> > > > > > -
> > > > > > - .PHONY: clean
> > > > > > - clean:
> > > > > > ---
> > > > > > -2.28.0
> > > > > > -
> > > > > > diff --git a/meta-arm/recipes-security/optee/optee-examples/0001-plugins-Honour-default-cross-compiler-environment-se.patch b/meta-arm/recipes-security/optee/optee-examples/0001-plugins-Honour-default-cross-compiler-environment-se.patch
> > > > > > new file mode 100644
> > > > > > index 0000000..033e48c
> > > > > > --- /dev/null
> > > > > > +++ b/meta-arm/recipes-security/optee/optee-examples/0001-plugins-Honour-default-cross-compiler-environment-se.patch
> > > > > > @@ -0,0 +1,84 @@
> > > > > > +From 79c826c249001700007a6dffe80c3d61ff4428ef Mon Sep 17 00:00:00 2001
> > > > > > +From: Sumit Garg <sumit.garg@linaro.org>
> > > > > > +Date: Tue, 20 Jul 2021 13:54:30 +0530
> > > > > > +Subject: [PATCH 1/2] plugins: Honour default cross compiler environment setup
> > > > > > +
> > > > > > +Honour default $(CC), $(CFLAGS) and $(LDFLAGS) variables. Without this
> > > > > > +plugins example fails to build for OE/Yocto.
> > > > > > +
> > > > > > +Upstream-Status: Submitted [https://github.com/linaro-swg/optee_examples/pull/87]
> > > > > > +
> > > > > > +Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
> > > > > > +---
> > > > > > + plugins/Makefile        |  2 +-
> > > > > > + plugins/host/Makefile   |  2 +-
> > > > > > + plugins/syslog/Makefile | 16 ++++++++++++----
> > > > > > + 3 files changed, 14 insertions(+), 6 deletions(-)
> > > > > > +
> > > > > > +diff --git a/plugins/Makefile b/plugins/Makefile
> > > > > > +index 2372b38..ea472b4 100644
> > > > > > +--- a/plugins/Makefile
> > > > > > ++++ b/plugins/Makefile
> > > > > > +@@ -8,7 +8,7 @@ TA_CROSS_COMPILE ?= $(CROSS_COMPILE)
> > > > > > + all:
> > > > > > +       $(MAKE) -C host CROSS_COMPILE="$(HOST_CROSS_COMPILE)" --no-builtin-variables
> > > > > > +       $(MAKE) -C ta CROSS_COMPILE="$(TA_CROSS_COMPILE)" LDFLAGS=""
> > > > > > +-      $(MAKE) -C syslog CROSS_COMPILE="$(HOST_CROSS_COMPILE)"
> > > > > > ++      $(MAKE) -C syslog CROSS_COMPILE="$(HOST_CROSS_COMPILE)" --no-builtin-variables
> > > > > > +
> > > > > > + .PHONY: clean
> > > > > > + clean:
> > > > > > +diff --git a/plugins/host/Makefile b/plugins/host/Makefile
> > > > > > +index 7285104..76244c7 100644
> > > > > > +--- a/plugins/host/Makefile
> > > > > > ++++ b/plugins/host/Makefile
> > > > > > +@@ -20,7 +20,7 @@ BINARY = optee_example_plugins
> > > > > > + all: $(BINARY)
> > > > > > +
> > > > > > + $(BINARY): $(OBJS)
> > > > > > +-      $(CC) -o $@ $< $(LDADD)
> > > > > > ++      $(CC) $(LDFLAGS) -o $@ $< $(LDADD)
> > > > > > +
> > > > > > + .PHONY: clean
> > > > > > + clean:
> > > > > > +diff --git a/plugins/syslog/Makefile b/plugins/syslog/Makefile
> > > > > > +index 62d916a..71f5f92 100644
> > > > > > +--- a/plugins/syslog/Makefile
> > > > > > ++++ b/plugins/syslog/Makefile
> > > > > > +@@ -1,3 +1,11 @@
> > > > > > ++CC      ?= $(CROSS_COMPILE)gcc
> > > > > > ++LD      ?= $(CROSS_COMPILE)ld
> > > > > > ++AR      ?= $(CROSS_COMPILE)ar
> > > > > > ++NM      ?= $(CROSS_COMPILE)nm
> > > > > > ++OBJCOPY ?= $(CROSS_COMPILE)objcopy
> > > > > > ++OBJDUMP ?= $(CROSS_COMPILE)objdump
> > > > > > ++READELF ?= $(CROSS_COMPILE)readelf
> > > > > > ++
> > > > > > + PLUGIN_UUID = 96bcf744-4f72-4866-bf1d-8634fd9c65e5
> > > > > > +
> > > > > > + PLUGIN                        = $(PLUGIN_UUID).plugin
> > > > > > +@@ -6,17 +14,17 @@ PLUGIN_OBJ          = $(patsubst %.c, %.o, $(PLUGIN_SRS))
> > > > > > + PLUGIN_INCLUDES_DIR   = $(CURDIR) $(TEEC_EXPORT)/include
> > > > > > +
> > > > > > + PLUGIN_INCLUDES               = $(addprefix -I, $(PLUGIN_INCLUDES_DIR))
> > > > > > +-PLUGIN_CCFLAGS                = -Wall -fPIC
> > > > > > +-PLUGIN_LDFLAGS                = -shared
> > > > > > ++PLUGIN_CCFLAGS                = $(CFLAGS) -Wall -fPIC
> > > > > > ++PLUGIN_LDFLAGS                = $(LDFLAGS) -shared
> > > > > > +
> > > > > > + .PHONY: all
> > > > > > + all: $(PLUGIN)
> > > > > > +
> > > > > > + $(PLUGIN): $(PLUGIN_OBJ)
> > > > > > +-      $(CROSS_COMPILE)gcc $(PLUGIN_LDFLAGS) $(PLUGIN_OBJ) -o $@
> > > > > > ++      $(CC) $(PLUGIN_LDFLAGS) $(PLUGIN_OBJ) -o $@
> > > > > > +
> > > > > > + %.o: %.c
> > > > > > +-      $(CROSS_COMPILE)gcc $(PLUGIN_CCFLAGS) $(PLUGIN_INCLUDES) -c $*.c -o $*.o
> > > > > > ++      $(CC) $(PLUGIN_CCFLAGS) $(PLUGIN_INCLUDES) -c $*.c -o $*.o
> > > > > > +
> > > > > > + .PHONY: clean
> > > > > > + clean:
> > > > > > +--
> > > > > > +2.25.1
> > > > > > +
> > > > > > diff --git a/meta-arm/recipes-security/optee/optee-examples/0002-Makefile-Enable-plugins-installation-in-rootfs.patch b/meta-arm/recipes-security/optee/optee-examples/0002-Makefile-Enable-plugins-installation-in-rootfs.patch
> > > > > > new file mode 100644
> > > > > > index 0000000..8d1d60a
> > > > > > --- /dev/null
> > > > > > +++ b/meta-arm/recipes-security/optee/optee-examples/0002-Makefile-Enable-plugins-installation-in-rootfs.patch
> > > > > > @@ -0,0 +1,39 @@
> > > > > > +From a865f2e25e178fc2c4617eb1faf79ac922d02ffd Mon Sep 17 00:00:00 2001
> > > > > > +From: Sumit Garg <sumit.garg@linaro.org>
> > > > > > +Date: Tue, 20 Jul 2021 14:20:10 +0530
> > > > > > +Subject: [PATCH 2/2] Makefile: Enable plugins installation in rootfs
> > > > > > +
> > > > > > +Upstream-Status: Submitted [https://github.com/linaro-swg/optee_examples/pull/87]
> > > > > > +
> > > > > > +Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
> > > > > > +---
> > > > > > + Makefile | 5 +++++
> > > > > > + 1 file changed, 5 insertions(+)
> > > > > > +
> > > > > > +diff --git a/Makefile b/Makefile
> > > > > > +index a275842..b3f16aa 100644
> > > > > > +--- a/Makefile
> > > > > > ++++ b/Makefile
> > > > > > +@@ -25,14 +25,19 @@ prepare-for-rootfs: examples
> > > > > > +       @mkdir -p $(OUTPUT_DIR)
> > > > > > +       @mkdir -p $(OUTPUT_DIR)/ta
> > > > > > +       @mkdir -p $(OUTPUT_DIR)/ca
> > > > > > ++      @mkdir -p $(OUTPUT_DIR)/plugins
> > > > > > +       @for example in $(EXAMPLE_LIST); do \
> > > > > > +               if [ -e $$example/host/optee_example_$$example ]; then \
> > > > > > +                       cp -p $$example/host/optee_example_$$example $(OUTPUT_DIR)/ca/; \
> > > > > > +               fi; \
> > > > > > +               cp -pr $$example/ta/*.ta $(OUTPUT_DIR)/ta/; \
> > > > > > ++              if [ $$example == plugins ]; then \
> > > > > > ++                      cp -p plugins/syslog/*.plugin $(OUTPUT_DIR)/plugins/; \
> > > > > > ++              fi; \
> > > > > > +       done
> > > > > > +
> > > > > > + prepare-for-rootfs-clean:
> > > > > > +       @rm -rf $(OUTPUT_DIR)/ta
> > > > > > +       @rm -rf $(OUTPUT_DIR)/ca
> > > > > > ++      @rm -rf $(OUTPUT_DIR)/plugins
> > > > > > +       @rmdir --ignore-fail-on-non-empty $(OUTPUT_DIR) || test ! -e $(OUTPUT_DIR)
> > > > > > +--
> > > > > > +2.25.1
> > > > > > +
> > > > > > diff --git a/meta-arm/recipes-security/optee/optee-examples_3.11.0.bb b/meta-arm/recipes-security/optee/optee-examples_3.11.0.bb
> > > > > > deleted file mode 100644
> > > > > > index 72473ed..0000000
> > > > > > --- a/meta-arm/recipes-security/optee/optee-examples_3.11.0.bb
> > > > > > +++ /dev/null
> > > > > > @@ -1,4 +0,0 @@
> > > > > > -require optee-examples.inc
> > > > > > -
> > > > > > -SRCREV = "9a7dc598591990349d88b4dba3a37aadd6851295"
> > > > > > -
> > > > > > diff --git a/meta-arm/recipes-security/optee/optee-examples_3.14.0.bb b/meta-arm/recipes-security/optee/optee-examples_3.14.0.bb
> > > > > > new file mode 100644
> > > > > > index 0000000..f2b5f7d
> > > > > > --- /dev/null
> > > > > > +++ b/meta-arm/recipes-security/optee/optee-examples_3.14.0.bb
> > > > > > @@ -0,0 +1,4 @@
> > > > > > +require optee-examples.inc
> > > > > > +
> > > > > > +SRCREV = "e9c870525af8f7e7fccf575a0ca5394ce55adcec"
> > > > > > +
> > > > > > diff --git a/meta-arm/recipes-security/optee/optee-os/0001-libutils-provide-empty-__getauxval-implementation.patch b/meta-arm/recipes-security/optee/optee-os/0001-libutils-provide-empty-__getauxval-implementation.patch
> > > > > > deleted file mode 100644
> > > > > > index 0120f5c..0000000
> > > > > > --- a/meta-arm/recipes-security/optee/optee-os/0001-libutils-provide-empty-__getauxval-implementation.patch
> > > > > > +++ /dev/null
> > > > > > @@ -1,62 +0,0 @@
> > > > > > -Upstream-Status: Backport
> > > > > > -Signed-off-by: Ross Burton <ross.burton@arm.com>
> > > > > > -
> > > > > > -From 36e784f621bf5d5be9183beba35f39426277c110 Mon Sep 17 00:00:00 2001
> > > > > > -From: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
> > > > > > -Date: Tue, 13 Oct 2020 22:45:39 +0300
> > > > > > -Subject: [PATCH 1/3] libutils: provide empty __getauxval() implementation
> > > > > > -
> > > > > > -Never version of libgcc are built with LSE implementation in mind. To
> > > > > > -determine if LSE is available on platform it calls __getauxval(), so in
> > > > > > -some cases we can get undefined reference to __getauxval() error.
> > > > > > -
> > > > > > -Prominent case is libgcc_eh.a library, which is used by C++ TAs. Exception
> > > > > > -handler depends on atomic operations, so it tries to call
> > > > > > -init_have_lse_atomics() first. This function in turn calls __getauxval(),
> > > > > > -which causes linking error.
> > > > > > -
> > > > > > -In the future we can make __getauxval() to return actual platform
> > > > > > -capabilities.
> > > > > > -
> > > > > > -Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
> > > > > > -Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
> > > > > > -Reviewed-by: Jerome Forissier <jerome@forissier.org>
> > > > > > ----
> > > > > > - lib/libutils/ext/arch/arm/auxval.c | 12 ++++++++++++
> > > > > > - lib/libutils/ext/arch/arm/sub.mk   |  1 +
> > > > > > - 2 files changed, 13 insertions(+)
> > > > > > - create mode 100644 lib/libutils/ext/arch/arm/auxval.c
> > > > > > -
> > > > > > -diff --git a/lib/libutils/ext/arch/arm/auxval.c b/lib/libutils/ext/arch/arm/auxval.c
> > > > > > -new file mode 100644
> > > > > > -index 00000000..98bca850
> > > > > > ---- /dev/null
> > > > > > -+++ b/lib/libutils/ext/arch/arm/auxval.c
> > > > > > -@@ -0,0 +1,12 @@
> > > > > > -+// SPDX-License-Identifier: BSD-2-Clause
> > > > > > -+/*
> > > > > > -+ * Copyright (c) 2020, EPAM Systems
> > > > > > -+ */
> > > > > > -+
> > > > > > -+#include <compiler.h>
> > > > > > -+
> > > > > > -+unsigned long int __getauxval (unsigned long int type);
> > > > > > -+unsigned long int __getauxval (unsigned long int type __unused)
> > > > > > -+{
> > > > > > -+      return 0;
> > > > > > -+}
> > > > > > -diff --git a/lib/libutils/ext/arch/arm/sub.mk b/lib/libutils/ext/arch/arm/sub.mk
> > > > > > -index dc5eed67..2e779066 100644
> > > > > > ---- a/lib/libutils/ext/arch/arm/sub.mk
> > > > > > -+++ b/lib/libutils/ext/arch/arm/sub.mk
> > > > > > -@@ -3,6 +3,7 @@ srcs-$(CFG_ARM32_$(sm)) += aeabi_unwind.c
> > > > > > - endif
> > > > > > - srcs-$(CFG_ARM32_$(sm)) += atomic_a32.S
> > > > > > - srcs-$(CFG_ARM64_$(sm)) += atomic_a64.S
> > > > > > -+srcs-y += auxval.c
> > > > > > - ifneq ($(sm),ldelf) # TA, core
> > > > > > - srcs-$(CFG_ARM32_$(sm)) += mcount_a32.S
> > > > > > - srcs-$(CFG_ARM64_$(sm)) += mcount_a64.S
> > > > > > ---
> > > > > > -2.25.1
> > > > > > -
> > > > > > diff --git a/meta-arm/recipes-security/optee/optee-os/0002-link.mk-implement-support-for-libnames-after-libgcc-.patch b/meta-arm/recipes-security/optee/optee-os/0002-link.mk-implement-support-for-libnames-after-libgcc-.patch
> > > > > > deleted file mode 100644
> > > > > > index 11296c8..0000000
> > > > > > --- a/meta-arm/recipes-security/optee/optee-os/0002-link.mk-implement-support-for-libnames-after-libgcc-.patch
> > > > > > +++ /dev/null
> > > > > > @@ -1,55 +0,0 @@
> > > > > > -Upstream-Status: Backport
> > > > > > -Signed-off-by: Ross Burton <ross.burton@arm.com>
> > > > > > -
> > > > > > -From 73196b58ea6978ffa5e581738030f51c5789ef73 Mon Sep 17 00:00:00 2001
> > > > > > -From: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
> > > > > > -Date: Tue, 13 Oct 2020 22:54:13 +0300
> > > > > > -Subject: [PATCH 2/3] link.mk: implement support for libnames-after-libgcc
> > > > > > - variable
> > > > > > -
> > > > > > -Newer versions of libgcc depend on external __getauxval() symbol, which is
> > > > > > -now provided by libutils. But libgcc is linked after libutils, so linker
> > > > > > -can't resolve that symbol. We can't include libgcc into linking group with
> > > > > > -libtutils, because libgcc provides symbols that conflict with libutil's
> > > > > > -ones, like __aeabi_idiv with friends for instance.
> > > > > > -
> > > > > > -So, to resolve libgcc dependency on libutils we need to link with libutils
> > > > > > -second time. To make things more generic, we will introduce
> > > > > > -$(libnames-after-libgcc) variable for libraries that should be linked after
> > > > > > -libgcc.
> > > > > > -
> > > > > > -Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
> > > > > > -Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
> > > > > > -Reviewed-by: Jerome Forissier <jerome@forissier.org>
> > > > > > ----
> > > > > > - ta/arch/arm/link.mk | 6 +++++-
> > > > > > - 1 file changed, 5 insertions(+), 1 deletion(-)
> > > > > > -
> > > > > > -diff --git a/ta/arch/arm/link.mk b/ta/arch/arm/link.mk
> > > > > > -index 445c285d..3025acb1 100644
> > > > > > ---- a/ta/arch/arm/link.mk
> > > > > > -+++ b/ta/arch/arm/link.mk
> > > > > > -@@ -55,8 +55,11 @@ link-ldflags += --eh-frame-hdr
> > > > > > - link-ldadd += $(libstdc++$(sm)) $(libgcc_eh$(sm))
> > > > > > - endif
> > > > > > - link-ldadd += --end-group
> > > > > > --ldargs-$(user-ta-uuid).elf := $(link-ldflags) $(objs) $(link-ldadd) $(libgcc$(sm))
> > > > > > -
> > > > > > -+link-ldadd-after-libgcc += $(addprefix -l,$(libnames-after-libgcc))
> > > > > > -+
> > > > > > -+ldargs-$(user-ta-uuid).elf := $(link-ldflags) $(objs) $(link-ldadd) \
> > > > > > -+                              $(libgcc$(sm)) $(link-ldadd-after-libgcc)
> > > > > > -
> > > > > > - link-script-cppflags-$(sm) := \
> > > > > > -       $(filter-out $(CPPFLAGS_REMOVE) $(cppflags-remove), \
> > > > > > -@@ -76,6 +79,7 @@ $(link-script-pp$(sm)): $(link-script$(sm)) $(conf-file) $(link-script-pp-makefi
> > > > > > -               $(link-script-cppflags-$(sm)) $$< -o $$@
> > > > > > -
> > > > > > - $(link-out-dir$(sm))/$(user-ta-uuid).elf: $(objs) $(libdeps) \
> > > > > > -+                                        $(libdeps-after-libgcc) \
> > > > > > -                                         $(link-script-pp$(sm)) \
> > > > > > -                                         $(dynlistdep) \
> > > > > > -                                         $(additional-link-deps)
> > > > > > ---
> > > > > > -2.25.1
> > > > > > -
> > > > > > diff --git a/meta-arm/recipes-security/optee/optee-os/0003-ta_dev_kit.mk-make-sure-that-libutils-is-linked-seco.patch b/meta-arm/recipes-security/optee/optee-os/0003-ta_dev_kit.mk-make-sure-that-libutils-is-linked-seco.patch
> > > > > > deleted file mode 100644
> > > > > > index 88ba5f8..0000000
> > > > > > --- a/meta-arm/recipes-security/optee/optee-os/0003-ta_dev_kit.mk-make-sure-that-libutils-is-linked-seco.patch
> > > > > > +++ /dev/null
> > > > > > @@ -1,44 +0,0 @@
> > > > > > -Upstream-Status: Backport
> > > > > > -Signed-off-by: Ross Burton <ross.burton@arm.com>
> > > > > > -
> > > > > > -From f50962e3f56f0932662b2ffa10afe53339a335dd Mon Sep 17 00:00:00 2001
> > > > > > -From: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
> > > > > > -Date: Fri, 16 Oct 2020 16:36:08 +0300
> > > > > > -Subject: [PATCH 3/3] ta_dev_kit.mk: make sure that libutils is linked second
> > > > > > - time
> > > > > > -
> > > > > > -libgcc depends on __getauxval symbol from libuils. As, generally libutils
> > > > > > -is linked before libgcc, we will get "unresolved symbol" error. To resolve
> > > > > > -this dependency we need to link libutils second time - after libgcc.
> > > > > > -
> > > > > > -Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
> > > > > > -Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
> > > > > > -Reviewed-by: Jerome Forissier <jerome@forissier.org>
> > > > > > ----
> > > > > > - ta/mk/ta_dev_kit.mk | 10 ++++++++++
> > > > > > - 1 file changed, 10 insertions(+)
> > > > > > -
> > > > > > -diff --git a/ta/mk/ta_dev_kit.mk b/ta/mk/ta_dev_kit.mk
> > > > > > -index e28be677..d0e66317 100644
> > > > > > ---- a/ta/mk/ta_dev_kit.mk
> > > > > > -+++ b/ta/mk/ta_dev_kit.mk
> > > > > > -@@ -78,6 +78,16 @@ endif
> > > > > > - libnames += dl
> > > > > > - libdeps += $(ta-dev-kit-dir$(sm))/lib/libdl.a
> > > > > > -
> > > > > > -+# libutils provides __getauxval symbol which is needed by libgcc 10.x. We can't
> > > > > > -+# link libutils after libgcc, because libgcc will replace some symbols provided
> > > > > > -+# by libutils, which will cause further linking issues.
> > > > > > -+#
> > > > > > -+# But if we place libutils before libgcc, linker will not be able to resolve
> > > > > > -+# __getauxval. So we need to link with libutils twice: before and after libgcc.
> > > > > > -+# Hence it included both in $(libnames) and in $(libnames-after-libgcc)
> > > > > > -+libnames-after-libgcc += utils
> > > > > > -+libdeps-after-libgcc += $(ta-dev-kit-dir$(sm))/lib/libutils.a
> > > > > > -+
> > > > > > - # Pass config variable (CFG_) from conf.mk on the command line
> > > > > > - cppflags$(sm) += $(strip \
> > > > > > -       $(foreach var, $(filter CFG_%,$(.VARIABLES)), \
> > > > > > ---
> > > > > > -2.25.1
> > > > > > -
> > > > > > diff --git a/meta-arm/recipes-security/optee/optee-os_3.11.0.bb b/meta-arm/recipes-security/optee/optee-os_3.11.0.bb
> > > > > > deleted file mode 100644
> > > > > > index 13b3dc6..0000000
> > > > > > --- a/meta-arm/recipes-security/optee/optee-os_3.11.0.bb
> > > > > > +++ /dev/null
> > > > > > @@ -1,11 +0,0 @@
> > > > > > -require optee-os.inc
> > > > > > -
> > > > > > -SRCREV = "c4def2a8262a03244d9a88461699b9b8e43c6b55"
> > > > > > -
> > > > > > -SRC_URI_append = " \
> > > > > > -    file://0006-allow-setting-sysroot-for-libgcc-lookup.patch \
> > > > > > -    file://0007-allow-setting-sysroot-for-clang.patch \
> > > > > > -    file://0001-libutils-provide-empty-__getauxval-implementation.patch \
> > > > > > -    file://0002-link.mk-implement-support-for-libnames-after-libgcc-.patch \
> > > > > > -    file://0003-ta_dev_kit.mk-make-sure-that-libutils-is-linked-seco.patch \
> > > > > > -"
> > > > > > diff --git a/meta-arm/recipes-security/optee/optee-os_3.14.0.bb b/meta-arm/recipes-security/optee/optee-os_3.14.0.bb
> > > > > > new file mode 100644
> > > > > > index 0000000..3289e2c
> > > > > > --- /dev/null
> > > > > > +++ b/meta-arm/recipes-security/optee/optee-os_3.14.0.bb
> > > > > > @@ -0,0 +1,8 @@
> > > > > > +require optee-os.inc
> > > > > > +
> > > > > > +SRCREV = "d21befa5e53eae9db469eba1685f5aa5c6f92c2f"
> > > > > > +
> > > > > > +SRC_URI_append = " \
> > > > > > +    file://0006-allow-setting-sysroot-for-libgcc-lookup.patch \
> > > > > > +    file://0007-allow-setting-sysroot-for-clang.patch \
> > > > > > +"
> > > > > > diff --git a/meta-arm/recipes-security/optee/optee-test.inc b/meta-arm/recipes-security/optee/optee-test.inc
> > > > > > index f09b9d2..bcbcc06 100644
> > > > > > --- a/meta-arm/recipes-security/optee/optee-test.inc
> > > > > > +++ b/meta-arm/recipes-security/optee/optee-test.inc
> > > > > > @@ -8,17 +8,9 @@ LIC_FILES_CHKSUM = "file://${S}/LICENSE.md;md5=daa2bcccc666345ab8940aab1315a4fa"
> > > > > >  inherit python3native ptest
> > > > > >  require optee.inc
> > > > > >
> > > > > > -# Linking fails on musl due to C++/threads
> > > > > > -# https://github.com/OP-TEE/optee_test/issues/458#issuecomment-720540834
> > > > > > -# When upgraded we should be able to remove this limitation
> > > > > > -COMPATIBLE_HOST_libc-musl = 'null'
> > > > > > -
> > > > > >  DEPENDS = "optee-client optee-os python3-pycryptodome-native"
> > > > > >
> > > > > >  SRC_URI = "git://github.com/OP-TEE/optee_test.git \
> > > > > > -           file://0001-host-xtest-Adjust-order-of-including-compiler.h.patch \
> > > > > > -           file://0002-make-remove-Wno-unsafe-loop-for-clang.patch \
> > > > > > -           file://0003-make-remove-Wmissing-noreturn-for-clang.patch \
> > > > > >             file://run-ptest \
> > > > > >            "
> > > > > >
> > > > > > @@ -36,6 +28,7 @@ do_compile() {
> > > > > >      # Top level makefile doesn't seem to handle parallel make gracefully
> > > > > >      oe_runmake xtest
> > > > > >      oe_runmake ta
> > > > > > +    oe_runmake test_plugin
> > > > > >  }
> > > > > >  do_compile[cleandirs] = "${B}"
> > > > > >
> > > > > > @@ -46,9 +39,13 @@ do_install () {
> > > > > >      # default TEEC_LOAD_PATH is /lib
> > > > > >      mkdir -p ${D}${nonarch_base_libdir}/optee_armtz/
> > > > > >      install -D -p -m0444 ${B}/ta/*/*.ta ${D}${nonarch_base_libdir}/optee_armtz/
> > > > > > +    mkdir -p ${D}${libdir}/tee-supplicant/plugins
> > > > > > +    install -D -p -m0444 ${B}/supp_plugin/*.plugin ${D}${libdir}/tee-supplicant/plugins/
> > > > > >  }
> > > > > >
> > > > > > -FILES_${PN} += "${nonarch_base_libdir}/optee_armtz/"
> > > > > > +FILES_${PN} += "${nonarch_base_libdir}/optee_armtz/ \
> > > > > > +                ${libdir}/tee-supplicant/plugins/ \
> > > > > > +               "
> > > > > >
> > > > > >  # Imports machine specific configs from staging to build
> > > > > >  PACKAGE_ARCH = "${MACHINE_ARCH}"
> > > > > > diff --git a/meta-arm/recipes-security/optee/optee-test/0001-host-xtest-Adjust-order-of-including-compiler.h.patch b/meta-arm/recipes-security/optee/optee-test/0001-host-xtest-Adjust-order-of-including-compiler.h.patch
> > > > > > deleted file mode 100644
> > > > > > index 3c500d7..0000000
> > > > > > --- a/meta-arm/recipes-security/optee/optee-test/0001-host-xtest-Adjust-order-of-including-compiler.h.patch
> > > > > > +++ /dev/null
> > > > > > @@ -1,64 +0,0 @@
> > > > > > -From fc95b3ccbbfd336797ae2cfd6dd4dc58644e146f Mon Sep 17 00:00:00 2001
> > > > > > -From: Khem Raj <raj.khem@gmail.com>
> > > > > > -Date: Sat, 30 May 2020 17:52:18 -0700
> > > > > > -Subject: [PATCH] host/xtest: Adjust order of including compiler.h
> > > > > > -
> > > > > > -compiler.h defines some defines which violate libc namespace e.g.
> > > > > > -__unused, this works ok with glibc but fails in awkward ways with musl
> > > > > > -the reason is musl uses __unused in its internal structures and this
> > > > > > -define in compiler.h conflicts with system headers causing errors like
> > > > > > -
> > > > > > -recipe-sysroot/usr/include/bits/stat.h:17:19: error: expected identifier or '(' before '[' token unsigned __unused[2];
> > > > > > -                   ^
> > > > > > -including compiler.h afer sys/stat.h fixes the problem.
> > > > > > -
> > > > > > -Upstream-Status: Pending [https://github.com/OP-TEE/optee_test/issues/453]
> > > > > > -Signed-off-by: Khem Raj <raj.khem@gmail.com>
> > > > > > ----
> > > > > > - host/xtest/install_ta.c | 2 +-
> > > > > > - host/xtest/stats.c      | 2 +-
> > > > > > - 2 files changed, 2 insertions(+), 2 deletions(-)
> > > > > > -
> > > > > > -diff --git a/host/xtest/install_ta.c b/host/xtest/install_ta.c
> > > > > > -index 09a4c6d..6f7bb5c 100644
> > > > > > ---- a/host/xtest/install_ta.c
> > > > > > -+++ b/host/xtest/install_ta.c
> > > > > > -@@ -4,7 +4,6 @@
> > > > > > -  * SPDX-License-Identifier: BSD-2-Clause
> > > > > > -  */
> > > > > > -
> > > > > > --#include <compiler.h>
> > > > > > - #include <dirent.h>
> > > > > > - #include <err.h>
> > > > > > - #include <errno.h>
> > > > > > -@@ -20,6 +19,7 @@
> > > > > > - #include <sys/types.h>
> > > > > > - #include <tee_client_api.h>
> > > > > > - #include <unistd.h>
> > > > > > -+#include <compiler.h>
> > > > > > -
> > > > > > - #include "install_ta.h"
> > > > > > - #include "xtest_helpers.h"
> > > > > > -diff --git a/host/xtest/stats.c b/host/xtest/stats.c
> > > > > > -index 96b0b5f..db9bf25 100644
> > > > > > ---- a/host/xtest/stats.c
> > > > > > -+++ b/host/xtest/stats.c
> > > > > > -@@ -3,7 +3,6 @@
> > > > > > -  * Copyright (c) 2019, Linaro Limited
> > > > > > -  */
> > > > > > -
> > > > > > --#include <compiler.h>
> > > > > > - #include <dirent.h>
> > > > > > - #include <err.h>
> > > > > > - #include <errno.h>
> > > > > > -@@ -18,6 +17,7 @@
> > > > > > - #include <sys/types.h>
> > > > > > - #include <tee_client_api.h>
> > > > > > - #include <unistd.h>
> > > > > > -+#include <compiler.h>
> > > > > > - #include "xtest_test.h"
> > > > > > - #include "stats.h"
> > > > > > -
> > > > > > ---
> > > > > > -2.26.2
> > > > > > -
> > > > > > diff --git a/meta-arm/recipes-security/optee/optee-test/0002-make-remove-Wno-unsafe-loop-for-clang.patch b/meta-arm/recipes-security/optee/optee-test/0002-make-remove-Wno-unsafe-loop-for-clang.patch
> > > > > > deleted file mode 100644
> > > > > > index 17dd7d8..0000000
> > > > > > --- a/meta-arm/recipes-security/optee/optee-test/0002-make-remove-Wno-unsafe-loop-for-clang.patch
> > > > > > +++ /dev/null
> > > > > > @@ -1,31 +0,0 @@
> > > > > > -From 438533ce9da1df0b7c7914e64b39ffdc1da1ab79 Mon Sep 17 00:00:00 2001
> > > > > > -From: Brett Warren <brett.warran@arm.com>
> > > > > > -Date: Thu, 8 Oct 2020 10:03:25 +0100
> > > > > > -Subject: [PATCH] make: remove -Wmissing-noreturn for clang
> > > > > > -
> > > > > > -When compiling when clang, -Wmissing-noreturn causes an error because
> > > > > > -of non-compliant code. This option is removed to workaround this.
> > > > > > -
> > > > > > -Upstream-Status: Pending [https://github.com/OP-TEE/optee_test/issues/452]
> > > > > > -Changed-Id: 71cb511904547d790d1ea98f93bf8e5a6afcb36d
> > > > > > -Signed-off-by: Brett Warren <brett.warren@arm.com>
> > > > > > ----
> > > > > > - host/xtest/Makefile | 2 +-
> > > > > > - 1 file changed, 1 insertion(+), 1 deletion(-)
> > > > > > -
> > > > > > -diff --git a/host/xtest/Makefile b/host/xtest/Makefile
> > > > > > -index 3c206b0..96746de 100644
> > > > > > ---- a/host/xtest/Makefile
> > > > > > -+++ b/host/xtest/Makefile
> > > > > > -@@ -169,7 +169,7 @@ CFLAGS += -Wall -Wcast-align -Werror \
> > > > > > -         -Werror-implicit-function-declaration -Wextra -Wfloat-equal \
> > > > > > -         -Wformat-nonliteral -Wformat-security -Wformat=2 -Winit-self \
> > > > > > -         -Wmissing-declarations -Wmissing-format-attribute \
> > > > > > --        -Wmissing-include-dirs -Wmissing-noreturn \
> > > > > > -+        -Wmissing-include-dirs \
> > > > > > -         -Wmissing-prototypes -Wnested-externs -Wpointer-arith \
> > > > > > -         -Wshadow -Wstrict-prototypes -Wswitch-default \
> > > > > > -         -Wwrite-strings \
> > > > > > ---
> > > > > > -2.17.1
> > > > > > -
> > > > > > diff --git a/meta-arm/recipes-security/optee/optee-test/0003-make-remove-Wmissing-noreturn-for-clang.patch b/meta-arm/recipes-security/optee/optee-test/0003-make-remove-Wmissing-noreturn-for-clang.patch
> > > > > > deleted file mode 100644
> > > > > > index bbc303f..0000000
> > > > > > --- a/meta-arm/recipes-security/optee/optee-test/0003-make-remove-Wmissing-noreturn-for-clang.patch
> > > > > > +++ /dev/null
> > > > > > @@ -1,31 +0,0 @@
> > > > > > -From ed5a9d9f7a3e9e14ca0e8aea59008124ee0e5f96 Mon Sep 17 00:00:00 2001
> > > > > > -From: Brett Warren <brett.warren@arm.com>
> > > > > > -Date: Thu, 8 Oct 2020 10:20:52 +0100
> > > > > > -Subject: [PATCH] make: remove -Wno-unsafe-loop for clang
> > > > > > -
> > > > > > -When compiling with clang, the -Wno-unsafe-loop-optimizations option
> > > > > > -throws an error because clang doesn't recognise it. This option is
> > > > > > -removed to workaround this.
> > > > > > -
> > > > > > -Upstream-Status: Pending [https://github.com/OP-TEE/optee_test/issues/452]
> > > > > > -Change-Id: 5fe0892c73208aaffac8c9995cb3275936fb1ba6
> > > > > > -Signed-off-by: Brett Warren <brett.warren@arm.com>
> > > > > > ----
> > > > > > - host/xtest/Makefile | 1 -
> > > > > > - 1 file changed, 1 deletion(-)
> > > > > > -
> > > > > > -diff --git a/host/xtest/Makefile b/host/xtest/Makefile
> > > > > > -index 96746de..73731d0 100644
> > > > > > ---- a/host/xtest/Makefile
> > > > > > -+++ b/host/xtest/Makefile
> > > > > > -@@ -174,7 +174,6 @@ CFLAGS += -Wall -Wcast-align -Werror \
> > > > > > -         -Wshadow -Wstrict-prototypes -Wswitch-default \
> > > > > > -         -Wwrite-strings \
> > > > > > -         -Wno-declaration-after-statement \
> > > > > > --        -Wno-unsafe-loop-optimizations \
> > > > > > -         -Wno-missing-field-initializers -Wno-format-zero-length
> > > > > > - endif
> > > > > > -
> > > > > > ---
> > > > > > -2.17.1
> > > > > > -
> > > > > > diff --git a/meta-arm/recipes-security/optee/optee-test_3.11.0.bb b/meta-arm/recipes-security/optee/optee-test_3.11.0.bb
> > > > > > deleted file mode 100644
> > > > > > index 0f8b5b0..0000000
> > > > > > --- a/meta-arm/recipes-security/optee/optee-test_3.11.0.bb
> > > > > > +++ /dev/null
> > > > > > @@ -1,3 +0,0 @@
> > > > > > -require optee-test.inc
> > > > > > -
> > > > > > -SRCREV = "159e295d5cc3ad2275ab15fe544620f6604d4ba4"
> > > > > > diff --git a/meta-arm/recipes-security/optee/optee-test_3.14.0.bb b/meta-arm/recipes-security/optee/optee-test_3.14.0.bb
> > > > > > new file mode 100644
> > > > > > index 0000000..6367c27
> > > > > > --- /dev/null
> > > > > > +++ b/meta-arm/recipes-security/optee/optee-test_3.14.0.bb
> > > > > > @@ -0,0 +1,3 @@
> > > > > > +require optee-test.inc
> > > > > > +
> > > > > > +SRCREV = "f2eb88affbb7f028561b4fd5cbd049d5d704f741"
> > > > > > --
> > > > > > 2.25.1
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > >
> > > > 
> > > >

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [meta-arm] [PATCH] arm/optee: version uplift 3.11.0 -> 3.14.0
  2021-07-27 12:22           ` Ross Burton
@ 2021-07-27 12:37             ` Sumit Garg
  0 siblings, 0 replies; 11+ messages in thread
From: Sumit Garg @ 2021-07-27 12:37 UTC (permalink / raw)
  To: Ross Burton; +Cc: Jon Mason, meta-arm, Jon Mason, Ross Burton

On Tue, 27 Jul 2021 at 17:52, Ross Burton <ross@burtonini.com> wrote:
>
> Yes, that was it.  == is a bashism, this line should use = instead:
>
> https://github.com/linaro-swg/optee_examples/blob/master/Makefile#L34

Thanks Ross for catching it, I will fix it up in v2.

>
> And a makefile that doesn't eat errors would be helpful too.
>

Agree, I will create a fix for upstream that should take care of this as well.

-Sumit

> Ross
>
> On Tue, 27 Jul 2021 at 13:18, Ross Burton <ross@burtonini.com> wrote:
> >
> > Ah, this might be the problem from log.do_compile:
> >
> > Copying example CA and TA binaries to
> > /yocto/ross/build/tmp/work/qemuarm64_secureboot-poky-linux/optee-examples/3.14.0-r0/build...
> > /bin/sh: 6: [: acipher: unexpected operator
> > /bin/sh: 6: [: plugins: unexpected operator
> > /bin/sh: 6: [: hello_world: unexpected operator
> > /bin/sh: 6: [: hotp: unexpected operator
> > /bin/sh: 6: [: aes: unexpected operator
> > /bin/sh: 6: [: random: unexpected operator
> > /bin/sh: 6: [: secure_storage: unexpected operator
> >
> > Ross
> >
> > On Tue, 27 Jul 2021 at 07:52, Sumit Garg <sumit.garg@linaro.org> wrote:
> > >
> > > Hi Jon,
> > >
> > > On Mon, 26 Jul 2021 at 19:31, Jon Mason <jdmason@kudzu.us> wrote:
> > > >
> > > > On Mon, Jul 26, 2021 at 3:10 AM Sumit Garg <sumit.garg@linaro.org> wrote:
> > > > >
> > > > > Hi Ross,
> > > > >
> > > > > On Sat, 24 Jul 2021 at 00:36, Ross Burton <ross@burtonini.com> wrote:
> > > > > >
> > > > > > The optee-examples recipe is broken:
> > > > > >
> > > > > > install: cannot stat
> > > > > > '/builds/engineering/yocto/meta-arm/work/build/tmp/work/qemuarm64_secureboot-poky-linux/optee-examples/3.14.0-r0/build/plugins/*':
> > > > > > No such file or directory
> > > > > >
> > > > > > (qemuarm64-secureboot can build it)
> > > > > >
> > > > >
> > > > > Strangely, it works fine for me when building for
> > > > > qemuarm64-secureboot. Can you check if the following patches have been
> > > > > correctly applied in the corresponding work directory?
> > > > >
> > > > >            file://0001-plugins-Honour-default-cross-compiler-environment-se.patch
> > > > > \
> > > > >            file://0002-Makefile-Enable-plugins-installation-in-rootfs.patch \
> > > >
> > > > I'm seeing the same issue Ross is describing.  I would expect a
> > > > warning or error if it couldn't find the patches while building, not
> > > > when installing.
> > >
> > > Yeah you are correct but I am not able to figure the reason for this behaviour.
> > >
> > > > Can you confirm you are building optee-examples, in
> > > > addition to core-image-minimal/base?
> > > > See https://gitlab.com/jonmason00/meta-arm/-/jobs/1444856281#L3594
> > > >
> > >
> > > Yeah I am building optee-examples in addition to core-image-minimal/base.
> > >
> > > - Changes to default poky conf/local.conf:
> > >
> > > MACHINE = "qemuarm64-secureboot"
> > > CORE_IMAGE_EXTRA_INSTALL += "optee-examples optee-test"
> > >
> > > - Changes to default poky conf/bblayers.conf with additional layers as:
> > >
> > > meta-arm/meta-arm-toolchain
> > > meta-arm/meta-arm
> > >
> > > Here is optee-examples build folder directory structure for me:
> > >
> > > $ tree tmp/work/qemuarm64_secureboot-poky-linux/optee-examples/3.14.0-r0/build/
> > > tmp/work/qemuarm64_secureboot-poky-linux/optee-examples/3.14.0-r0/build/
> > > ├── ca
> > > │   ├── optee_example_acipher
> > > │   ├── optee_example_aes
> > > │   ├── optee_example_hello_world
> > > │   ├── optee_example_hotp
> > > │   ├── optee_example_plugins
> > > │   ├── optee_example_random
> > > │   └── optee_example_secure_storage
> > > ├── plugins
> > > │   └── 96bcf744-4f72-4866-bf1d-8634fd9c65e5.plugin
> > > └── ta
> > >     ├── 2a287631-de1b-4fdd-a55c-b9312e40769a.ta
> > >     ├── 484d4143-2d53-4841-3120-4a6f636b6542.ta
> > >     ├── 5dbac793-f574-4871-8ad3-04331ec17f24.ta
> > >     ├── 8aaaf200-2450-11e4-abe2-0002a5d5c51b.ta
> > >     ├── a734eed9-d6a1-4244-aa50-7c99719e7b7b.ta
> > >     ├── b6c53aba-9669-4668-a7f2-205629d00f86.ta
> > >     └── f4e750bb-1437-4fbf-8785-8d3580c34994.ta
> > >
> > > 3 directories, 15 files
> > >
> > > > Looks to me like the issue is with newly added line
> > > > https://gitlab.com/jonmason00/meta-arm/-/blob/master-next/meta-arm/recipes-security/optee/optee-examples.inc#L39
> > > >
> > >
> > > Looks like this link is pointing to a line where OP-TEE uprev patch
> > > isn't applied. Were you referring to following line?
> > >
> > > +    install -D -p -m0444 ${B}/plugins/* ${D}${libdir}/tee-supplicant/plugins
> > >
> > > As evident from optee-examples build folder above, the plugins
> > > directory shouldn't be empty for a successful optee-examples build.
> > >
> > > -Sumit
> > >
> > > > Thanks,
> > > > Jon
> > > >
> > > > >
> > > > > -Sumit
> > > > >
> > > > > > Ross
> > > > > >
> > > > > > On Tue, 20 Jul 2021 at 11:07, Sumit Garg <sumit.garg@linaro.org> wrote:
> > > > > > >
> > > > > > > Brief description of changes:
> > > > > > > - Version uplift 3.11.0 -> 3.14.0.
> > > > > > > - Removed OP-TEE patches that has already been accepted upstream.
> > > > > > > - Added support for tee-supplicant plugin framework testing.
> > > > > > >
> > > > > > > Tested on qemuarm64_secureboot:
> > > > > > > $ xtest -l 15
> > > > > > > $ optee-examples_*
> > > > > > >
> > > > > > > Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
> > > > > > > ---
> > > > > > >  .../optee/optee-client_3.11.0.bb              |   3 -
> > > > > > >  .../optee/optee-client_3.14.0.bb              |   3 +
> > > > > > >  .../recipes-security/optee/optee-examples.inc |   9 +-
> > > > > > >  .../0001-make-Pass-ldflags-during-link.patch  | 103 ------------------
> > > > > > >  ...efault-cross-compiler-environment-se.patch |  84 ++++++++++++++
> > > > > > >  ...nable-plugins-installation-in-rootfs.patch |  39 +++++++
> > > > > > >  .../optee/optee-examples_3.11.0.bb            |   4 -
> > > > > > >  .../optee/optee-examples_3.14.0.bb            |   4 +
> > > > > > >  ...ide-empty-__getauxval-implementation.patch |  62 -----------
> > > > > > >  ...t-support-for-libnames-after-libgcc-.patch |  55 ----------
> > > > > > >  ...ke-sure-that-libutils-is-linked-seco.patch |  44 --------
> > > > > > >  .../recipes-security/optee/optee-os_3.11.0.bb |  11 --
> > > > > > >  .../recipes-security/optee/optee-os_3.14.0.bb |   8 ++
> > > > > > >  .../recipes-security/optee/optee-test.inc     |  15 +--
> > > > > > >  ...Adjust-order-of-including-compiler.h.patch |  64 -----------
> > > > > > >  ...ake-remove-Wno-unsafe-loop-for-clang.patch |  31 ------
> > > > > > >  ...e-remove-Wmissing-noreturn-for-clang.patch |  31 ------
> > > > > > >  .../optee/optee-test_3.11.0.bb                |   3 -
> > > > > > >  .../optee/optee-test_3.14.0.bb                |   3 +
> > > > > > >  19 files changed, 154 insertions(+), 422 deletions(-)
> > > > > > >  delete mode 100644 meta-arm/recipes-security/optee/optee-client_3.11.0.bb
> > > > > > >  create mode 100644 meta-arm/recipes-security/optee/optee-client_3.14.0.bb
> > > > > > >  delete mode 100644 meta-arm/recipes-security/optee/optee-examples/0001-make-Pass-ldflags-during-link.patch
> > > > > > >  create mode 100644 meta-arm/recipes-security/optee/optee-examples/0001-plugins-Honour-default-cross-compiler-environment-se.patch
> > > > > > >  create mode 100644 meta-arm/recipes-security/optee/optee-examples/0002-Makefile-Enable-plugins-installation-in-rootfs.patch
> > > > > > >  delete mode 100644 meta-arm/recipes-security/optee/optee-examples_3.11.0.bb
> > > > > > >  create mode 100644 meta-arm/recipes-security/optee/optee-examples_3.14.0.bb
> > > > > > >  delete mode 100644 meta-arm/recipes-security/optee/optee-os/0001-libutils-provide-empty-__getauxval-implementation.patch
> > > > > > >  delete mode 100644 meta-arm/recipes-security/optee/optee-os/0002-link.mk-implement-support-for-libnames-after-libgcc-.patch
> > > > > > >  delete mode 100644 meta-arm/recipes-security/optee/optee-os/0003-ta_dev_kit.mk-make-sure-that-libutils-is-linked-seco.patch
> > > > > > >  delete mode 100644 meta-arm/recipes-security/optee/optee-os_3.11.0.bb
> > > > > > >  create mode 100644 meta-arm/recipes-security/optee/optee-os_3.14.0.bb
> > > > > > >  delete mode 100644 meta-arm/recipes-security/optee/optee-test/0001-host-xtest-Adjust-order-of-including-compiler.h.patch
> > > > > > >  delete mode 100644 meta-arm/recipes-security/optee/optee-test/0002-make-remove-Wno-unsafe-loop-for-clang.patch
> > > > > > >  delete mode 100644 meta-arm/recipes-security/optee/optee-test/0003-make-remove-Wmissing-noreturn-for-clang.patch
> > > > > > >  delete mode 100644 meta-arm/recipes-security/optee/optee-test_3.11.0.bb
> > > > > > >  create mode 100644 meta-arm/recipes-security/optee/optee-test_3.14.0.bb
> > > > > > >
> > > > > > > diff --git a/meta-arm/recipes-security/optee/optee-client_3.11.0.bb b/meta-arm/recipes-security/optee/optee-client_3.11.0.bb
> > > > > > > deleted file mode 100644
> > > > > > > index f765d12..0000000
> > > > > > > --- a/meta-arm/recipes-security/optee/optee-client_3.11.0.bb
> > > > > > > +++ /dev/null
> > > > > > > @@ -1,3 +0,0 @@
> > > > > > > -require optee-client.inc
> > > > > > > -
> > > > > > > -SRCREV = "c0c925384c1d7e3558d27d2708857482952d7907"
> > > > > > > diff --git a/meta-arm/recipes-security/optee/optee-client_3.14.0.bb b/meta-arm/recipes-security/optee/optee-client_3.14.0.bb
> > > > > > > new file mode 100644
> > > > > > > index 0000000..be78b88
> > > > > > > --- /dev/null
> > > > > > > +++ b/meta-arm/recipes-security/optee/optee-client_3.14.0.bb
> > > > > > > @@ -0,0 +1,3 @@
> > > > > > > +require optee-client.inc
> > > > > > > +
> > > > > > > +SRCREV = "06e1b32f6a7028e039c625b07cfc25fda0c17d53"
> > > > > > > diff --git a/meta-arm/recipes-security/optee/optee-examples.inc b/meta-arm/recipes-security/optee/optee-examples.inc
> > > > > > > index 81c31bc..f2e53f3 100644
> > > > > > > --- a/meta-arm/recipes-security/optee/optee-examples.inc
> > > > > > > +++ b/meta-arm/recipes-security/optee/optee-examples.inc
> > > > > > > @@ -12,7 +12,8 @@ inherit python3native
> > > > > > >  require optee.inc
> > > > > > >
> > > > > > >  SRC_URI = "git://github.com/linaro-swg/optee_examples.git \
> > > > > > > -           file://0001-make-Pass-ldflags-during-link.patch \
> > > > > > > +           file://0001-plugins-Honour-default-cross-compiler-environment-se.patch \
> > > > > > > +           file://0002-Makefile-Enable-plugins-installation-in-rootfs.patch \
> > > > > > >            "
> > > > > > >
> > > > > > >  EXTRA_OEMAKE += "TA_DEV_KIT_DIR=${TA_DEV_KIT_DIR} \
> > > > > > > @@ -32,11 +33,15 @@ do_compile[cleandirs] = "${B}"
> > > > > > >  do_install () {
> > > > > > >      mkdir -p ${D}${nonarch_base_libdir}/optee_armtz
> > > > > > >      mkdir -p ${D}${bindir}
> > > > > > > +    mkdir -p ${D}${libdir}/tee-supplicant/plugins
> > > > > > >      install -D -p -m0755 ${B}/ca/* ${D}${bindir}
> > > > > > >      install -D -p -m0444 ${B}/ta/* ${D}${nonarch_base_libdir}/optee_armtz
> > > > > > > +    install -D -p -m0444 ${B}/plugins/* ${D}${libdir}/tee-supplicant/plugins
> > > > > > >  }
> > > > > > >
> > > > > > > -FILES_${PN} += "${nonarch_base_libdir}/optee_armtz/"
> > > > > > > +FILES_${PN} += "${nonarch_base_libdir}/optee_armtz/ \
> > > > > > > +                ${libdir}/tee-supplicant/plugins/ \
> > > > > > > +               "
> > > > > > >
> > > > > > >  # Imports machine specific configs from staging to build
> > > > > > >  PACKAGE_ARCH = "${MACHINE_ARCH}"
> > > > > > > diff --git a/meta-arm/recipes-security/optee/optee-examples/0001-make-Pass-ldflags-during-link.patch b/meta-arm/recipes-security/optee/optee-examples/0001-make-Pass-ldflags-during-link.patch
> > > > > > > deleted file mode 100644
> > > > > > > index 84202ef..0000000
> > > > > > > --- a/meta-arm/recipes-security/optee/optee-examples/0001-make-Pass-ldflags-during-link.patch
> > > > > > > +++ /dev/null
> > > > > > > @@ -1,103 +0,0 @@
> > > > > > > -From 29ae21de41f2fbab6dbecbbf408826b28de82df1 Mon Sep 17 00:00:00 2001
> > > > > > > -From: Khem Raj <raj.khem@gmail.com>
> > > > > > > -Date: Tue, 1 Sep 2020 21:09:56 -0700
> > > > > > > -Subject: [PATCH] make: Pass ldflags during link
> > > > > > > -
> > > > > > > -OpenEmbeeded needs to pass essential linker flags to set correct flags
> > > > > > > -for gnu_hash among others which sets the linking straight
> > > > > > > -using LDFLAGS varible here means, we can affect the linker flags
> > > > > > > -from build environment
> > > > > > > -
> > > > > > > -Upstream-Status: Submitted [https://github.com/linaro-swg/optee_examples/pull/85]
> > > > > > > -
> > > > > > > -Signed-off-by: Khem Raj <raj.khem@gmail.com>
> > > > > > > ----
> > > > > > > - acipher/host/Makefile        | 2 +-
> > > > > > > - aes/host/Makefile            | 2 +-
> > > > > > > - hello_world/host/Makefile    | 2 +-
> > > > > > > - hotp/host/Makefile           | 2 +-
> > > > > > > - random/host/Makefile         | 2 +-
> > > > > > > - secure_storage/host/Makefile | 2 +-
> > > > > > > - 6 files changed, 6 insertions(+), 6 deletions(-)
> > > > > > > -
> > > > > > > -diff --git a/acipher/host/Makefile b/acipher/host/Makefile
> > > > > > > -index 8f4bc8a..c2cabef 100644
> > > > > > > ---- a/acipher/host/Makefile
> > > > > > > -+++ b/acipher/host/Makefile
> > > > > > > -@@ -18,7 +18,7 @@ BINARY = optee_example_acipher
> > > > > > > - all: $(BINARY)
> > > > > > > -
> > > > > > > - $(BINARY): $(OBJS)
> > > > > > > --      $(CC) -o $@ $< $(LDADD)
> > > > > > > -+      $(CC) -o $@ $< $(LDFLAGS) $(LDADD)
> > > > > > > -
> > > > > > > - .PHONY: clean
> > > > > > > - clean:
> > > > > > > -diff --git a/aes/host/Makefile b/aes/host/Makefile
> > > > > > > -index dfeb4e8..f61c71b 100644
> > > > > > > ---- a/aes/host/Makefile
> > > > > > > -+++ b/aes/host/Makefile
> > > > > > > -@@ -18,7 +18,7 @@ BINARY = optee_example_aes
> > > > > > > - all: $(BINARY)
> > > > > > > -
> > > > > > > - $(BINARY): $(OBJS)
> > > > > > > --      $(CC) -o $@ $< $(LDADD)
> > > > > > > -+      $(CC) -o $@ $< $(LDFLAGS) $(LDADD)
> > > > > > > -
> > > > > > > - .PHONY: clean
> > > > > > > - clean:
> > > > > > > -diff --git a/hello_world/host/Makefile b/hello_world/host/Makefile
> > > > > > > -index c4c8239..69cf42c 100644
> > > > > > > ---- a/hello_world/host/Makefile
> > > > > > > -+++ b/hello_world/host/Makefile
> > > > > > > -@@ -18,7 +18,7 @@ BINARY = optee_example_hello_world
> > > > > > > - all: $(BINARY)
> > > > > > > -
> > > > > > > - $(BINARY): $(OBJS)
> > > > > > > --      $(CC) -o $@ $< $(LDADD)
> > > > > > > -+      $(CC) -o $@ $< $(LDFLAGS) $(LDADD)
> > > > > > > -
> > > > > > > - .PHONY: clean
> > > > > > > - clean:
> > > > > > > -diff --git a/hotp/host/Makefile b/hotp/host/Makefile
> > > > > > > -index cb7fd19..e7f013f 100644
> > > > > > > ---- a/hotp/host/Makefile
> > > > > > > -+++ b/hotp/host/Makefile
> > > > > > > -@@ -18,7 +18,7 @@ BINARY = optee_example_hotp
> > > > > > > - all: $(BINARY)
> > > > > > > -
> > > > > > > - $(BINARY): $(OBJS)
> > > > > > > --      $(CC) -o $@ $< $(LDADD)
> > > > > > > -+      $(CC) -o $@ $< $(LDFLAGS) $(LDADD)
> > > > > > > -
> > > > > > > - .PHONY: clean
> > > > > > > - clean:
> > > > > > > -diff --git a/random/host/Makefile b/random/host/Makefile
> > > > > > > -index fd407d9..9377f7a 100644
> > > > > > > ---- a/random/host/Makefile
> > > > > > > -+++ b/random/host/Makefile
> > > > > > > -@@ -18,7 +18,7 @@ BINARY = optee_example_random
> > > > > > > - all: $(BINARY)
> > > > > > > -
> > > > > > > - $(BINARY): $(OBJS)
> > > > > > > --      $(CC) -o $@ $< $(LDADD)
> > > > > > > -+      $(CC) -o $@ $< $(LDFLAGS) $(LDADD)
> > > > > > > -
> > > > > > > - .PHONY: clean
> > > > > > > - clean:
> > > > > > > -diff --git a/secure_storage/host/Makefile b/secure_storage/host/Makefile
> > > > > > > -index 29bfb87..b3265ae 100644
> > > > > > > ---- a/secure_storage/host/Makefile
> > > > > > > -+++ b/secure_storage/host/Makefile
> > > > > > > -@@ -18,7 +18,7 @@ BINARY = optee_example_secure_storage
> > > > > > > - all: $(BINARY)
> > > > > > > -
> > > > > > > - $(BINARY): $(OBJS)
> > > > > > > --      $(CC) -o $@ $< $(LDADD)
> > > > > > > -+      $(CC) -o $@ $< $(LDFLAGS) $(LDADD)
> > > > > > > -
> > > > > > > - .PHONY: clean
> > > > > > > - clean:
> > > > > > > ---
> > > > > > > -2.28.0
> > > > > > > -
> > > > > > > diff --git a/meta-arm/recipes-security/optee/optee-examples/0001-plugins-Honour-default-cross-compiler-environment-se.patch b/meta-arm/recipes-security/optee/optee-examples/0001-plugins-Honour-default-cross-compiler-environment-se.patch
> > > > > > > new file mode 100644
> > > > > > > index 0000000..033e48c
> > > > > > > --- /dev/null
> > > > > > > +++ b/meta-arm/recipes-security/optee/optee-examples/0001-plugins-Honour-default-cross-compiler-environment-se.patch
> > > > > > > @@ -0,0 +1,84 @@
> > > > > > > +From 79c826c249001700007a6dffe80c3d61ff4428ef Mon Sep 17 00:00:00 2001
> > > > > > > +From: Sumit Garg <sumit.garg@linaro.org>
> > > > > > > +Date: Tue, 20 Jul 2021 13:54:30 +0530
> > > > > > > +Subject: [PATCH 1/2] plugins: Honour default cross compiler environment setup
> > > > > > > +
> > > > > > > +Honour default $(CC), $(CFLAGS) and $(LDFLAGS) variables. Without this
> > > > > > > +plugins example fails to build for OE/Yocto.
> > > > > > > +
> > > > > > > +Upstream-Status: Submitted [https://github.com/linaro-swg/optee_examples/pull/87]
> > > > > > > +
> > > > > > > +Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
> > > > > > > +---
> > > > > > > + plugins/Makefile        |  2 +-
> > > > > > > + plugins/host/Makefile   |  2 +-
> > > > > > > + plugins/syslog/Makefile | 16 ++++++++++++----
> > > > > > > + 3 files changed, 14 insertions(+), 6 deletions(-)
> > > > > > > +
> > > > > > > +diff --git a/plugins/Makefile b/plugins/Makefile
> > > > > > > +index 2372b38..ea472b4 100644
> > > > > > > +--- a/plugins/Makefile
> > > > > > > ++++ b/plugins/Makefile
> > > > > > > +@@ -8,7 +8,7 @@ TA_CROSS_COMPILE ?= $(CROSS_COMPILE)
> > > > > > > + all:
> > > > > > > +       $(MAKE) -C host CROSS_COMPILE="$(HOST_CROSS_COMPILE)" --no-builtin-variables
> > > > > > > +       $(MAKE) -C ta CROSS_COMPILE="$(TA_CROSS_COMPILE)" LDFLAGS=""
> > > > > > > +-      $(MAKE) -C syslog CROSS_COMPILE="$(HOST_CROSS_COMPILE)"
> > > > > > > ++      $(MAKE) -C syslog CROSS_COMPILE="$(HOST_CROSS_COMPILE)" --no-builtin-variables
> > > > > > > +
> > > > > > > + .PHONY: clean
> > > > > > > + clean:
> > > > > > > +diff --git a/plugins/host/Makefile b/plugins/host/Makefile
> > > > > > > +index 7285104..76244c7 100644
> > > > > > > +--- a/plugins/host/Makefile
> > > > > > > ++++ b/plugins/host/Makefile
> > > > > > > +@@ -20,7 +20,7 @@ BINARY = optee_example_plugins
> > > > > > > + all: $(BINARY)
> > > > > > > +
> > > > > > > + $(BINARY): $(OBJS)
> > > > > > > +-      $(CC) -o $@ $< $(LDADD)
> > > > > > > ++      $(CC) $(LDFLAGS) -o $@ $< $(LDADD)
> > > > > > > +
> > > > > > > + .PHONY: clean
> > > > > > > + clean:
> > > > > > > +diff --git a/plugins/syslog/Makefile b/plugins/syslog/Makefile
> > > > > > > +index 62d916a..71f5f92 100644
> > > > > > > +--- a/plugins/syslog/Makefile
> > > > > > > ++++ b/plugins/syslog/Makefile
> > > > > > > +@@ -1,3 +1,11 @@
> > > > > > > ++CC      ?= $(CROSS_COMPILE)gcc
> > > > > > > ++LD      ?= $(CROSS_COMPILE)ld
> > > > > > > ++AR      ?= $(CROSS_COMPILE)ar
> > > > > > > ++NM      ?= $(CROSS_COMPILE)nm
> > > > > > > ++OBJCOPY ?= $(CROSS_COMPILE)objcopy
> > > > > > > ++OBJDUMP ?= $(CROSS_COMPILE)objdump
> > > > > > > ++READELF ?= $(CROSS_COMPILE)readelf
> > > > > > > ++
> > > > > > > + PLUGIN_UUID = 96bcf744-4f72-4866-bf1d-8634fd9c65e5
> > > > > > > +
> > > > > > > + PLUGIN                        = $(PLUGIN_UUID).plugin
> > > > > > > +@@ -6,17 +14,17 @@ PLUGIN_OBJ          = $(patsubst %.c, %.o, $(PLUGIN_SRS))
> > > > > > > + PLUGIN_INCLUDES_DIR   = $(CURDIR) $(TEEC_EXPORT)/include
> > > > > > > +
> > > > > > > + PLUGIN_INCLUDES               = $(addprefix -I, $(PLUGIN_INCLUDES_DIR))
> > > > > > > +-PLUGIN_CCFLAGS                = -Wall -fPIC
> > > > > > > +-PLUGIN_LDFLAGS                = -shared
> > > > > > > ++PLUGIN_CCFLAGS                = $(CFLAGS) -Wall -fPIC
> > > > > > > ++PLUGIN_LDFLAGS                = $(LDFLAGS) -shared
> > > > > > > +
> > > > > > > + .PHONY: all
> > > > > > > + all: $(PLUGIN)
> > > > > > > +
> > > > > > > + $(PLUGIN): $(PLUGIN_OBJ)
> > > > > > > +-      $(CROSS_COMPILE)gcc $(PLUGIN_LDFLAGS) $(PLUGIN_OBJ) -o $@
> > > > > > > ++      $(CC) $(PLUGIN_LDFLAGS) $(PLUGIN_OBJ) -o $@
> > > > > > > +
> > > > > > > + %.o: %.c
> > > > > > > +-      $(CROSS_COMPILE)gcc $(PLUGIN_CCFLAGS) $(PLUGIN_INCLUDES) -c $*.c -o $*.o
> > > > > > > ++      $(CC) $(PLUGIN_CCFLAGS) $(PLUGIN_INCLUDES) -c $*.c -o $*.o
> > > > > > > +
> > > > > > > + .PHONY: clean
> > > > > > > + clean:
> > > > > > > +--
> > > > > > > +2.25.1
> > > > > > > +
> > > > > > > diff --git a/meta-arm/recipes-security/optee/optee-examples/0002-Makefile-Enable-plugins-installation-in-rootfs.patch b/meta-arm/recipes-security/optee/optee-examples/0002-Makefile-Enable-plugins-installation-in-rootfs.patch
> > > > > > > new file mode 100644
> > > > > > > index 0000000..8d1d60a
> > > > > > > --- /dev/null
> > > > > > > +++ b/meta-arm/recipes-security/optee/optee-examples/0002-Makefile-Enable-plugins-installation-in-rootfs.patch
> > > > > > > @@ -0,0 +1,39 @@
> > > > > > > +From a865f2e25e178fc2c4617eb1faf79ac922d02ffd Mon Sep 17 00:00:00 2001
> > > > > > > +From: Sumit Garg <sumit.garg@linaro.org>
> > > > > > > +Date: Tue, 20 Jul 2021 14:20:10 +0530
> > > > > > > +Subject: [PATCH 2/2] Makefile: Enable plugins installation in rootfs
> > > > > > > +
> > > > > > > +Upstream-Status: Submitted [https://github.com/linaro-swg/optee_examples/pull/87]
> > > > > > > +
> > > > > > > +Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
> > > > > > > +---
> > > > > > > + Makefile | 5 +++++
> > > > > > > + 1 file changed, 5 insertions(+)
> > > > > > > +
> > > > > > > +diff --git a/Makefile b/Makefile
> > > > > > > +index a275842..b3f16aa 100644
> > > > > > > +--- a/Makefile
> > > > > > > ++++ b/Makefile
> > > > > > > +@@ -25,14 +25,19 @@ prepare-for-rootfs: examples
> > > > > > > +       @mkdir -p $(OUTPUT_DIR)
> > > > > > > +       @mkdir -p $(OUTPUT_DIR)/ta
> > > > > > > +       @mkdir -p $(OUTPUT_DIR)/ca
> > > > > > > ++      @mkdir -p $(OUTPUT_DIR)/plugins
> > > > > > > +       @for example in $(EXAMPLE_LIST); do \
> > > > > > > +               if [ -e $$example/host/optee_example_$$example ]; then \
> > > > > > > +                       cp -p $$example/host/optee_example_$$example $(OUTPUT_DIR)/ca/; \
> > > > > > > +               fi; \
> > > > > > > +               cp -pr $$example/ta/*.ta $(OUTPUT_DIR)/ta/; \
> > > > > > > ++              if [ $$example == plugins ]; then \
> > > > > > > ++                      cp -p plugins/syslog/*.plugin $(OUTPUT_DIR)/plugins/; \
> > > > > > > ++              fi; \
> > > > > > > +       done
> > > > > > > +
> > > > > > > + prepare-for-rootfs-clean:
> > > > > > > +       @rm -rf $(OUTPUT_DIR)/ta
> > > > > > > +       @rm -rf $(OUTPUT_DIR)/ca
> > > > > > > ++      @rm -rf $(OUTPUT_DIR)/plugins
> > > > > > > +       @rmdir --ignore-fail-on-non-empty $(OUTPUT_DIR) || test ! -e $(OUTPUT_DIR)
> > > > > > > +--
> > > > > > > +2.25.1
> > > > > > > +
> > > > > > > diff --git a/meta-arm/recipes-security/optee/optee-examples_3.11.0.bb b/meta-arm/recipes-security/optee/optee-examples_3.11.0.bb
> > > > > > > deleted file mode 100644
> > > > > > > index 72473ed..0000000
> > > > > > > --- a/meta-arm/recipes-security/optee/optee-examples_3.11.0.bb
> > > > > > > +++ /dev/null
> > > > > > > @@ -1,4 +0,0 @@
> > > > > > > -require optee-examples.inc
> > > > > > > -
> > > > > > > -SRCREV = "9a7dc598591990349d88b4dba3a37aadd6851295"
> > > > > > > -
> > > > > > > diff --git a/meta-arm/recipes-security/optee/optee-examples_3.14.0.bb b/meta-arm/recipes-security/optee/optee-examples_3.14.0.bb
> > > > > > > new file mode 100644
> > > > > > > index 0000000..f2b5f7d
> > > > > > > --- /dev/null
> > > > > > > +++ b/meta-arm/recipes-security/optee/optee-examples_3.14.0.bb
> > > > > > > @@ -0,0 +1,4 @@
> > > > > > > +require optee-examples.inc
> > > > > > > +
> > > > > > > +SRCREV = "e9c870525af8f7e7fccf575a0ca5394ce55adcec"
> > > > > > > +
> > > > > > > diff --git a/meta-arm/recipes-security/optee/optee-os/0001-libutils-provide-empty-__getauxval-implementation.patch b/meta-arm/recipes-security/optee/optee-os/0001-libutils-provide-empty-__getauxval-implementation.patch
> > > > > > > deleted file mode 100644
> > > > > > > index 0120f5c..0000000
> > > > > > > --- a/meta-arm/recipes-security/optee/optee-os/0001-libutils-provide-empty-__getauxval-implementation.patch
> > > > > > > +++ /dev/null
> > > > > > > @@ -1,62 +0,0 @@
> > > > > > > -Upstream-Status: Backport
> > > > > > > -Signed-off-by: Ross Burton <ross.burton@arm.com>
> > > > > > > -
> > > > > > > -From 36e784f621bf5d5be9183beba35f39426277c110 Mon Sep 17 00:00:00 2001
> > > > > > > -From: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
> > > > > > > -Date: Tue, 13 Oct 2020 22:45:39 +0300
> > > > > > > -Subject: [PATCH 1/3] libutils: provide empty __getauxval() implementation
> > > > > > > -
> > > > > > > -Never version of libgcc are built with LSE implementation in mind. To
> > > > > > > -determine if LSE is available on platform it calls __getauxval(), so in
> > > > > > > -some cases we can get undefined reference to __getauxval() error.
> > > > > > > -
> > > > > > > -Prominent case is libgcc_eh.a library, which is used by C++ TAs. Exception
> > > > > > > -handler depends on atomic operations, so it tries to call
> > > > > > > -init_have_lse_atomics() first. This function in turn calls __getauxval(),
> > > > > > > -which causes linking error.
> > > > > > > -
> > > > > > > -In the future we can make __getauxval() to return actual platform
> > > > > > > -capabilities.
> > > > > > > -
> > > > > > > -Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
> > > > > > > -Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
> > > > > > > -Reviewed-by: Jerome Forissier <jerome@forissier.org>
> > > > > > > ----
> > > > > > > - lib/libutils/ext/arch/arm/auxval.c | 12 ++++++++++++
> > > > > > > - lib/libutils/ext/arch/arm/sub.mk   |  1 +
> > > > > > > - 2 files changed, 13 insertions(+)
> > > > > > > - create mode 100644 lib/libutils/ext/arch/arm/auxval.c
> > > > > > > -
> > > > > > > -diff --git a/lib/libutils/ext/arch/arm/auxval.c b/lib/libutils/ext/arch/arm/auxval.c
> > > > > > > -new file mode 100644
> > > > > > > -index 00000000..98bca850
> > > > > > > ---- /dev/null
> > > > > > > -+++ b/lib/libutils/ext/arch/arm/auxval.c
> > > > > > > -@@ -0,0 +1,12 @@
> > > > > > > -+// SPDX-License-Identifier: BSD-2-Clause
> > > > > > > -+/*
> > > > > > > -+ * Copyright (c) 2020, EPAM Systems
> > > > > > > -+ */
> > > > > > > -+
> > > > > > > -+#include <compiler.h>
> > > > > > > -+
> > > > > > > -+unsigned long int __getauxval (unsigned long int type);
> > > > > > > -+unsigned long int __getauxval (unsigned long int type __unused)
> > > > > > > -+{
> > > > > > > -+      return 0;
> > > > > > > -+}
> > > > > > > -diff --git a/lib/libutils/ext/arch/arm/sub.mk b/lib/libutils/ext/arch/arm/sub.mk
> > > > > > > -index dc5eed67..2e779066 100644
> > > > > > > ---- a/lib/libutils/ext/arch/arm/sub.mk
> > > > > > > -+++ b/lib/libutils/ext/arch/arm/sub.mk
> > > > > > > -@@ -3,6 +3,7 @@ srcs-$(CFG_ARM32_$(sm)) += aeabi_unwind.c
> > > > > > > - endif
> > > > > > > - srcs-$(CFG_ARM32_$(sm)) += atomic_a32.S
> > > > > > > - srcs-$(CFG_ARM64_$(sm)) += atomic_a64.S
> > > > > > > -+srcs-y += auxval.c
> > > > > > > - ifneq ($(sm),ldelf) # TA, core
> > > > > > > - srcs-$(CFG_ARM32_$(sm)) += mcount_a32.S
> > > > > > > - srcs-$(CFG_ARM64_$(sm)) += mcount_a64.S
> > > > > > > ---
> > > > > > > -2.25.1
> > > > > > > -
> > > > > > > diff --git a/meta-arm/recipes-security/optee/optee-os/0002-link.mk-implement-support-for-libnames-after-libgcc-.patch b/meta-arm/recipes-security/optee/optee-os/0002-link.mk-implement-support-for-libnames-after-libgcc-.patch
> > > > > > > deleted file mode 100644
> > > > > > > index 11296c8..0000000
> > > > > > > --- a/meta-arm/recipes-security/optee/optee-os/0002-link.mk-implement-support-for-libnames-after-libgcc-.patch
> > > > > > > +++ /dev/null
> > > > > > > @@ -1,55 +0,0 @@
> > > > > > > -Upstream-Status: Backport
> > > > > > > -Signed-off-by: Ross Burton <ross.burton@arm.com>
> > > > > > > -
> > > > > > > -From 73196b58ea6978ffa5e581738030f51c5789ef73 Mon Sep 17 00:00:00 2001
> > > > > > > -From: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
> > > > > > > -Date: Tue, 13 Oct 2020 22:54:13 +0300
> > > > > > > -Subject: [PATCH 2/3] link.mk: implement support for libnames-after-libgcc
> > > > > > > - variable
> > > > > > > -
> > > > > > > -Newer versions of libgcc depend on external __getauxval() symbol, which is
> > > > > > > -now provided by libutils. But libgcc is linked after libutils, so linker
> > > > > > > -can't resolve that symbol. We can't include libgcc into linking group with
> > > > > > > -libtutils, because libgcc provides symbols that conflict with libutil's
> > > > > > > -ones, like __aeabi_idiv with friends for instance.
> > > > > > > -
> > > > > > > -So, to resolve libgcc dependency on libutils we need to link with libutils
> > > > > > > -second time. To make things more generic, we will introduce
> > > > > > > -$(libnames-after-libgcc) variable for libraries that should be linked after
> > > > > > > -libgcc.
> > > > > > > -
> > > > > > > -Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
> > > > > > > -Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
> > > > > > > -Reviewed-by: Jerome Forissier <jerome@forissier.org>
> > > > > > > ----
> > > > > > > - ta/arch/arm/link.mk | 6 +++++-
> > > > > > > - 1 file changed, 5 insertions(+), 1 deletion(-)
> > > > > > > -
> > > > > > > -diff --git a/ta/arch/arm/link.mk b/ta/arch/arm/link.mk
> > > > > > > -index 445c285d..3025acb1 100644
> > > > > > > ---- a/ta/arch/arm/link.mk
> > > > > > > -+++ b/ta/arch/arm/link.mk
> > > > > > > -@@ -55,8 +55,11 @@ link-ldflags += --eh-frame-hdr
> > > > > > > - link-ldadd += $(libstdc++$(sm)) $(libgcc_eh$(sm))
> > > > > > > - endif
> > > > > > > - link-ldadd += --end-group
> > > > > > > --ldargs-$(user-ta-uuid).elf := $(link-ldflags) $(objs) $(link-ldadd) $(libgcc$(sm))
> > > > > > > -
> > > > > > > -+link-ldadd-after-libgcc += $(addprefix -l,$(libnames-after-libgcc))
> > > > > > > -+
> > > > > > > -+ldargs-$(user-ta-uuid).elf := $(link-ldflags) $(objs) $(link-ldadd) \
> > > > > > > -+                              $(libgcc$(sm)) $(link-ldadd-after-libgcc)
> > > > > > > -
> > > > > > > - link-script-cppflags-$(sm) := \
> > > > > > > -       $(filter-out $(CPPFLAGS_REMOVE) $(cppflags-remove), \
> > > > > > > -@@ -76,6 +79,7 @@ $(link-script-pp$(sm)): $(link-script$(sm)) $(conf-file) $(link-script-pp-makefi
> > > > > > > -               $(link-script-cppflags-$(sm)) $$< -o $$@
> > > > > > > -
> > > > > > > - $(link-out-dir$(sm))/$(user-ta-uuid).elf: $(objs) $(libdeps) \
> > > > > > > -+                                        $(libdeps-after-libgcc) \
> > > > > > > -                                         $(link-script-pp$(sm)) \
> > > > > > > -                                         $(dynlistdep) \
> > > > > > > -                                         $(additional-link-deps)
> > > > > > > ---
> > > > > > > -2.25.1
> > > > > > > -
> > > > > > > diff --git a/meta-arm/recipes-security/optee/optee-os/0003-ta_dev_kit.mk-make-sure-that-libutils-is-linked-seco.patch b/meta-arm/recipes-security/optee/optee-os/0003-ta_dev_kit.mk-make-sure-that-libutils-is-linked-seco.patch
> > > > > > > deleted file mode 100644
> > > > > > > index 88ba5f8..0000000
> > > > > > > --- a/meta-arm/recipes-security/optee/optee-os/0003-ta_dev_kit.mk-make-sure-that-libutils-is-linked-seco.patch
> > > > > > > +++ /dev/null
> > > > > > > @@ -1,44 +0,0 @@
> > > > > > > -Upstream-Status: Backport
> > > > > > > -Signed-off-by: Ross Burton <ross.burton@arm.com>
> > > > > > > -
> > > > > > > -From f50962e3f56f0932662b2ffa10afe53339a335dd Mon Sep 17 00:00:00 2001
> > > > > > > -From: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
> > > > > > > -Date: Fri, 16 Oct 2020 16:36:08 +0300
> > > > > > > -Subject: [PATCH 3/3] ta_dev_kit.mk: make sure that libutils is linked second
> > > > > > > - time
> > > > > > > -
> > > > > > > -libgcc depends on __getauxval symbol from libuils. As, generally libutils
> > > > > > > -is linked before libgcc, we will get "unresolved symbol" error. To resolve
> > > > > > > -this dependency we need to link libutils second time - after libgcc.
> > > > > > > -
> > > > > > > -Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
> > > > > > > -Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
> > > > > > > -Reviewed-by: Jerome Forissier <jerome@forissier.org>
> > > > > > > ----
> > > > > > > - ta/mk/ta_dev_kit.mk | 10 ++++++++++
> > > > > > > - 1 file changed, 10 insertions(+)
> > > > > > > -
> > > > > > > -diff --git a/ta/mk/ta_dev_kit.mk b/ta/mk/ta_dev_kit.mk
> > > > > > > -index e28be677..d0e66317 100644
> > > > > > > ---- a/ta/mk/ta_dev_kit.mk
> > > > > > > -+++ b/ta/mk/ta_dev_kit.mk
> > > > > > > -@@ -78,6 +78,16 @@ endif
> > > > > > > - libnames += dl
> > > > > > > - libdeps += $(ta-dev-kit-dir$(sm))/lib/libdl.a
> > > > > > > -
> > > > > > > -+# libutils provides __getauxval symbol which is needed by libgcc 10.x. We can't
> > > > > > > -+# link libutils after libgcc, because libgcc will replace some symbols provided
> > > > > > > -+# by libutils, which will cause further linking issues.
> > > > > > > -+#
> > > > > > > -+# But if we place libutils before libgcc, linker will not be able to resolve
> > > > > > > -+# __getauxval. So we need to link with libutils twice: before and after libgcc.
> > > > > > > -+# Hence it included both in $(libnames) and in $(libnames-after-libgcc)
> > > > > > > -+libnames-after-libgcc += utils
> > > > > > > -+libdeps-after-libgcc += $(ta-dev-kit-dir$(sm))/lib/libutils.a
> > > > > > > -+
> > > > > > > - # Pass config variable (CFG_) from conf.mk on the command line
> > > > > > > - cppflags$(sm) += $(strip \
> > > > > > > -       $(foreach var, $(filter CFG_%,$(.VARIABLES)), \
> > > > > > > ---
> > > > > > > -2.25.1
> > > > > > > -
> > > > > > > diff --git a/meta-arm/recipes-security/optee/optee-os_3.11.0.bb b/meta-arm/recipes-security/optee/optee-os_3.11.0.bb
> > > > > > > deleted file mode 100644
> > > > > > > index 13b3dc6..0000000
> > > > > > > --- a/meta-arm/recipes-security/optee/optee-os_3.11.0.bb
> > > > > > > +++ /dev/null
> > > > > > > @@ -1,11 +0,0 @@
> > > > > > > -require optee-os.inc
> > > > > > > -
> > > > > > > -SRCREV = "c4def2a8262a03244d9a88461699b9b8e43c6b55"
> > > > > > > -
> > > > > > > -SRC_URI_append = " \
> > > > > > > -    file://0006-allow-setting-sysroot-for-libgcc-lookup.patch \
> > > > > > > -    file://0007-allow-setting-sysroot-for-clang.patch \
> > > > > > > -    file://0001-libutils-provide-empty-__getauxval-implementation.patch \
> > > > > > > -    file://0002-link.mk-implement-support-for-libnames-after-libgcc-.patch \
> > > > > > > -    file://0003-ta_dev_kit.mk-make-sure-that-libutils-is-linked-seco.patch \
> > > > > > > -"
> > > > > > > diff --git a/meta-arm/recipes-security/optee/optee-os_3.14.0.bb b/meta-arm/recipes-security/optee/optee-os_3.14.0.bb
> > > > > > > new file mode 100644
> > > > > > > index 0000000..3289e2c
> > > > > > > --- /dev/null
> > > > > > > +++ b/meta-arm/recipes-security/optee/optee-os_3.14.0.bb
> > > > > > > @@ -0,0 +1,8 @@
> > > > > > > +require optee-os.inc
> > > > > > > +
> > > > > > > +SRCREV = "d21befa5e53eae9db469eba1685f5aa5c6f92c2f"
> > > > > > > +
> > > > > > > +SRC_URI_append = " \
> > > > > > > +    file://0006-allow-setting-sysroot-for-libgcc-lookup.patch \
> > > > > > > +    file://0007-allow-setting-sysroot-for-clang.patch \
> > > > > > > +"
> > > > > > > diff --git a/meta-arm/recipes-security/optee/optee-test.inc b/meta-arm/recipes-security/optee/optee-test.inc
> > > > > > > index f09b9d2..bcbcc06 100644
> > > > > > > --- a/meta-arm/recipes-security/optee/optee-test.inc
> > > > > > > +++ b/meta-arm/recipes-security/optee/optee-test.inc
> > > > > > > @@ -8,17 +8,9 @@ LIC_FILES_CHKSUM = "file://${S}/LICENSE.md;md5=daa2bcccc666345ab8940aab1315a4fa"
> > > > > > >  inherit python3native ptest
> > > > > > >  require optee.inc
> > > > > > >
> > > > > > > -# Linking fails on musl due to C++/threads
> > > > > > > -# https://github.com/OP-TEE/optee_test/issues/458#issuecomment-720540834
> > > > > > > -# When upgraded we should be able to remove this limitation
> > > > > > > -COMPATIBLE_HOST_libc-musl = 'null'
> > > > > > > -
> > > > > > >  DEPENDS = "optee-client optee-os python3-pycryptodome-native"
> > > > > > >
> > > > > > >  SRC_URI = "git://github.com/OP-TEE/optee_test.git \
> > > > > > > -           file://0001-host-xtest-Adjust-order-of-including-compiler.h.patch \
> > > > > > > -           file://0002-make-remove-Wno-unsafe-loop-for-clang.patch \
> > > > > > > -           file://0003-make-remove-Wmissing-noreturn-for-clang.patch \
> > > > > > >             file://run-ptest \
> > > > > > >            "
> > > > > > >
> > > > > > > @@ -36,6 +28,7 @@ do_compile() {
> > > > > > >      # Top level makefile doesn't seem to handle parallel make gracefully
> > > > > > >      oe_runmake xtest
> > > > > > >      oe_runmake ta
> > > > > > > +    oe_runmake test_plugin
> > > > > > >  }
> > > > > > >  do_compile[cleandirs] = "${B}"
> > > > > > >
> > > > > > > @@ -46,9 +39,13 @@ do_install () {
> > > > > > >      # default TEEC_LOAD_PATH is /lib
> > > > > > >      mkdir -p ${D}${nonarch_base_libdir}/optee_armtz/
> > > > > > >      install -D -p -m0444 ${B}/ta/*/*.ta ${D}${nonarch_base_libdir}/optee_armtz/
> > > > > > > +    mkdir -p ${D}${libdir}/tee-supplicant/plugins
> > > > > > > +    install -D -p -m0444 ${B}/supp_plugin/*.plugin ${D}${libdir}/tee-supplicant/plugins/
> > > > > > >  }
> > > > > > >
> > > > > > > -FILES_${PN} += "${nonarch_base_libdir}/optee_armtz/"
> > > > > > > +FILES_${PN} += "${nonarch_base_libdir}/optee_armtz/ \
> > > > > > > +                ${libdir}/tee-supplicant/plugins/ \
> > > > > > > +               "
> > > > > > >
> > > > > > >  # Imports machine specific configs from staging to build
> > > > > > >  PACKAGE_ARCH = "${MACHINE_ARCH}"
> > > > > > > diff --git a/meta-arm/recipes-security/optee/optee-test/0001-host-xtest-Adjust-order-of-including-compiler.h.patch b/meta-arm/recipes-security/optee/optee-test/0001-host-xtest-Adjust-order-of-including-compiler.h.patch
> > > > > > > deleted file mode 100644
> > > > > > > index 3c500d7..0000000
> > > > > > > --- a/meta-arm/recipes-security/optee/optee-test/0001-host-xtest-Adjust-order-of-including-compiler.h.patch
> > > > > > > +++ /dev/null
> > > > > > > @@ -1,64 +0,0 @@
> > > > > > > -From fc95b3ccbbfd336797ae2cfd6dd4dc58644e146f Mon Sep 17 00:00:00 2001
> > > > > > > -From: Khem Raj <raj.khem@gmail.com>
> > > > > > > -Date: Sat, 30 May 2020 17:52:18 -0700
> > > > > > > -Subject: [PATCH] host/xtest: Adjust order of including compiler.h
> > > > > > > -
> > > > > > > -compiler.h defines some defines which violate libc namespace e.g.
> > > > > > > -__unused, this works ok with glibc but fails in awkward ways with musl
> > > > > > > -the reason is musl uses __unused in its internal structures and this
> > > > > > > -define in compiler.h conflicts with system headers causing errors like
> > > > > > > -
> > > > > > > -recipe-sysroot/usr/include/bits/stat.h:17:19: error: expected identifier or '(' before '[' token unsigned __unused[2];
> > > > > > > -                   ^
> > > > > > > -including compiler.h afer sys/stat.h fixes the problem.
> > > > > > > -
> > > > > > > -Upstream-Status: Pending [https://github.com/OP-TEE/optee_test/issues/453]
> > > > > > > -Signed-off-by: Khem Raj <raj.khem@gmail.com>
> > > > > > > ----
> > > > > > > - host/xtest/install_ta.c | 2 +-
> > > > > > > - host/xtest/stats.c      | 2 +-
> > > > > > > - 2 files changed, 2 insertions(+), 2 deletions(-)
> > > > > > > -
> > > > > > > -diff --git a/host/xtest/install_ta.c b/host/xtest/install_ta.c
> > > > > > > -index 09a4c6d..6f7bb5c 100644
> > > > > > > ---- a/host/xtest/install_ta.c
> > > > > > > -+++ b/host/xtest/install_ta.c
> > > > > > > -@@ -4,7 +4,6 @@
> > > > > > > -  * SPDX-License-Identifier: BSD-2-Clause
> > > > > > > -  */
> > > > > > > -
> > > > > > > --#include <compiler.h>
> > > > > > > - #include <dirent.h>
> > > > > > > - #include <err.h>
> > > > > > > - #include <errno.h>
> > > > > > > -@@ -20,6 +19,7 @@
> > > > > > > - #include <sys/types.h>
> > > > > > > - #include <tee_client_api.h>
> > > > > > > - #include <unistd.h>
> > > > > > > -+#include <compiler.h>
> > > > > > > -
> > > > > > > - #include "install_ta.h"
> > > > > > > - #include "xtest_helpers.h"
> > > > > > > -diff --git a/host/xtest/stats.c b/host/xtest/stats.c
> > > > > > > -index 96b0b5f..db9bf25 100644
> > > > > > > ---- a/host/xtest/stats.c
> > > > > > > -+++ b/host/xtest/stats.c
> > > > > > > -@@ -3,7 +3,6 @@
> > > > > > > -  * Copyright (c) 2019, Linaro Limited
> > > > > > > -  */
> > > > > > > -
> > > > > > > --#include <compiler.h>
> > > > > > > - #include <dirent.h>
> > > > > > > - #include <err.h>
> > > > > > > - #include <errno.h>
> > > > > > > -@@ -18,6 +17,7 @@
> > > > > > > - #include <sys/types.h>
> > > > > > > - #include <tee_client_api.h>
> > > > > > > - #include <unistd.h>
> > > > > > > -+#include <compiler.h>
> > > > > > > - #include "xtest_test.h"
> > > > > > > - #include "stats.h"
> > > > > > > -
> > > > > > > ---
> > > > > > > -2.26.2
> > > > > > > -
> > > > > > > diff --git a/meta-arm/recipes-security/optee/optee-test/0002-make-remove-Wno-unsafe-loop-for-clang.patch b/meta-arm/recipes-security/optee/optee-test/0002-make-remove-Wno-unsafe-loop-for-clang.patch
> > > > > > > deleted file mode 100644
> > > > > > > index 17dd7d8..0000000
> > > > > > > --- a/meta-arm/recipes-security/optee/optee-test/0002-make-remove-Wno-unsafe-loop-for-clang.patch
> > > > > > > +++ /dev/null
> > > > > > > @@ -1,31 +0,0 @@
> > > > > > > -From 438533ce9da1df0b7c7914e64b39ffdc1da1ab79 Mon Sep 17 00:00:00 2001
> > > > > > > -From: Brett Warren <brett.warran@arm.com>
> > > > > > > -Date: Thu, 8 Oct 2020 10:03:25 +0100
> > > > > > > -Subject: [PATCH] make: remove -Wmissing-noreturn for clang
> > > > > > > -
> > > > > > > -When compiling when clang, -Wmissing-noreturn causes an error because
> > > > > > > -of non-compliant code. This option is removed to workaround this.
> > > > > > > -
> > > > > > > -Upstream-Status: Pending [https://github.com/OP-TEE/optee_test/issues/452]
> > > > > > > -Changed-Id: 71cb511904547d790d1ea98f93bf8e5a6afcb36d
> > > > > > > -Signed-off-by: Brett Warren <brett.warren@arm.com>
> > > > > > > ----
> > > > > > > - host/xtest/Makefile | 2 +-
> > > > > > > - 1 file changed, 1 insertion(+), 1 deletion(-)
> > > > > > > -
> > > > > > > -diff --git a/host/xtest/Makefile b/host/xtest/Makefile
> > > > > > > -index 3c206b0..96746de 100644
> > > > > > > ---- a/host/xtest/Makefile
> > > > > > > -+++ b/host/xtest/Makefile
> > > > > > > -@@ -169,7 +169,7 @@ CFLAGS += -Wall -Wcast-align -Werror \
> > > > > > > -         -Werror-implicit-function-declaration -Wextra -Wfloat-equal \
> > > > > > > -         -Wformat-nonliteral -Wformat-security -Wformat=2 -Winit-self \
> > > > > > > -         -Wmissing-declarations -Wmissing-format-attribute \
> > > > > > > --        -Wmissing-include-dirs -Wmissing-noreturn \
> > > > > > > -+        -Wmissing-include-dirs \
> > > > > > > -         -Wmissing-prototypes -Wnested-externs -Wpointer-arith \
> > > > > > > -         -Wshadow -Wstrict-prototypes -Wswitch-default \
> > > > > > > -         -Wwrite-strings \
> > > > > > > ---
> > > > > > > -2.17.1
> > > > > > > -
> > > > > > > diff --git a/meta-arm/recipes-security/optee/optee-test/0003-make-remove-Wmissing-noreturn-for-clang.patch b/meta-arm/recipes-security/optee/optee-test/0003-make-remove-Wmissing-noreturn-for-clang.patch
> > > > > > > deleted file mode 100644
> > > > > > > index bbc303f..0000000
> > > > > > > --- a/meta-arm/recipes-security/optee/optee-test/0003-make-remove-Wmissing-noreturn-for-clang.patch
> > > > > > > +++ /dev/null
> > > > > > > @@ -1,31 +0,0 @@
> > > > > > > -From ed5a9d9f7a3e9e14ca0e8aea59008124ee0e5f96 Mon Sep 17 00:00:00 2001
> > > > > > > -From: Brett Warren <brett.warren@arm.com>
> > > > > > > -Date: Thu, 8 Oct 2020 10:20:52 +0100
> > > > > > > -Subject: [PATCH] make: remove -Wno-unsafe-loop for clang
> > > > > > > -
> > > > > > > -When compiling with clang, the -Wno-unsafe-loop-optimizations option
> > > > > > > -throws an error because clang doesn't recognise it. This option is
> > > > > > > -removed to workaround this.
> > > > > > > -
> > > > > > > -Upstream-Status: Pending [https://github.com/OP-TEE/optee_test/issues/452]
> > > > > > > -Change-Id: 5fe0892c73208aaffac8c9995cb3275936fb1ba6
> > > > > > > -Signed-off-by: Brett Warren <brett.warren@arm.com>
> > > > > > > ----
> > > > > > > - host/xtest/Makefile | 1 -
> > > > > > > - 1 file changed, 1 deletion(-)
> > > > > > > -
> > > > > > > -diff --git a/host/xtest/Makefile b/host/xtest/Makefile
> > > > > > > -index 96746de..73731d0 100644
> > > > > > > ---- a/host/xtest/Makefile
> > > > > > > -+++ b/host/xtest/Makefile
> > > > > > > -@@ -174,7 +174,6 @@ CFLAGS += -Wall -Wcast-align -Werror \
> > > > > > > -         -Wshadow -Wstrict-prototypes -Wswitch-default \
> > > > > > > -         -Wwrite-strings \
> > > > > > > -         -Wno-declaration-after-statement \
> > > > > > > --        -Wno-unsafe-loop-optimizations \
> > > > > > > -         -Wno-missing-field-initializers -Wno-format-zero-length
> > > > > > > - endif
> > > > > > > -
> > > > > > > ---
> > > > > > > -2.17.1
> > > > > > > -
> > > > > > > diff --git a/meta-arm/recipes-security/optee/optee-test_3.11.0.bb b/meta-arm/recipes-security/optee/optee-test_3.11.0.bb
> > > > > > > deleted file mode 100644
> > > > > > > index 0f8b5b0..0000000
> > > > > > > --- a/meta-arm/recipes-security/optee/optee-test_3.11.0.bb
> > > > > > > +++ /dev/null
> > > > > > > @@ -1,3 +0,0 @@
> > > > > > > -require optee-test.inc
> > > > > > > -
> > > > > > > -SRCREV = "159e295d5cc3ad2275ab15fe544620f6604d4ba4"
> > > > > > > diff --git a/meta-arm/recipes-security/optee/optee-test_3.14.0.bb b/meta-arm/recipes-security/optee/optee-test_3.14.0.bb
> > > > > > > new file mode 100644
> > > > > > > index 0000000..6367c27
> > > > > > > --- /dev/null
> > > > > > > +++ b/meta-arm/recipes-security/optee/optee-test_3.14.0.bb
> > > > > > > @@ -0,0 +1,3 @@
> > > > > > > +require optee-test.inc
> > > > > > > +
> > > > > > > +SRCREV = "f2eb88affbb7f028561b4fd5cbd049d5d704f741"
> > > > > > > --
> > > > > > > 2.25.1
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > >
> > > > > 
> > > > >

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2021-07-27 12:37 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-20 10:07 [PATCH] arm/optee: version uplift 3.11.0 -> 3.14.0 Sumit Garg
2021-07-20 14:42 ` [meta-arm] " Jon Mason
2021-07-22  8:00   ` Sumit Garg
2021-07-22  8:31     ` Arunachalam Ganapathy
2021-07-23 19:06 ` Ross Burton
2021-07-26  7:09   ` Sumit Garg
2021-07-26 14:01     ` Jon Mason
2021-07-27  6:52       ` Sumit Garg
2021-07-27 12:18         ` Ross Burton
2021-07-27 12:22           ` Ross Burton
2021-07-27 12:37             ` Sumit Garg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.