All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 1/6] qemuarm64-secureboot: changed format of memory to MB
@ 2020-10-19  9:27 Brett Warren
  2020-10-19  9:27 ` [PATCH v3 2/6] optee: upgraded recipes to 3.10 Brett Warren
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Brett Warren @ 2020-10-19  9:27 UTC (permalink / raw)
  To: meta-arm

When running runqemu the memory argument in the kernel
commandline arguments expects megabytes, so with the previous
format "-m 1GM" ended up being passed.

Change-Id: I5d3bc9d5ce93fa3da5885c99feb99ce80367c993
Signed-off-by: Brett Warren <brett.warren@arm.com>
---
 meta-arm/conf/machine/qemuarm64-secureboot.conf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta-arm/conf/machine/qemuarm64-secureboot.conf b/meta-arm/conf/machine/qemuarm64-secureboot.conf
index a5b7401..f2c15e6 100644
--- a/meta-arm/conf/machine/qemuarm64-secureboot.conf
+++ b/meta-arm/conf/machine/qemuarm64-secureboot.conf
@@ -12,7 +12,7 @@ PREFERRED_PROVIDER_virtual/kernel = "linux-yocto-dev"
 
 QB_MACHINE = "-machine virt,secure=on"
 QB_OPT_APPEND += "-no-acpi"
-QB_MEM = "-m 1G"
+QB_MEM = "-m 1024"
 QB_DEFAULT_FSTYPE = "wic.qcow2"
 QB_DEFAULT_BIOS = "flash.bin"
 QB_FSINFO = "wic:no-kernel-in-fs"
-- 
2.17.1


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

* [PATCH v3 2/6] optee: upgraded recipes to 3.10
  2020-10-19  9:27 [PATCH v3 1/6] qemuarm64-secureboot: changed format of memory to MB Brett Warren
@ 2020-10-19  9:27 ` Brett Warren
  2020-10-19 13:25   ` [meta-arm] " Jon Mason
  2020-10-19  9:27 ` [PATCH v3 3/6] optee: enable clang support Brett Warren
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 7+ messages in thread
From: Brett Warren @ 2020-10-19  9:27 UTC (permalink / raw)
  To: meta-arm

The optee recipes were upgraded due to issues booting with 3.8
on qemuarm64-secureboot, which were resolved by the upgrade.
The 3.8 recipes are retained for backwards compatibility.

optee-test and optee-examples were modified to pass a sysroot
to the LIBGCC_LOCATE_CFLAGS parameter, to ensure proper location
of the libgcc library.

Recipes have been renamed to reflect their current version.
As this makes the PV variables redundent, these have been removed.

Change-Id: Iacaba02d64570a790d5cc20eca8be58246e39019
Signed-off-by: Brett Warren <brett.warren@arm.com>
---
 .../{optee-client_git.bb => optee-client_3.10.0.bb}    |  4 +---
 .../{optee-client_git.bb => optee-client_3.8.0.bb}     |  2 --
 ...{optee-examples_git.bb => optee-examples_3.10.0.bb} |  5 ++---
 .../{optee-examples_git.bb => optee-examples_3.8.0.bb} |  3 +--
 .../optee/{optee-os_git.bb => optee-os_3.10.0.bb}      | 10 +---------
 .../optee/{optee-os_git.bb => optee-os_3.8.0.bb}       |  2 --
 .../optee/{optee-test_git.bb => optee-test_3.10.0.bb}  |  5 ++---
 .../optee/{optee-test_git.bb => optee-test_3.8.0.bb}   |  3 +--
 8 files changed, 8 insertions(+), 26 deletions(-)
 copy meta-arm/recipes-security/optee/{optee-client_git.bb => optee-client_3.10.0.bb} (95%)
 rename meta-arm/recipes-security/optee/{optee-client_git.bb => optee-client_3.8.0.bb} (98%)
 copy meta-arm/recipes-security/optee/{optee-examples_git.bb => optee-examples_3.10.0.bb} (92%)
 rename meta-arm/recipes-security/optee/{optee-examples_git.bb => optee-examples_3.8.0.bb} (95%)
 copy meta-arm/recipes-security/optee/{optee-os_git.bb => optee-os_3.10.0.bb} (81%)
 rename meta-arm/recipes-security/optee/{optee-os_git.bb => optee-os_3.8.0.bb} (98%)
 copy meta-arm/recipes-security/optee/{optee-test_git.bb => optee-test_3.10.0.bb} (93%)
 rename meta-arm/recipes-security/optee/{optee-test_git.bb => optee-test_3.8.0.bb} (96%)

diff --git a/meta-arm/recipes-security/optee/optee-client_git.bb b/meta-arm/recipes-security/optee/optee-client_3.10.0.bb
similarity index 95%
copy from meta-arm/recipes-security/optee/optee-client_git.bb
copy to meta-arm/recipes-security/optee/optee-client_3.10.0.bb
index 5dbbfe9..cbd3b93 100644
--- a/meta-arm/recipes-security/optee/optee-client_git.bb
+++ b/meta-arm/recipes-security/optee/optee-client_3.10.0.bb
@@ -5,13 +5,11 @@ HOMEPAGE = "https://www.op-tee.org/"
 LICENSE = "BSD"
 LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=69663ab153298557a59c67a60a743e5b"
 
-PV = "3.8.0+git${SRCPV}"
-
 require optee.inc
 
 inherit python3native systemd update-rc.d
 
-SRCREV = "be4fa2e36f717f03ca46e574aa66f697a897d090"
+SRCREV = "2a77cf88d956c34cb4a1c191bea6113e327f5fe0"
 SRC_URI = " \
     git://github.com/OP-TEE/optee_client.git \
     file://tee-supplicant.service \
diff --git a/meta-arm/recipes-security/optee/optee-client_git.bb b/meta-arm/recipes-security/optee/optee-client_3.8.0.bb
similarity index 98%
rename from meta-arm/recipes-security/optee/optee-client_git.bb
rename to meta-arm/recipes-security/optee/optee-client_3.8.0.bb
index 5dbbfe9..d43ebf4 100644
--- a/meta-arm/recipes-security/optee/optee-client_git.bb
+++ b/meta-arm/recipes-security/optee/optee-client_3.8.0.bb
@@ -5,8 +5,6 @@ HOMEPAGE = "https://www.op-tee.org/"
 LICENSE = "BSD"
 LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=69663ab153298557a59c67a60a743e5b"
 
-PV = "3.8.0+git${SRCPV}"
-
 require optee.inc
 
 inherit python3native systemd update-rc.d
diff --git a/meta-arm/recipes-security/optee/optee-examples_git.bb b/meta-arm/recipes-security/optee/optee-examples_3.10.0.bb
similarity index 92%
copy from meta-arm/recipes-security/optee/optee-examples_git.bb
copy to meta-arm/recipes-security/optee/optee-examples_3.10.0.bb
index 71be593..4a7db10 100644
--- a/meta-arm/recipes-security/optee/optee-examples_git.bb
+++ b/meta-arm/recipes-security/optee/optee-examples_3.10.0.bb
@@ -5,8 +5,6 @@ HOMEPAGE = "https://github.com/linaro-swg/optee_examples"
 LICENSE = "GPLv2"
 LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=cd95ab417e23b94f381dafc453d70c30"
 
-PV = "3.8.0+git${SRCPV}"
-
 DEPENDS = "optee-client optee-os python3-pycryptodomex-native"
 
 inherit python3native
@@ -16,7 +14,7 @@ require optee.inc
 SRC_URI = "git://github.com/linaro-swg/optee_examples.git \
            file://0001-make-Pass-ldflags-during-link.patch \
            "
-SRCREV = "559b2141c16bf0f57ccd72f60e4deb84fc2a05b0"
+SRCREV = "c6eb00a9d83bf068a37e4806c97f582bb16e2973"
 
 S = "${WORKDIR}/git"
 B = "${WORKDIR}/build"
@@ -30,6 +28,7 @@ EXTRA_OEMAKE = " TA_DEV_KIT_DIR=${TA_DEV_KIT_DIR} \
                  TEEC_EXPORT=${TEEC_EXPORT} \
                  HOST_CROSS_COMPILE=${TARGET_PREFIX} \
                  TA_CROSS_COMPILE=${TARGET_PREFIX} \
+                 LIBGCC_LOCATE_CFLAGS=--sysroot=${STAGING_DIR_HOST} \
                  V=1 \
                  OUTPUT_DIR=${B} \
                "
diff --git a/meta-arm/recipes-security/optee/optee-examples_git.bb b/meta-arm/recipes-security/optee/optee-examples_3.8.0.bb
similarity index 95%
rename from meta-arm/recipes-security/optee/optee-examples_git.bb
rename to meta-arm/recipes-security/optee/optee-examples_3.8.0.bb
index 71be593..7ed3dfa 100644
--- a/meta-arm/recipes-security/optee/optee-examples_git.bb
+++ b/meta-arm/recipes-security/optee/optee-examples_3.8.0.bb
@@ -5,8 +5,6 @@ HOMEPAGE = "https://github.com/linaro-swg/optee_examples"
 LICENSE = "GPLv2"
 LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=cd95ab417e23b94f381dafc453d70c30"
 
-PV = "3.8.0+git${SRCPV}"
-
 DEPENDS = "optee-client optee-os python3-pycryptodomex-native"
 
 inherit python3native
@@ -30,6 +28,7 @@ EXTRA_OEMAKE = " TA_DEV_KIT_DIR=${TA_DEV_KIT_DIR} \
                  TEEC_EXPORT=${TEEC_EXPORT} \
                  HOST_CROSS_COMPILE=${TARGET_PREFIX} \
                  TA_CROSS_COMPILE=${TARGET_PREFIX} \
+                 LIBGCC_LOCATE_CFLAGS=--sysroot=${STAGING_DIR_HOST} \
                  V=1 \
                  OUTPUT_DIR=${B} \
                "
diff --git a/meta-arm/recipes-security/optee/optee-os_git.bb b/meta-arm/recipes-security/optee/optee-os_3.10.0.bb
similarity index 81%
copy from meta-arm/recipes-security/optee/optee-os_git.bb
copy to meta-arm/recipes-security/optee/optee-os_3.10.0.bb
index deeb515..369e011 100644
--- a/meta-arm/recipes-security/optee/optee-os_git.bb
+++ b/meta-arm/recipes-security/optee/optee-os_3.10.0.bb
@@ -5,23 +5,15 @@ HOMEPAGE = "https://www.op-tee.org/"
 LICENSE = "BSD"
 LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=c1f21c4f72f372ef38a5a4aee55ec173"
 
-PV = "3.8.0+git${SRCPV}"
-
 inherit deploy python3native
 require optee.inc
 
 DEPENDS = "python3-pycryptodome-native python3-pycryptodomex-native python3-pyelftools-native"
 
-SRCREV = "023e33656e2c9557ce50ad63a98b2e2c9b51c118"
+SRCREV = "d1c635434c55b7d75eadf471bde04926bd1e50a7"
 SRC_URI = " \
     git://github.com/OP-TEE/optee_os.git \
-    file://0001-mk-compile.mk-fix-cc-option-macro.patch \
-    file://0002-Allow-use-of-cc-option-in-core-arch-arm-arm.mk.patch \
-    file://0003-arm64-Disable-outline-atomics-when-compiling.patch \
-    file://0004-Cleanup-unused-comp-cflags-sm-from-libgcc-lookup-com.patch \
-    file://0005-Fixup-Allow-use-of-cc-option-in-core-arch-arm-arm.mk.patch \
     file://0006-allow-setting-sysroot-for-libgcc-lookup.patch \
-    file://missing-mkdir.patch \
 "
 
 S = "${WORKDIR}/git"
diff --git a/meta-arm/recipes-security/optee/optee-os_git.bb b/meta-arm/recipes-security/optee/optee-os_3.8.0.bb
similarity index 98%
rename from meta-arm/recipes-security/optee/optee-os_git.bb
rename to meta-arm/recipes-security/optee/optee-os_3.8.0.bb
index deeb515..0001271 100644
--- a/meta-arm/recipes-security/optee/optee-os_git.bb
+++ b/meta-arm/recipes-security/optee/optee-os_3.8.0.bb
@@ -5,8 +5,6 @@ HOMEPAGE = "https://www.op-tee.org/"
 LICENSE = "BSD"
 LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=c1f21c4f72f372ef38a5a4aee55ec173"
 
-PV = "3.8.0+git${SRCPV}"
-
 inherit deploy python3native
 require optee.inc
 
diff --git a/meta-arm/recipes-security/optee/optee-test_git.bb b/meta-arm/recipes-security/optee/optee-test_3.10.0.bb
similarity index 93%
copy from meta-arm/recipes-security/optee/optee-test_git.bb
copy to meta-arm/recipes-security/optee/optee-test_3.10.0.bb
index 957286c..96e612a 100644
--- a/meta-arm/recipes-security/optee/optee-test_git.bb
+++ b/meta-arm/recipes-security/optee/optee-test_3.10.0.bb
@@ -10,9 +10,7 @@ require optee.inc
 
 DEPENDS = "optee-client optee-os python3-pycryptodomex-native"
 
-PV = "3.8.0+git${SRCPV}"
-
-SRCREV = "30481e381cb4285706e7516853495a7699c93b2c"
+SRCREV = "30efcbeaf8864d0f2a5c4be593a5411001fab31b"
 SRC_URI = "git://github.com/OP-TEE/optee_test.git \
            file://0001-host-xtest-Adjust-order-of-including-compiler.h.patch \
           "
@@ -29,6 +27,7 @@ EXTRA_OEMAKE = " TA_DEV_KIT_DIR=${TA_DEV_KIT_DIR} \
                  TEEC_EXPORT=${TEEC_EXPORT} \
                  CROSS_COMPILE_HOST=${TARGET_PREFIX} \
                  CROSS_COMPILE_TA=${TARGET_PREFIX} \
+                 LIBGCC_LOCATE_CFLAGS=--sysroot=${STAGING_DIR_HOST} \
                  V=1 \
                  O=${B} \
                "
diff --git a/meta-arm/recipes-security/optee/optee-test_git.bb b/meta-arm/recipes-security/optee/optee-test_3.8.0.bb
similarity index 96%
rename from meta-arm/recipes-security/optee/optee-test_git.bb
rename to meta-arm/recipes-security/optee/optee-test_3.8.0.bb
index 957286c..65e6cd1 100644
--- a/meta-arm/recipes-security/optee/optee-test_git.bb
+++ b/meta-arm/recipes-security/optee/optee-test_3.8.0.bb
@@ -10,8 +10,6 @@ require optee.inc
 
 DEPENDS = "optee-client optee-os python3-pycryptodomex-native"
 
-PV = "3.8.0+git${SRCPV}"
-
 SRCREV = "30481e381cb4285706e7516853495a7699c93b2c"
 SRC_URI = "git://github.com/OP-TEE/optee_test.git \
            file://0001-host-xtest-Adjust-order-of-including-compiler.h.patch \
@@ -29,6 +27,7 @@ EXTRA_OEMAKE = " TA_DEV_KIT_DIR=${TA_DEV_KIT_DIR} \
                  TEEC_EXPORT=${TEEC_EXPORT} \
                  CROSS_COMPILE_HOST=${TARGET_PREFIX} \
                  CROSS_COMPILE_TA=${TARGET_PREFIX} \
+                 LIBGCC_LOCATE_CFLAGS=--sysroot=${STAGING_DIR_HOST} \
                  V=1 \
                  O=${B} \
                "
-- 
2.17.1


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

* [PATCH v3 3/6] optee: enable clang support
  2020-10-19  9:27 [PATCH v3 1/6] qemuarm64-secureboot: changed format of memory to MB Brett Warren
  2020-10-19  9:27 ` [PATCH v3 2/6] optee: upgraded recipes to 3.10 Brett Warren
@ 2020-10-19  9:27 ` Brett Warren
  2020-10-19  9:27 ` [PATCH v3 4/6] trusted-firmware-a: " Brett Warren
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Brett Warren @ 2020-10-19  9:27 UTC (permalink / raw)
  To: meta-arm

Patch 0002 and 0003 in optee-test remove -W options from make
to enable successful compilation with clang.

Patch 0007 modifies the libgcc$(sm) variable in optee so that it can
find the compiler-rt dependencies. Compiler-rt is also added as a
dependency to the optee recipe.

The compiler in use is passed to make via TOOLCHAIN. If TOOLCHAIN
doesn't exist (it is declared by meta-clang, and so doesn't exist
by default), 'gcc' is passed as a default.

These modifications allow optee to be successfully compiled
when TOOLCHAIN=clang

Change-Id: If565969e169078fabd5e3cf5716ca317cc49a126
Signed-off-by: Brett Warren <brett.warren@arm.com>
---
 .../optee/optee-examples_3.10.0.bb            |  2 ++
 .../optee/optee-examples_3.8.0.bb             |  2 ++
 ...0007-allow-setting-sysroot-for-clang.patch | 29 +++++++++++++++++
 .../recipes-security/optee/optee-os_3.10.0.bb |  5 +++
 ...ake-remove-Wno-unsafe-loop-for-clang.patch | 31 +++++++++++++++++++
 ...e-remove-Wmissing-noreturn-for-clang.patch | 31 +++++++++++++++++++
 .../optee/optee-test_3.10.0.bb                |  4 +++
 .../optee/optee-test_3.8.0.bb                 |  4 +++
 8 files changed, 108 insertions(+)
 create mode 100644 meta-arm/recipes-security/optee/optee-os/0007-allow-setting-sysroot-for-clang.patch
 create mode 100644 meta-arm/recipes-security/optee/optee-test/0002-make-remove-Wno-unsafe-loop-for-clang.patch
 create mode 100644 meta-arm/recipes-security/optee/optee-test/0003-make-remove-Wmissing-noreturn-for-clang.patch

diff --git a/meta-arm/recipes-security/optee/optee-examples_3.10.0.bb b/meta-arm/recipes-security/optee/optee-examples_3.10.0.bb
index 4a7db10..2f3cc09 100644
--- a/meta-arm/recipes-security/optee/optee-examples_3.10.0.bb
+++ b/meta-arm/recipes-security/optee/optee-examples_3.10.0.bb
@@ -22,12 +22,14 @@ B = "${WORKDIR}/build"
 OPTEE_CLIENT_EXPORT = "${STAGING_DIR_HOST}${prefix}"
 TEEC_EXPORT = "${STAGING_DIR_HOST}${prefix}"
 TA_DEV_KIT_DIR = "${STAGING_INCDIR}/optee/export-user_ta"
+OPTEE_COMPILER = "${@d.getVar('TOOLCHAIN') or 'gcc'}"
 
 EXTRA_OEMAKE = " TA_DEV_KIT_DIR=${TA_DEV_KIT_DIR} \
                  OPTEE_CLIENT_EXPORT=${OPTEE_CLIENT_EXPORT} \
                  TEEC_EXPORT=${TEEC_EXPORT} \
                  HOST_CROSS_COMPILE=${TARGET_PREFIX} \
                  TA_CROSS_COMPILE=${TARGET_PREFIX} \
+                 COMPILER=${OPTEE_COMPILER} \
                  LIBGCC_LOCATE_CFLAGS=--sysroot=${STAGING_DIR_HOST} \
                  V=1 \
                  OUTPUT_DIR=${B} \
diff --git a/meta-arm/recipes-security/optee/optee-examples_3.8.0.bb b/meta-arm/recipes-security/optee/optee-examples_3.8.0.bb
index 7ed3dfa..f10b04d 100644
--- a/meta-arm/recipes-security/optee/optee-examples_3.8.0.bb
+++ b/meta-arm/recipes-security/optee/optee-examples_3.8.0.bb
@@ -22,12 +22,14 @@ B = "${WORKDIR}/build"
 OPTEE_CLIENT_EXPORT = "${STAGING_DIR_HOST}${prefix}"
 TEEC_EXPORT = "${STAGING_DIR_HOST}${prefix}"
 TA_DEV_KIT_DIR = "${STAGING_INCDIR}/optee/export-user_ta"
+OPTEE_COMPILER = "${@d.getVar('TOOLCHAIN') or 'gcc'}"
 
 EXTRA_OEMAKE = " TA_DEV_KIT_DIR=${TA_DEV_KIT_DIR} \
                  OPTEE_CLIENT_EXPORT=${OPTEE_CLIENT_EXPORT} \
                  TEEC_EXPORT=${TEEC_EXPORT} \
                  HOST_CROSS_COMPILE=${TARGET_PREFIX} \
                  TA_CROSS_COMPILE=${TARGET_PREFIX} \
+                 COMPILER=${OPTEE_COMPILER} \
                  LIBGCC_LOCATE_CFLAGS=--sysroot=${STAGING_DIR_HOST} \
                  V=1 \
                  OUTPUT_DIR=${B} \
diff --git a/meta-arm/recipes-security/optee/optee-os/0007-allow-setting-sysroot-for-clang.patch b/meta-arm/recipes-security/optee/optee-os/0007-allow-setting-sysroot-for-clang.patch
new file mode 100644
index 0000000..5c0d0a5
--- /dev/null
+++ b/meta-arm/recipes-security/optee/optee-os/0007-allow-setting-sysroot-for-clang.patch
@@ -0,0 +1,29 @@
+From 3167f2c0dba4db59d61b60a8fe66f969d20aafa9 Mon Sep 17 00:00:00 2001
+From: Brett Warren <brett.warren@arm.com>
+Date: Wed, 23 Sep 2020 09:27:34 +0100
+Subject: [PATCH] optee: enable clang support
+
+When compiling with clang, the LIBGCC_LOCATE_CFLAG variable used
+to provide a sysroot wasn't included, which results in not locating
+compiler-rt. This is mitigated by including the variable as ammended.
+
+Upstream-Status: Pending
+ChangeId: 8ba69a4b2eb8ebaa047cb266c9aa6c2c3da45701
+Signed-off-by: Brett Warren <brett.warren@arm.com>
+---
+ mk/clang.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/mk/clang.mk b/mk/clang.mk
+index 0f48c836..47465523 100644
+--- a/mk/clang.mk
++++ b/mk/clang.mk
+@@ -27,7 +27,7 @@ comp-cflags-warns-clang := -Wno-language-extension-token \
+ 
+ # Note, use the compiler runtime library (libclang_rt.builtins.*.a) instead of
+ # libgcc for clang
+-libgcc$(sm)	:= $(shell $(CC$(sm)) $(CFLAGS$(arch-bits-$(sm))) \
++libgcc$(sm)	:= $(shell $(CC$(sm)) $(LIBGCC_LOCATE_CFLAGS) $(CFLAGS$(arch-bits-$(sm))) \
+ 			-rtlib=compiler-rt -print-libgcc-file-name 2> /dev/null)
+ 
+ # Core ASLR relies on the executable being ready to run from its preferred load
diff --git a/meta-arm/recipes-security/optee/optee-os_3.10.0.bb b/meta-arm/recipes-security/optee/optee-os_3.10.0.bb
index 369e011..adc8510 100644
--- a/meta-arm/recipes-security/optee/optee-os_3.10.0.bb
+++ b/meta-arm/recipes-security/optee/optee-os_3.10.0.bb
@@ -10,10 +10,13 @@ require optee.inc
 
 DEPENDS = "python3-pycryptodome-native python3-pycryptodomex-native python3-pyelftools-native"
 
+DEPENDS_append_toolchain-clang = " compiler-rt"
+
 SRCREV = "d1c635434c55b7d75eadf471bde04926bd1e50a7"
 SRC_URI = " \
     git://github.com/OP-TEE/optee_os.git \
     file://0006-allow-setting-sysroot-for-libgcc-lookup.patch \
+    file://0007-allow-setting-sysroot-for-clang.patch \
 "
 
 S = "${WORKDIR}/git"
@@ -25,12 +28,14 @@ OPTEE_ARCH = "null"
 OPTEE_ARCH_armv7a = "arm32"
 OPTEE_ARCH_aarch64 = "arm64"
 OPTEE_CORE = "${@d.getVar('OPTEE_ARCH').upper()}"
+OPTEE_COMPILER = "${@d.getVar('TOOLCHAIN') or 'gcc'}"
 
 EXTRA_OEMAKE = " \
     PLATFORM=${OPTEEMACHINE} \
     CFG_${OPTEE_CORE}_core=y \
     CROSS_COMPILE_core=${HOST_PREFIX} \
     CROSS_COMPILE_ta_${OPTEE_ARCH}=${HOST_PREFIX} \
+    COMPILER=${OPTEE_COMPILER} \
     NOWERROR=1 \
     V=1 \
     ta-targets=ta_${OPTEE_ARCH} \
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
new file mode 100644
index 0000000..ef09c56
--- /dev/null
+++ b/meta-arm/recipes-security/optee/optee-test/0002-make-remove-Wno-unsafe-loop-for-clang.patch
@@ -0,0 +1,31 @@
+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
+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
new file mode 100644
index 0000000..b265e81
--- /dev/null
+++ b/meta-arm/recipes-security/optee/optee-test/0003-make-remove-Wmissing-noreturn-for-clang.patch
@@ -0,0 +1,31 @@
+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
+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.10.0.bb b/meta-arm/recipes-security/optee/optee-test_3.10.0.bb
index 96e612a..6541de4 100644
--- a/meta-arm/recipes-security/optee/optee-test_3.10.0.bb
+++ b/meta-arm/recipes-security/optee/optee-test_3.10.0.bb
@@ -13,6 +13,8 @@ DEPENDS = "optee-client optee-os python3-pycryptodomex-native"
 SRCREV = "30efcbeaf8864d0f2a5c4be593a5411001fab31b"
 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 \
           "
 
 S = "${WORKDIR}/git"
@@ -21,12 +23,14 @@ B = "${WORKDIR}/build"
 OPTEE_CLIENT_EXPORT = "${STAGING_DIR_HOST}${prefix}"
 TEEC_EXPORT         = "${STAGING_DIR_HOST}${prefix}"
 TA_DEV_KIT_DIR      = "${STAGING_INCDIR}/optee/export-user_ta"
+OPTEE_COMPILER = "${@d.getVar('TOOLCHAIN') or 'gcc'}"
 
 EXTRA_OEMAKE = " TA_DEV_KIT_DIR=${TA_DEV_KIT_DIR} \
                  OPTEE_CLIENT_EXPORT=${OPTEE_CLIENT_EXPORT} \
                  TEEC_EXPORT=${TEEC_EXPORT} \
                  CROSS_COMPILE_HOST=${TARGET_PREFIX} \
                  CROSS_COMPILE_TA=${TARGET_PREFIX} \
+                 COMPILER=${OPTEE_COMPILER} \
                  LIBGCC_LOCATE_CFLAGS=--sysroot=${STAGING_DIR_HOST} \
                  V=1 \
                  O=${B} \
diff --git a/meta-arm/recipes-security/optee/optee-test_3.8.0.bb b/meta-arm/recipes-security/optee/optee-test_3.8.0.bb
index 65e6cd1..7f3d49b 100644
--- a/meta-arm/recipes-security/optee/optee-test_3.8.0.bb
+++ b/meta-arm/recipes-security/optee/optee-test_3.8.0.bb
@@ -13,6 +13,8 @@ DEPENDS = "optee-client optee-os python3-pycryptodomex-native"
 SRCREV = "30481e381cb4285706e7516853495a7699c93b2c"
 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 \
           "
 
 S = "${WORKDIR}/git"
@@ -21,12 +23,14 @@ B = "${WORKDIR}/build"
 OPTEE_CLIENT_EXPORT = "${STAGING_DIR_HOST}${prefix}"
 TEEC_EXPORT         = "${STAGING_DIR_HOST}${prefix}"
 TA_DEV_KIT_DIR      = "${STAGING_INCDIR}/optee/export-user_ta"
+OPTEE_COMPILER = "${@d.getVar('TOOLCHAIN') or 'gcc'}"
 
 EXTRA_OEMAKE = " TA_DEV_KIT_DIR=${TA_DEV_KIT_DIR} \
                  OPTEE_CLIENT_EXPORT=${OPTEE_CLIENT_EXPORT} \
                  TEEC_EXPORT=${TEEC_EXPORT} \
                  CROSS_COMPILE_HOST=${TARGET_PREFIX} \
                  CROSS_COMPILE_TA=${TARGET_PREFIX} \
+                 COMPILER=${OPTEE_COMPILER} \
                  LIBGCC_LOCATE_CFLAGS=--sysroot=${STAGING_DIR_HOST} \
                  V=1 \
                  O=${B} \
-- 
2.17.1


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

* [PATCH v3 4/6] trusted-firmware-a: enable clang support
  2020-10-19  9:27 [PATCH v3 1/6] qemuarm64-secureboot: changed format of memory to MB Brett Warren
  2020-10-19  9:27 ` [PATCH v3 2/6] optee: upgraded recipes to 3.10 Brett Warren
  2020-10-19  9:27 ` [PATCH v3 3/6] optee: enable clang support Brett Warren
@ 2020-10-19  9:27 ` Brett Warren
  2020-10-19  9:27 ` [PATCH v3 5/6] wic/qemuarm64: enabled kernel arguments with u-boot Brett Warren
  2020-10-19  9:27 ` [PATCH v3 6/6] optee: refactor into .inc files Brett Warren
  4 siblings, 0 replies; 7+ messages in thread
From: Brett Warren @ 2020-10-19  9:27 UTC (permalink / raw)
  To: meta-arm

The CC and LD parameters are used to point make to the currently
used compiler and linkers.

This change enables TFA to be compiled successfully when
TOOLCHAIN=clang.

Change-Id: Ice465318b8c9b2b69c08fe4f48f6d36c610978f0
Signed-off-by: Brett Warren <brett.warren@arm.com>
---
 .../trusted-firmware-a/trusted-firmware-a.inc         | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc b/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc
index 8b19d68..98085d0 100644
--- a/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc
+++ b/meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc
@@ -78,6 +78,17 @@ do_configure[noexec] = "1"
 DEPENDS_append = " dtc-native openssl-native"
 DEPENDS_append_aarch64_qemuall ?= " optee-os"
 
+# CC and LD introduce arguments which conflict with those otherwise provided by
+# this recipe. The heads of these variables excluding those arguments
+# are therefore used instead.
+def remove_options_tail (in_string):
+    from itertools import takewhile
+    return ' '.join(takewhile(lambda x: not x.startswith('-'), in_string.split(' ')))
+
+EXTRA_OEMAKE += "LD=${@remove_options_tail(d.getVar('LD'))}"
+
+EXTRA_OEMAKE += "CC=${@remove_options_tail(d.getVar('CC'))}"
+
 EXTRA_OEMAKE += "V=1"
 
 # Add platform parameter
-- 
2.17.1


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

* [PATCH v3 5/6] wic/qemuarm64: enabled kernel arguments with u-boot
  2020-10-19  9:27 [PATCH v3 1/6] qemuarm64-secureboot: changed format of memory to MB Brett Warren
                   ` (2 preceding siblings ...)
  2020-10-19  9:27 ` [PATCH v3 4/6] trusted-firmware-a: " Brett Warren
@ 2020-10-19  9:27 ` Brett Warren
  2020-10-19  9:27 ` [PATCH v3 6/6] optee: refactor into .inc files Brett Warren
  4 siblings, 0 replies; 7+ messages in thread
From: Brett Warren @ 2020-10-19  9:27 UTC (permalink / raw)
  To: meta-arm

Kernel commandline arguments passed via runqemu don't
configure the kernel when booting with u-boot, as it finds
configuration in extlinux/extlinux.conf instead, which is
generated by wic.

A custom extlinux.conf file is now passed to wic with the
intended arguments, so that the kernel now configures
as directed.

Change-Id: Icbbcab47fe5cf70e4d8d39c7145371f1d6cd8db7
Signed-off-by: Brett Warren <brett.warren@arm.com>
---
 meta-arm/wic/qemuarm64.cfg | 4 ++++
 meta-arm/wic/qemuarm64.wks | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)
 create mode 100644 meta-arm/wic/qemuarm64.cfg

diff --git a/meta-arm/wic/qemuarm64.cfg b/meta-arm/wic/qemuarm64.cfg
new file mode 100644
index 0000000..580244f
--- /dev/null
+++ b/meta-arm/wic/qemuarm64.cfg
@@ -0,0 +1,4 @@
+default Yocto
+label Yocto
+    kernel /Image
+append root=/dev/vda2 rw console=ttyS0 mem=1024M ip=192.168.7.2::192.168.7.1:255.255.255.0 console=ttyAMA0
diff --git a/meta-arm/wic/qemuarm64.wks b/meta-arm/wic/qemuarm64.wks
index 7285279..9df44c2 100644
--- a/meta-arm/wic/qemuarm64.wks
+++ b/meta-arm/wic/qemuarm64.wks
@@ -1,4 +1,4 @@
-bootloader --ptable gpt
+bootloader --ptable gpt --configfile="qemuarm64.cfg"
 
 part /boot --ondisk=vda --align 64 --size=100M --active --source bootimg-partition --fstype=ext4 --label boot --sourceparams="loader=u-boot"
 part /     --ondisk=vda                                 --source rootfs            --fstype=ext4 --label root
-- 
2.17.1


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

* [PATCH v3 6/6] optee: refactor into .inc files
  2020-10-19  9:27 [PATCH v3 1/6] qemuarm64-secureboot: changed format of memory to MB Brett Warren
                   ` (3 preceding siblings ...)
  2020-10-19  9:27 ` [PATCH v3 5/6] wic/qemuarm64: enabled kernel arguments with u-boot Brett Warren
@ 2020-10-19  9:27 ` Brett Warren
  4 siblings, 0 replies; 7+ messages in thread
From: Brett Warren @ 2020-10-19  9:27 UTC (permalink / raw)
  To: meta-arm

To reduce code duplication, .inc files are used to hold common parts
of recipes, allowing .bb files to only specify things specific to that
recipe version.

Change-Id: I30b51ebfb2e3147544d049b514a25886fb2b77d9
Signed-off-by: Brett Warren <brett.warren@arm.com>
---
 ...optee-client_3.8.0.bb => optee-client.inc} |  2 +-
 .../optee/optee-client_3.10.0.bb              | 58 +------------
 .../optee/optee-client_3.8.0.bb               | 58 +------------
 ...-examples_3.10.0.bb => optee-examples.inc} | 21 ++---
 .../optee/optee-examples_3.10.0.bb            | 52 +-----------
 .../optee/optee-examples_3.8.0.bb             | 53 +-----------
 .../{optee-os_3.10.0.bb => optee-os.inc}      | 11 +--
 .../recipes-security/optee/optee-os_3.10.0.bb | 85 +------------------
 .../recipes-security/optee/optee-os_3.8.0.bb  | 82 +-----------------
 .../{optee-test_3.10.0.bb => optee-test.inc}  |  7 +-
 .../optee/optee-test_3.10.0.bb                | 58 +------------
 .../optee/optee-test_3.8.0.bb                 | 58 +------------
 12 files changed, 31 insertions(+), 514 deletions(-)
 copy meta-arm/recipes-security/optee/{optee-client_3.8.0.bb => optee-client.inc} (96%)
 copy meta-arm/recipes-security/optee/{optee-examples_3.10.0.bb => optee-examples.inc} (96%)
 copy meta-arm/recipes-security/optee/{optee-os_3.10.0.bb => optee-os.inc} (90%)
 copy meta-arm/recipes-security/optee/{optee-test_3.10.0.bb => optee-test.inc} (97%)

diff --git a/meta-arm/recipes-security/optee/optee-client_3.8.0.bb b/meta-arm/recipes-security/optee/optee-client.inc
similarity index 96%
copy from meta-arm/recipes-security/optee/optee-client_3.8.0.bb
copy to meta-arm/recipes-security/optee/optee-client.inc
index d43ebf4..d82392c 100644
--- a/meta-arm/recipes-security/optee/optee-client_3.8.0.bb
+++ b/meta-arm/recipes-security/optee/optee-client.inc
@@ -9,7 +9,6 @@ require optee.inc
 
 inherit python3native systemd update-rc.d
 
-SRCREV = "be4fa2e36f717f03ca46e574aa66f697a897d090"
 SRC_URI = " \
     git://github.com/OP-TEE/optee_client.git \
     file://tee-supplicant.service \
@@ -57,3 +56,4 @@ INITSCRIPT_PACKAGES = "${PN}"
 INITSCRIPT_NAME_${PN} = "tee-supplicant"
 INITSCRIPT_PARAMS_${PN} = "start 10 1 2 3 4 5 . stop 90 0 6 ."
 
+
diff --git a/meta-arm/recipes-security/optee/optee-client_3.10.0.bb b/meta-arm/recipes-security/optee/optee-client_3.10.0.bb
index cbd3b93..c7cef19 100644
--- a/meta-arm/recipes-security/optee/optee-client_3.10.0.bb
+++ b/meta-arm/recipes-security/optee/optee-client_3.10.0.bb
@@ -1,59 +1,3 @@
-SUMMARY = "OP-TEE Client API"
-DESCRIPTION = "Open Portable Trusted Execution Environment - Normal World Client side of the TEE"
-HOMEPAGE = "https://www.op-tee.org/"
-
-LICENSE = "BSD"
-LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=69663ab153298557a59c67a60a743e5b"
-
-require optee.inc
-
-inherit python3native systemd update-rc.d
+require optee-client.inc
 
 SRCREV = "2a77cf88d956c34cb4a1c191bea6113e327f5fe0"
-SRC_URI = " \
-    git://github.com/OP-TEE/optee_client.git \
-    file://tee-supplicant.service \
-    file://tee-supplicant.sh \
-"
-
-S = "${WORKDIR}/git"
-B = "${WORKDIR}/build"
-
-EXTRA_OEMAKE = "O=${B}"
-
-do_compile() {
-    cd ${S}
-    oe_runmake
-}
-do_compile[cleandirs] = "${B}"
-
-do_install() {
-    cd ${S}
-    oe_runmake install
-
-    install -D -p -m0755 ${B}/export/usr/sbin/tee-supplicant ${D}${sbindir}/tee-supplicant
-
-    install -D -p -m0644 ${B}/export/usr/lib/libteec.so.1.0 ${D}${libdir}/libteec.so.1.0
-    ln -sf libteec.so.1.0 ${D}${libdir}/libteec.so
-    ln -sf libteec.so.1.0 ${D}${libdir}/libteec.so.1
-
-    install -d ${D}${includedir}
-    install -p -m0644 ${B}/export/usr/include/*.h ${D}${includedir}
-
-    install -D -p -m0644 ${WORKDIR}/tee-supplicant.service ${D}${systemd_system_unitdir}/tee-supplicant.service
-
-    install -D -p -m0755 ${WORKDIR}/tee-supplicant.sh ${D}${sysconfdir}/init.d/tee-supplicant
-
-    sed -i -e s:@sysconfdir@:${sysconfdir}:g \
-           -e s:@sbindir@:${sbindir}:g \
-              ${D}${systemd_system_unitdir}/tee-supplicant.service \
-              ${D}${sysconfdir}/init.d/tee-supplicant
-}
-
-SYSTEMD_SERVICE_${PN} = "tee-supplicant.service"
-
-INITSCRIPT_PACKAGES = "${PN}"
-
-INITSCRIPT_NAME_${PN} = "tee-supplicant"
-INITSCRIPT_PARAMS_${PN} = "start 10 1 2 3 4 5 . stop 90 0 6 ."
-
diff --git a/meta-arm/recipes-security/optee/optee-client_3.8.0.bb b/meta-arm/recipes-security/optee/optee-client_3.8.0.bb
index d43ebf4..b1587bb 100644
--- a/meta-arm/recipes-security/optee/optee-client_3.8.0.bb
+++ b/meta-arm/recipes-security/optee/optee-client_3.8.0.bb
@@ -1,59 +1,3 @@
-SUMMARY = "OP-TEE Client API"
-DESCRIPTION = "Open Portable Trusted Execution Environment - Normal World Client side of the TEE"
-HOMEPAGE = "https://www.op-tee.org/"
-
-LICENSE = "BSD"
-LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=69663ab153298557a59c67a60a743e5b"
-
-require optee.inc
-
-inherit python3native systemd update-rc.d
+require optee-client.inc
 
 SRCREV = "be4fa2e36f717f03ca46e574aa66f697a897d090"
-SRC_URI = " \
-    git://github.com/OP-TEE/optee_client.git \
-    file://tee-supplicant.service \
-    file://tee-supplicant.sh \
-"
-
-S = "${WORKDIR}/git"
-B = "${WORKDIR}/build"
-
-EXTRA_OEMAKE = "O=${B}"
-
-do_compile() {
-    cd ${S}
-    oe_runmake
-}
-do_compile[cleandirs] = "${B}"
-
-do_install() {
-    cd ${S}
-    oe_runmake install
-
-    install -D -p -m0755 ${B}/export/usr/sbin/tee-supplicant ${D}${sbindir}/tee-supplicant
-
-    install -D -p -m0644 ${B}/export/usr/lib/libteec.so.1.0 ${D}${libdir}/libteec.so.1.0
-    ln -sf libteec.so.1.0 ${D}${libdir}/libteec.so
-    ln -sf libteec.so.1.0 ${D}${libdir}/libteec.so.1
-
-    install -d ${D}${includedir}
-    install -p -m0644 ${B}/export/usr/include/*.h ${D}${includedir}
-
-    install -D -p -m0644 ${WORKDIR}/tee-supplicant.service ${D}${systemd_system_unitdir}/tee-supplicant.service
-
-    install -D -p -m0755 ${WORKDIR}/tee-supplicant.sh ${D}${sysconfdir}/init.d/tee-supplicant
-
-    sed -i -e s:@sysconfdir@:${sysconfdir}:g \
-           -e s:@sbindir@:${sbindir}:g \
-              ${D}${systemd_system_unitdir}/tee-supplicant.service \
-              ${D}${sysconfdir}/init.d/tee-supplicant
-}
-
-SYSTEMD_SERVICE_${PN} = "tee-supplicant.service"
-
-INITSCRIPT_PACKAGES = "${PN}"
-
-INITSCRIPT_NAME_${PN} = "tee-supplicant"
-INITSCRIPT_PARAMS_${PN} = "start 10 1 2 3 4 5 . stop 90 0 6 ."
-
diff --git a/meta-arm/recipes-security/optee/optee-examples_3.10.0.bb b/meta-arm/recipes-security/optee/optee-examples.inc
similarity index 96%
copy from meta-arm/recipes-security/optee/optee-examples_3.10.0.bb
copy to meta-arm/recipes-security/optee/optee-examples.inc
index 2f3cc09..7d12858 100644
--- a/meta-arm/recipes-security/optee/optee-examples_3.10.0.bb
+++ b/meta-arm/recipes-security/optee/optee-examples.inc
@@ -13,28 +13,28 @@ require optee.inc
 
 SRC_URI = "git://github.com/linaro-swg/optee_examples.git \
            file://0001-make-Pass-ldflags-during-link.patch \
-           "
-SRCREV = "c6eb00a9d83bf068a37e4806c97f582bb16e2973"
+          "
 
-S = "${WORKDIR}/git"
-B = "${WORKDIR}/build"
-
-OPTEE_CLIENT_EXPORT = "${STAGING_DIR_HOST}${prefix}"
-TEEC_EXPORT = "${STAGING_DIR_HOST}${prefix}"
-TA_DEV_KIT_DIR = "${STAGING_INCDIR}/optee/export-user_ta"
 OPTEE_COMPILER = "${@d.getVar('TOOLCHAIN') or 'gcc'}"
 
 EXTRA_OEMAKE = " TA_DEV_KIT_DIR=${TA_DEV_KIT_DIR} \
                  OPTEE_CLIENT_EXPORT=${OPTEE_CLIENT_EXPORT} \
                  TEEC_EXPORT=${TEEC_EXPORT} \
                  HOST_CROSS_COMPILE=${TARGET_PREFIX} \
-                 TA_CROSS_COMPILE=${TARGET_PREFIX} \
-                 COMPILER=${OPTEE_COMPILER} \
                  LIBGCC_LOCATE_CFLAGS=--sysroot=${STAGING_DIR_HOST} \
+                 COMPILER=${OPTEE_COMPILER} \
+                 TA_CROSS_COMPILE=${TARGET_PREFIX} \
                  V=1 \
                  OUTPUT_DIR=${B} \
                "
 
+S = "${WORKDIR}/git"
+B = "${WORKDIR}/build"
+
+OPTEE_CLIENT_EXPORT = "${STAGING_DIR_HOST}${prefix}"
+TEEC_EXPORT = "${STAGING_DIR_HOST}${prefix}"
+TA_DEV_KIT_DIR = "${STAGING_INCDIR}/optee/export-user_ta"
+
 do_compile() {
     cd ${S}
     oe_runmake
@@ -52,3 +52,4 @@ FILES_${PN} += "${nonarch_base_libdir}/optee_armtz/"
 
 # Imports machine specific configs from staging to build
 PACKAGE_ARCH = "${MACHINE_ARCH}"
+
diff --git a/meta-arm/recipes-security/optee/optee-examples_3.10.0.bb b/meta-arm/recipes-security/optee/optee-examples_3.10.0.bb
index 2f3cc09..1c52698 100644
--- a/meta-arm/recipes-security/optee/optee-examples_3.10.0.bb
+++ b/meta-arm/recipes-security/optee/optee-examples_3.10.0.bb
@@ -1,54 +1,4 @@
-SUMMARY = "OP-TEE examples"
-DESCRIPTION = "Open Portable Trusted Execution Environment - Sample Applications"
-HOMEPAGE = "https://github.com/linaro-swg/optee_examples"
+require optee-examples.inc
 
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=cd95ab417e23b94f381dafc453d70c30"
-
-DEPENDS = "optee-client optee-os python3-pycryptodomex-native"
-
-inherit python3native
-
-require optee.inc
-
-SRC_URI = "git://github.com/linaro-swg/optee_examples.git \
-           file://0001-make-Pass-ldflags-during-link.patch \
-           "
 SRCREV = "c6eb00a9d83bf068a37e4806c97f582bb16e2973"
 
-S = "${WORKDIR}/git"
-B = "${WORKDIR}/build"
-
-OPTEE_CLIENT_EXPORT = "${STAGING_DIR_HOST}${prefix}"
-TEEC_EXPORT = "${STAGING_DIR_HOST}${prefix}"
-TA_DEV_KIT_DIR = "${STAGING_INCDIR}/optee/export-user_ta"
-OPTEE_COMPILER = "${@d.getVar('TOOLCHAIN') or 'gcc'}"
-
-EXTRA_OEMAKE = " TA_DEV_KIT_DIR=${TA_DEV_KIT_DIR} \
-                 OPTEE_CLIENT_EXPORT=${OPTEE_CLIENT_EXPORT} \
-                 TEEC_EXPORT=${TEEC_EXPORT} \
-                 HOST_CROSS_COMPILE=${TARGET_PREFIX} \
-                 TA_CROSS_COMPILE=${TARGET_PREFIX} \
-                 COMPILER=${OPTEE_COMPILER} \
-                 LIBGCC_LOCATE_CFLAGS=--sysroot=${STAGING_DIR_HOST} \
-                 V=1 \
-                 OUTPUT_DIR=${B} \
-               "
-
-do_compile() {
-    cd ${S}
-    oe_runmake
-}
-do_compile[cleandirs] = "${B}"
-
-do_install () {
-    mkdir -p ${D}${nonarch_base_libdir}/optee_armtz
-    mkdir -p ${D}${bindir}
-    install -D -p -m0755 ${B}/ca/* ${D}${bindir}
-    install -D -p -m0444 ${B}/ta/* ${D}${nonarch_base_libdir}/optee_armtz
-}
-
-FILES_${PN} += "${nonarch_base_libdir}/optee_armtz/"
-
-# Imports machine specific configs from staging to build
-PACKAGE_ARCH = "${MACHINE_ARCH}"
diff --git a/meta-arm/recipes-security/optee/optee-examples_3.8.0.bb b/meta-arm/recipes-security/optee/optee-examples_3.8.0.bb
index f10b04d..bd9b317 100644
--- a/meta-arm/recipes-security/optee/optee-examples_3.8.0.bb
+++ b/meta-arm/recipes-security/optee/optee-examples_3.8.0.bb
@@ -1,54 +1,3 @@
-SUMMARY = "OP-TEE examples"
-DESCRIPTION = "Open Portable Trusted Execution Environment - Sample Applications"
-HOMEPAGE = "https://github.com/linaro-swg/optee_examples"
+require optee-examples.inc
 
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=cd95ab417e23b94f381dafc453d70c30"
-
-DEPENDS = "optee-client optee-os python3-pycryptodomex-native"
-
-inherit python3native
-
-require optee.inc
-
-SRC_URI = "git://github.com/linaro-swg/optee_examples.git \
-           file://0001-make-Pass-ldflags-during-link.patch \
-           "
 SRCREV = "559b2141c16bf0f57ccd72f60e4deb84fc2a05b0"
-
-S = "${WORKDIR}/git"
-B = "${WORKDIR}/build"
-
-OPTEE_CLIENT_EXPORT = "${STAGING_DIR_HOST}${prefix}"
-TEEC_EXPORT = "${STAGING_DIR_HOST}${prefix}"
-TA_DEV_KIT_DIR = "${STAGING_INCDIR}/optee/export-user_ta"
-OPTEE_COMPILER = "${@d.getVar('TOOLCHAIN') or 'gcc'}"
-
-EXTRA_OEMAKE = " TA_DEV_KIT_DIR=${TA_DEV_KIT_DIR} \
-                 OPTEE_CLIENT_EXPORT=${OPTEE_CLIENT_EXPORT} \
-                 TEEC_EXPORT=${TEEC_EXPORT} \
-                 HOST_CROSS_COMPILE=${TARGET_PREFIX} \
-                 TA_CROSS_COMPILE=${TARGET_PREFIX} \
-                 COMPILER=${OPTEE_COMPILER} \
-                 LIBGCC_LOCATE_CFLAGS=--sysroot=${STAGING_DIR_HOST} \
-                 V=1 \
-                 OUTPUT_DIR=${B} \
-               "
-
-do_compile() {
-    cd ${S}
-    oe_runmake
-}
-do_compile[cleandirs] = "${B}"
-
-do_install () {
-    mkdir -p ${D}${nonarch_base_libdir}/optee_armtz
-    mkdir -p ${D}${bindir}
-    install -D -p -m0755 ${B}/ca/* ${D}${bindir}
-    install -D -p -m0444 ${B}/ta/* ${D}${nonarch_base_libdir}/optee_armtz
-}
-
-FILES_${PN} += "${nonarch_base_libdir}/optee_armtz/"
-
-# Imports machine specific configs from staging to build
-PACKAGE_ARCH = "${MACHINE_ARCH}"
diff --git a/meta-arm/recipes-security/optee/optee-os_3.10.0.bb b/meta-arm/recipes-security/optee/optee-os.inc
similarity index 90%
copy from meta-arm/recipes-security/optee/optee-os_3.10.0.bb
copy to meta-arm/recipes-security/optee/optee-os.inc
index adc8510..3094b35 100644
--- a/meta-arm/recipes-security/optee/optee-os_3.10.0.bb
+++ b/meta-arm/recipes-security/optee/optee-os.inc
@@ -12,12 +12,7 @@ DEPENDS = "python3-pycryptodome-native python3-pycryptodomex-native python3-pyel
 
 DEPENDS_append_toolchain-clang = " compiler-rt"
 
-SRCREV = "d1c635434c55b7d75eadf471bde04926bd1e50a7"
-SRC_URI = " \
-    git://github.com/OP-TEE/optee_os.git \
-    file://0006-allow-setting-sysroot-for-libgcc-lookup.patch \
-    file://0007-allow-setting-sysroot-for-clang.patch \
-"
+SRC_URI = "git://github.com/OP-TEE/optee_os.git"
 
 S = "${WORKDIR}/git"
 B = "${WORKDIR}/build"
@@ -30,16 +25,17 @@ OPTEE_ARCH_aarch64 = "arm64"
 OPTEE_CORE = "${@d.getVar('OPTEE_ARCH').upper()}"
 OPTEE_COMPILER = "${@d.getVar('TOOLCHAIN') or 'gcc'}"
 
+
 EXTRA_OEMAKE = " \
     PLATFORM=${OPTEEMACHINE} \
     CFG_${OPTEE_CORE}_core=y \
     CROSS_COMPILE_core=${HOST_PREFIX} \
     CROSS_COMPILE_ta_${OPTEE_ARCH}=${HOST_PREFIX} \
-    COMPILER=${OPTEE_COMPILER} \
     NOWERROR=1 \
     V=1 \
     ta-targets=ta_${OPTEE_ARCH} \
     LIBGCC_LOCATE_CFLAGS=--sysroot=${STAGING_DIR_HOST} \
+    COMPILER=${OPTEE_COMPILER} \
     O=${B} \
 "
 
@@ -86,3 +82,4 @@ FILES_${PN}-dev = "${includedir}/optee/"
 INSANE_SKIP_${PN}-dev = "staticdev"
 
 INHIBIT_PACKAGE_STRIP = "1"
+
diff --git a/meta-arm/recipes-security/optee/optee-os_3.10.0.bb b/meta-arm/recipes-security/optee/optee-os_3.10.0.bb
index adc8510..c3f7b12 100644
--- a/meta-arm/recipes-security/optee/optee-os_3.10.0.bb
+++ b/meta-arm/recipes-security/optee/optee-os_3.10.0.bb
@@ -1,88 +1,9 @@
-SUMMARY = "OP-TEE Trusted OS"
-DESCRIPTION = "Open Portable Trusted Execution Environment - Trusted side of the TEE"
-HOMEPAGE = "https://www.op-tee.org/"
-
-LICENSE = "BSD"
-LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=c1f21c4f72f372ef38a5a4aee55ec173"
-
-inherit deploy python3native
-require optee.inc
-
-DEPENDS = "python3-pycryptodome-native python3-pycryptodomex-native python3-pyelftools-native"
-
-DEPENDS_append_toolchain-clang = " compiler-rt"
+require optee-os.inc
 
 SRCREV = "d1c635434c55b7d75eadf471bde04926bd1e50a7"
-SRC_URI = " \
-    git://github.com/OP-TEE/optee_os.git \
+
+SRC_URI_append = " \
     file://0006-allow-setting-sysroot-for-libgcc-lookup.patch \
     file://0007-allow-setting-sysroot-for-clang.patch \
 "
 
-S = "${WORKDIR}/git"
-B = "${WORKDIR}/build"
-
-OPTEEMACHINE ?= "${MACHINE}"
-OPTEEMACHINE_aarch64_qemuall ?= "vexpress-qemu_armv8a"
-OPTEE_ARCH = "null"
-OPTEE_ARCH_armv7a = "arm32"
-OPTEE_ARCH_aarch64 = "arm64"
-OPTEE_CORE = "${@d.getVar('OPTEE_ARCH').upper()}"
-OPTEE_COMPILER = "${@d.getVar('TOOLCHAIN') or 'gcc'}"
-
-EXTRA_OEMAKE = " \
-    PLATFORM=${OPTEEMACHINE} \
-    CFG_${OPTEE_CORE}_core=y \
-    CROSS_COMPILE_core=${HOST_PREFIX} \
-    CROSS_COMPILE_ta_${OPTEE_ARCH}=${HOST_PREFIX} \
-    COMPILER=${OPTEE_COMPILER} \
-    NOWERROR=1 \
-    V=1 \
-    ta-targets=ta_${OPTEE_ARCH} \
-    LIBGCC_LOCATE_CFLAGS=--sysroot=${STAGING_DIR_HOST} \
-    O=${B} \
-"
-
-CFLAGS[unexport] = "1"
-LDFLAGS[unexport] = "1"
-CPPFLAGS[unexport] = "1"
-AS[unexport] = "1"
-LD[unexport] = "1"
-
-do_configure[noexec] = "1"
-
-do_compile() {
-    cd ${S}
-    oe_runmake all CFG_TEE_TA_LOG_LEVEL=0
-}
-do_compile[cleandirs] = "${B}"
-
-do_install() {
-    #install core in firmware
-    install -d ${D}${nonarch_base_libdir}/firmware/
-    install -m 644 ${B}/core/*.bin ${D}${nonarch_base_libdir}/firmware/
-
-    #install TA devkit
-    install -d ${D}${includedir}/optee/export-user_ta/
-    for f in ${B}/export-ta_${OPTEE_ARCH}/* ; do
-        cp -aR $f ${D}${includedir}/optee/export-user_ta/
-    done
-}
-
-PACKAGE_ARCH = "${MACHINE_ARCH}"
-
-do_deploy() {
-    install -d ${DEPLOYDIR}/optee
-    install -m 644 ${D}${nonarch_base_libdir}/firmware/* ${DEPLOYDIR}/optee/
-}
-
-addtask deploy before do_build after do_install
-
-SYSROOT_DIRS += "${nonarch_base_libdir}/firmware"
-
-FILES_${PN} = "${nonarch_base_libdir}/firmware/"
-FILES_${PN}-dev = "${includedir}/optee/"
-
-INSANE_SKIP_${PN}-dev = "staticdev"
-
-INHIBIT_PACKAGE_STRIP = "1"
diff --git a/meta-arm/recipes-security/optee/optee-os_3.8.0.bb b/meta-arm/recipes-security/optee/optee-os_3.8.0.bb
index 0001271..bc863d0 100644
--- a/meta-arm/recipes-security/optee/optee-os_3.8.0.bb
+++ b/meta-arm/recipes-security/optee/optee-os_3.8.0.bb
@@ -1,18 +1,8 @@
-SUMMARY = "OP-TEE Trusted OS"
-DESCRIPTION = "Open Portable Trusted Execution Environment - Trusted side of the TEE"
-HOMEPAGE = "https://www.op-tee.org/"
-
-LICENSE = "BSD"
-LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=c1f21c4f72f372ef38a5a4aee55ec173"
-
-inherit deploy python3native
-require optee.inc
-
-DEPENDS = "python3-pycryptodome-native python3-pycryptodomex-native python3-pyelftools-native"
+require optee-os.inc
 
 SRCREV = "023e33656e2c9557ce50ad63a98b2e2c9b51c118"
-SRC_URI = " \
-    git://github.com/OP-TEE/optee_os.git \
+
+SRC_URI_append = " \
     file://0001-mk-compile.mk-fix-cc-option-macro.patch \
     file://0002-Allow-use-of-cc-option-in-core-arch-arm-arm.mk.patch \
     file://0003-arm64-Disable-outline-atomics-when-compiling.patch \
@@ -21,69 +11,3 @@ SRC_URI = " \
     file://0006-allow-setting-sysroot-for-libgcc-lookup.patch \
     file://missing-mkdir.patch \
 "
-
-S = "${WORKDIR}/git"
-B = "${WORKDIR}/build"
-
-OPTEEMACHINE ?= "${MACHINE}"
-OPTEEMACHINE_aarch64_qemuall ?= "vexpress-qemu_armv8a"
-OPTEE_ARCH = "null"
-OPTEE_ARCH_armv7a = "arm32"
-OPTEE_ARCH_aarch64 = "arm64"
-OPTEE_CORE = "${@d.getVar('OPTEE_ARCH').upper()}"
-
-EXTRA_OEMAKE = " \
-    PLATFORM=${OPTEEMACHINE} \
-    CFG_${OPTEE_CORE}_core=y \
-    CROSS_COMPILE_core=${HOST_PREFIX} \
-    CROSS_COMPILE_ta_${OPTEE_ARCH}=${HOST_PREFIX} \
-    NOWERROR=1 \
-    V=1 \
-    ta-targets=ta_${OPTEE_ARCH} \
-    LIBGCC_LOCATE_CFLAGS=--sysroot=${STAGING_DIR_HOST} \
-    O=${B} \
-"
-
-CFLAGS[unexport] = "1"
-LDFLAGS[unexport] = "1"
-CPPFLAGS[unexport] = "1"
-AS[unexport] = "1"
-LD[unexport] = "1"
-
-do_configure[noexec] = "1"
-
-do_compile() {
-    cd ${S}
-    oe_runmake all CFG_TEE_TA_LOG_LEVEL=0
-}
-do_compile[cleandirs] = "${B}"
-
-do_install() {
-    #install core in firmware
-    install -d ${D}${nonarch_base_libdir}/firmware/
-    install -m 644 ${B}/core/*.bin ${D}${nonarch_base_libdir}/firmware/
-
-    #install TA devkit
-    install -d ${D}${includedir}/optee/export-user_ta/
-    for f in ${B}/export-ta_${OPTEE_ARCH}/* ; do
-        cp -aR $f ${D}${includedir}/optee/export-user_ta/
-    done
-}
-
-PACKAGE_ARCH = "${MACHINE_ARCH}"
-
-do_deploy() {
-    install -d ${DEPLOYDIR}/optee
-    install -m 644 ${D}${nonarch_base_libdir}/firmware/* ${DEPLOYDIR}/optee/
-}
-
-addtask deploy before do_build after do_install
-
-SYSROOT_DIRS += "${nonarch_base_libdir}/firmware"
-
-FILES_${PN} = "${nonarch_base_libdir}/firmware/"
-FILES_${PN}-dev = "${includedir}/optee/"
-
-INSANE_SKIP_${PN}-dev = "staticdev"
-
-INHIBIT_PACKAGE_STRIP = "1"
diff --git a/meta-arm/recipes-security/optee/optee-test_3.10.0.bb b/meta-arm/recipes-security/optee/optee-test.inc
similarity index 97%
copy from meta-arm/recipes-security/optee/optee-test_3.10.0.bb
copy to meta-arm/recipes-security/optee/optee-test.inc
index 6541de4..95ed311 100644
--- a/meta-arm/recipes-security/optee/optee-test_3.10.0.bb
+++ b/meta-arm/recipes-security/optee/optee-test.inc
@@ -10,10 +10,9 @@ require optee.inc
 
 DEPENDS = "optee-client optee-os python3-pycryptodomex-native"
 
-SRCREV = "30efcbeaf8864d0f2a5c4be593a5411001fab31b"
 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://0002-make-remove-Wno-unsafe-loop-for-clang.patch \ 
            file://0003-make-remove-Wmissing-noreturn-for-clang.patch \
           "
 
@@ -28,10 +27,10 @@ OPTEE_COMPILER = "${@d.getVar('TOOLCHAIN') or 'gcc'}"
 EXTRA_OEMAKE = " TA_DEV_KIT_DIR=${TA_DEV_KIT_DIR} \
                  OPTEE_CLIENT_EXPORT=${OPTEE_CLIENT_EXPORT} \
                  TEEC_EXPORT=${TEEC_EXPORT} \
+                 LIBGCC_LOCATE_CFLAGS=--sysroot=${STAGING_DIR_HOST} \
+                 COMPILER=${OPTEE_COMPILER} \
                  CROSS_COMPILE_HOST=${TARGET_PREFIX} \
                  CROSS_COMPILE_TA=${TARGET_PREFIX} \
-                 COMPILER=${OPTEE_COMPILER} \
-                 LIBGCC_LOCATE_CFLAGS=--sysroot=${STAGING_DIR_HOST} \
                  V=1 \
                  O=${B} \
                "
diff --git a/meta-arm/recipes-security/optee/optee-test_3.10.0.bb b/meta-arm/recipes-security/optee/optee-test_3.10.0.bb
index 6541de4..396f7cb 100644
--- a/meta-arm/recipes-security/optee/optee-test_3.10.0.bb
+++ b/meta-arm/recipes-security/optee/optee-test_3.10.0.bb
@@ -1,59 +1,3 @@
-SUMMARY = "OP-TEE sanity testsuite"
-DESCRIPTION = "Open Portable Trusted Execution Environment - Test suite"
-HOMEPAGE = "https://www.op-tee.org/"
-
-LICENSE = "BSD & GPLv2"
-LIC_FILES_CHKSUM = "file://${S}/LICENSE.md;md5=daa2bcccc666345ab8940aab1315a4fa"
-
-inherit python3native
-require optee.inc
-
-DEPENDS = "optee-client optee-os python3-pycryptodomex-native"
+require optee-test.inc
 
 SRCREV = "30efcbeaf8864d0f2a5c4be593a5411001fab31b"
-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 \
-          "
-
-S = "${WORKDIR}/git"
-B = "${WORKDIR}/build"
-
-OPTEE_CLIENT_EXPORT = "${STAGING_DIR_HOST}${prefix}"
-TEEC_EXPORT         = "${STAGING_DIR_HOST}${prefix}"
-TA_DEV_KIT_DIR      = "${STAGING_INCDIR}/optee/export-user_ta"
-OPTEE_COMPILER = "${@d.getVar('TOOLCHAIN') or 'gcc'}"
-
-EXTRA_OEMAKE = " TA_DEV_KIT_DIR=${TA_DEV_KIT_DIR} \
-                 OPTEE_CLIENT_EXPORT=${OPTEE_CLIENT_EXPORT} \
-                 TEEC_EXPORT=${TEEC_EXPORT} \
-                 CROSS_COMPILE_HOST=${TARGET_PREFIX} \
-                 CROSS_COMPILE_TA=${TARGET_PREFIX} \
-                 COMPILER=${OPTEE_COMPILER} \
-                 LIBGCC_LOCATE_CFLAGS=--sysroot=${STAGING_DIR_HOST} \
-                 V=1 \
-                 O=${B} \
-               "
-
-do_compile() {
-    cd ${S}
-    # Top level makefile doesn't seem to handle parallel make gracefully
-    oe_runmake xtest
-    oe_runmake ta
-}
-do_compile[cleandirs] = "${B}"
-
-do_install () {
-    install -D -p -m0755 ${B}/xtest/xtest ${D}${bindir}/xtest
-
-    # install path should match the value set in optee-client/tee-supplicant
-    # 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/
-}
-
-FILES_${PN} += "${nonarch_base_libdir}/optee_armtz/"
-
-# Imports machine specific configs from staging to build
-PACKAGE_ARCH = "${MACHINE_ARCH}"
diff --git a/meta-arm/recipes-security/optee/optee-test_3.8.0.bb b/meta-arm/recipes-security/optee/optee-test_3.8.0.bb
index 7f3d49b..8ea3348 100644
--- a/meta-arm/recipes-security/optee/optee-test_3.8.0.bb
+++ b/meta-arm/recipes-security/optee/optee-test_3.8.0.bb
@@ -1,59 +1,3 @@
-SUMMARY = "OP-TEE sanity testsuite"
-DESCRIPTION = "Open Portable Trusted Execution Environment - Test suite"
-HOMEPAGE = "https://www.op-tee.org/"
-
-LICENSE = "BSD & GPLv2"
-LIC_FILES_CHKSUM = "file://${S}/LICENSE.md;md5=daa2bcccc666345ab8940aab1315a4fa"
-
-inherit python3native
-require optee.inc
-
-DEPENDS = "optee-client optee-os python3-pycryptodomex-native"
+require optee-test.inc
 
 SRCREV = "30481e381cb4285706e7516853495a7699c93b2c"
-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 \
-          "
-
-S = "${WORKDIR}/git"
-B = "${WORKDIR}/build"
-
-OPTEE_CLIENT_EXPORT = "${STAGING_DIR_HOST}${prefix}"
-TEEC_EXPORT         = "${STAGING_DIR_HOST}${prefix}"
-TA_DEV_KIT_DIR      = "${STAGING_INCDIR}/optee/export-user_ta"
-OPTEE_COMPILER = "${@d.getVar('TOOLCHAIN') or 'gcc'}"
-
-EXTRA_OEMAKE = " TA_DEV_KIT_DIR=${TA_DEV_KIT_DIR} \
-                 OPTEE_CLIENT_EXPORT=${OPTEE_CLIENT_EXPORT} \
-                 TEEC_EXPORT=${TEEC_EXPORT} \
-                 CROSS_COMPILE_HOST=${TARGET_PREFIX} \
-                 CROSS_COMPILE_TA=${TARGET_PREFIX} \
-                 COMPILER=${OPTEE_COMPILER} \
-                 LIBGCC_LOCATE_CFLAGS=--sysroot=${STAGING_DIR_HOST} \
-                 V=1 \
-                 O=${B} \
-               "
-
-do_compile() {
-    cd ${S}
-    # Top level makefile doesn't seem to handle parallel make gracefully
-    oe_runmake xtest
-    oe_runmake ta
-}
-do_compile[cleandirs] = "${B}"
-
-do_install () {
-    install -D -p -m0755 ${B}/xtest/xtest ${D}${bindir}/xtest
-
-    # install path should match the value set in optee-client/tee-supplicant
-    # 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/
-}
-
-FILES_${PN} += "${nonarch_base_libdir}/optee_armtz/"
-
-# Imports machine specific configs from staging to build
-PACKAGE_ARCH = "${MACHINE_ARCH}"
-- 
2.17.1


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

* Re: [meta-arm] [PATCH v3 2/6] optee: upgraded recipes to 3.10
  2020-10-19  9:27 ` [PATCH v3 2/6] optee: upgraded recipes to 3.10 Brett Warren
@ 2020-10-19 13:25   ` Jon Mason
  0 siblings, 0 replies; 7+ messages in thread
From: Jon Mason @ 2020-10-19 13:25 UTC (permalink / raw)
  To: Brett Warren; +Cc: meta-arm

On Mon, Oct 19, 2020 at 10:27:08AM +0100, Brett Warren wrote:
> The optee recipes were upgraded due to issues booting with 3.8
> on qemuarm64-secureboot, which were resolved by the upgrade.
> The 3.8 recipes are retained for backwards compatibility.
> 
> optee-test and optee-examples were modified to pass a sysroot
> to the LIBGCC_LOCATE_CFLAGS parameter, to ensure proper location
> of the libgcc library.
> 
> Recipes have been renamed to reflect their current version.
> As this makes the PV variables redundent, these have been removed.
> 
> Change-Id: Iacaba02d64570a790d5cc20eca8be58246e39019
> Signed-off-by: Brett Warren <brett.warren@arm.com>
> ---

Still seeing fuzz on patch 0006-allow-setting-sysroot-for-libgcc-lookup.patch

>  .../{optee-client_git.bb => optee-client_3.10.0.bb}    |  4 +---
>  .../{optee-client_git.bb => optee-client_3.8.0.bb}     |  2 --
>  ...{optee-examples_git.bb => optee-examples_3.10.0.bb} |  5 ++---
>  .../{optee-examples_git.bb => optee-examples_3.8.0.bb} |  3 +--
>  .../optee/{optee-os_git.bb => optee-os_3.10.0.bb}      | 10 +---------
>  .../optee/{optee-os_git.bb => optee-os_3.8.0.bb}       |  2 --
>  .../optee/{optee-test_git.bb => optee-test_3.10.0.bb}  |  5 ++---
>  .../optee/{optee-test_git.bb => optee-test_3.8.0.bb}   |  3 +--
>  8 files changed, 8 insertions(+), 26 deletions(-)
>  copy meta-arm/recipes-security/optee/{optee-client_git.bb => optee-client_3.10.0.bb} (95%)
>  rename meta-arm/recipes-security/optee/{optee-client_git.bb => optee-client_3.8.0.bb} (98%)
>  copy meta-arm/recipes-security/optee/{optee-examples_git.bb => optee-examples_3.10.0.bb} (92%)
>  rename meta-arm/recipes-security/optee/{optee-examples_git.bb => optee-examples_3.8.0.bb} (95%)
>  copy meta-arm/recipes-security/optee/{optee-os_git.bb => optee-os_3.10.0.bb} (81%)
>  rename meta-arm/recipes-security/optee/{optee-os_git.bb => optee-os_3.8.0.bb} (98%)
>  copy meta-arm/recipes-security/optee/{optee-test_git.bb => optee-test_3.10.0.bb} (93%)
>  rename meta-arm/recipes-security/optee/{optee-test_git.bb => optee-test_3.8.0.bb} (96%)
> 
> diff --git a/meta-arm/recipes-security/optee/optee-client_git.bb b/meta-arm/recipes-security/optee/optee-client_3.10.0.bb
> similarity index 95%
> copy from meta-arm/recipes-security/optee/optee-client_git.bb
> copy to meta-arm/recipes-security/optee/optee-client_3.10.0.bb
> index 5dbbfe9..cbd3b93 100644
> --- a/meta-arm/recipes-security/optee/optee-client_git.bb
> +++ b/meta-arm/recipes-security/optee/optee-client_3.10.0.bb
> @@ -5,13 +5,11 @@ HOMEPAGE = "https://www.op-tee.org/"
>  LICENSE = "BSD"
>  LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=69663ab153298557a59c67a60a743e5b"
>  
> -PV = "3.8.0+git${SRCPV}"
> -
>  require optee.inc
>  
>  inherit python3native systemd update-rc.d
>  
> -SRCREV = "be4fa2e36f717f03ca46e574aa66f697a897d090"
> +SRCREV = "2a77cf88d956c34cb4a1c191bea6113e327f5fe0"
>  SRC_URI = " \
>      git://github.com/OP-TEE/optee_client.git \
>      file://tee-supplicant.service \
> diff --git a/meta-arm/recipes-security/optee/optee-client_git.bb b/meta-arm/recipes-security/optee/optee-client_3.8.0.bb
> similarity index 98%
> rename from meta-arm/recipes-security/optee/optee-client_git.bb
> rename to meta-arm/recipes-security/optee/optee-client_3.8.0.bb
> index 5dbbfe9..d43ebf4 100644
> --- a/meta-arm/recipes-security/optee/optee-client_git.bb
> +++ b/meta-arm/recipes-security/optee/optee-client_3.8.0.bb
> @@ -5,8 +5,6 @@ HOMEPAGE = "https://www.op-tee.org/"
>  LICENSE = "BSD"
>  LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=69663ab153298557a59c67a60a743e5b"
>  
> -PV = "3.8.0+git${SRCPV}"
> -
>  require optee.inc
>  
>  inherit python3native systemd update-rc.d
> diff --git a/meta-arm/recipes-security/optee/optee-examples_git.bb b/meta-arm/recipes-security/optee/optee-examples_3.10.0.bb
> similarity index 92%
> copy from meta-arm/recipes-security/optee/optee-examples_git.bb
> copy to meta-arm/recipes-security/optee/optee-examples_3.10.0.bb
> index 71be593..4a7db10 100644
> --- a/meta-arm/recipes-security/optee/optee-examples_git.bb
> +++ b/meta-arm/recipes-security/optee/optee-examples_3.10.0.bb
> @@ -5,8 +5,6 @@ HOMEPAGE = "https://github.com/linaro-swg/optee_examples"
>  LICENSE = "GPLv2"
>  LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=cd95ab417e23b94f381dafc453d70c30"
>  
> -PV = "3.8.0+git${SRCPV}"
> -
>  DEPENDS = "optee-client optee-os python3-pycryptodomex-native"
>  
>  inherit python3native
> @@ -16,7 +14,7 @@ require optee.inc
>  SRC_URI = "git://github.com/linaro-swg/optee_examples.git \
>             file://0001-make-Pass-ldflags-during-link.patch \
>             "
> -SRCREV = "559b2141c16bf0f57ccd72f60e4deb84fc2a05b0"
> +SRCREV = "c6eb00a9d83bf068a37e4806c97f582bb16e2973"
>  
>  S = "${WORKDIR}/git"
>  B = "${WORKDIR}/build"
> @@ -30,6 +28,7 @@ EXTRA_OEMAKE = " TA_DEV_KIT_DIR=${TA_DEV_KIT_DIR} \
>                   TEEC_EXPORT=${TEEC_EXPORT} \
>                   HOST_CROSS_COMPILE=${TARGET_PREFIX} \
>                   TA_CROSS_COMPILE=${TARGET_PREFIX} \
> +                 LIBGCC_LOCATE_CFLAGS=--sysroot=${STAGING_DIR_HOST} \
>                   V=1 \
>                   OUTPUT_DIR=${B} \
>                 "
> diff --git a/meta-arm/recipes-security/optee/optee-examples_git.bb b/meta-arm/recipes-security/optee/optee-examples_3.8.0.bb
> similarity index 95%
> rename from meta-arm/recipes-security/optee/optee-examples_git.bb
> rename to meta-arm/recipes-security/optee/optee-examples_3.8.0.bb
> index 71be593..7ed3dfa 100644
> --- a/meta-arm/recipes-security/optee/optee-examples_git.bb
> +++ b/meta-arm/recipes-security/optee/optee-examples_3.8.0.bb
> @@ -5,8 +5,6 @@ HOMEPAGE = "https://github.com/linaro-swg/optee_examples"
>  LICENSE = "GPLv2"
>  LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=cd95ab417e23b94f381dafc453d70c30"
>  
> -PV = "3.8.0+git${SRCPV}"
> -
>  DEPENDS = "optee-client optee-os python3-pycryptodomex-native"
>  
>  inherit python3native
> @@ -30,6 +28,7 @@ EXTRA_OEMAKE = " TA_DEV_KIT_DIR=${TA_DEV_KIT_DIR} \
>                   TEEC_EXPORT=${TEEC_EXPORT} \
>                   HOST_CROSS_COMPILE=${TARGET_PREFIX} \
>                   TA_CROSS_COMPILE=${TARGET_PREFIX} \
> +                 LIBGCC_LOCATE_CFLAGS=--sysroot=${STAGING_DIR_HOST} \
>                   V=1 \
>                   OUTPUT_DIR=${B} \
>                 "
> diff --git a/meta-arm/recipes-security/optee/optee-os_git.bb b/meta-arm/recipes-security/optee/optee-os_3.10.0.bb
> similarity index 81%
> copy from meta-arm/recipes-security/optee/optee-os_git.bb
> copy to meta-arm/recipes-security/optee/optee-os_3.10.0.bb
> index deeb515..369e011 100644
> --- a/meta-arm/recipes-security/optee/optee-os_git.bb
> +++ b/meta-arm/recipes-security/optee/optee-os_3.10.0.bb
> @@ -5,23 +5,15 @@ HOMEPAGE = "https://www.op-tee.org/"
>  LICENSE = "BSD"
>  LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=c1f21c4f72f372ef38a5a4aee55ec173"
>  
> -PV = "3.8.0+git${SRCPV}"
> -
>  inherit deploy python3native
>  require optee.inc
>  
>  DEPENDS = "python3-pycryptodome-native python3-pycryptodomex-native python3-pyelftools-native"
>  
> -SRCREV = "023e33656e2c9557ce50ad63a98b2e2c9b51c118"
> +SRCREV = "d1c635434c55b7d75eadf471bde04926bd1e50a7"
>  SRC_URI = " \
>      git://github.com/OP-TEE/optee_os.git \
> -    file://0001-mk-compile.mk-fix-cc-option-macro.patch \
> -    file://0002-Allow-use-of-cc-option-in-core-arch-arm-arm.mk.patch \
> -    file://0003-arm64-Disable-outline-atomics-when-compiling.patch \
> -    file://0004-Cleanup-unused-comp-cflags-sm-from-libgcc-lookup-com.patch \
> -    file://0005-Fixup-Allow-use-of-cc-option-in-core-arch-arm-arm.mk.patch \
>      file://0006-allow-setting-sysroot-for-libgcc-lookup.patch \
> -    file://missing-mkdir.patch \
>  "
>  
>  S = "${WORKDIR}/git"
> diff --git a/meta-arm/recipes-security/optee/optee-os_git.bb b/meta-arm/recipes-security/optee/optee-os_3.8.0.bb
> similarity index 98%
> rename from meta-arm/recipes-security/optee/optee-os_git.bb
> rename to meta-arm/recipes-security/optee/optee-os_3.8.0.bb
> index deeb515..0001271 100644
> --- a/meta-arm/recipes-security/optee/optee-os_git.bb
> +++ b/meta-arm/recipes-security/optee/optee-os_3.8.0.bb
> @@ -5,8 +5,6 @@ HOMEPAGE = "https://www.op-tee.org/"
>  LICENSE = "BSD"
>  LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=c1f21c4f72f372ef38a5a4aee55ec173"
>  
> -PV = "3.8.0+git${SRCPV}"
> -
>  inherit deploy python3native
>  require optee.inc
>  
> diff --git a/meta-arm/recipes-security/optee/optee-test_git.bb b/meta-arm/recipes-security/optee/optee-test_3.10.0.bb
> similarity index 93%
> copy from meta-arm/recipes-security/optee/optee-test_git.bb
> copy to meta-arm/recipes-security/optee/optee-test_3.10.0.bb
> index 957286c..96e612a 100644
> --- a/meta-arm/recipes-security/optee/optee-test_git.bb
> +++ b/meta-arm/recipes-security/optee/optee-test_3.10.0.bb
> @@ -10,9 +10,7 @@ require optee.inc
>  
>  DEPENDS = "optee-client optee-os python3-pycryptodomex-native"
>  
> -PV = "3.8.0+git${SRCPV}"
> -
> -SRCREV = "30481e381cb4285706e7516853495a7699c93b2c"
> +SRCREV = "30efcbeaf8864d0f2a5c4be593a5411001fab31b"
>  SRC_URI = "git://github.com/OP-TEE/optee_test.git \
>             file://0001-host-xtest-Adjust-order-of-including-compiler.h.patch \
>            "
> @@ -29,6 +27,7 @@ EXTRA_OEMAKE = " TA_DEV_KIT_DIR=${TA_DEV_KIT_DIR} \
>                   TEEC_EXPORT=${TEEC_EXPORT} \
>                   CROSS_COMPILE_HOST=${TARGET_PREFIX} \
>                   CROSS_COMPILE_TA=${TARGET_PREFIX} \
> +                 LIBGCC_LOCATE_CFLAGS=--sysroot=${STAGING_DIR_HOST} \
>                   V=1 \
>                   O=${B} \
>                 "
> diff --git a/meta-arm/recipes-security/optee/optee-test_git.bb b/meta-arm/recipes-security/optee/optee-test_3.8.0.bb
> similarity index 96%
> rename from meta-arm/recipes-security/optee/optee-test_git.bb
> rename to meta-arm/recipes-security/optee/optee-test_3.8.0.bb
> index 957286c..65e6cd1 100644
> --- a/meta-arm/recipes-security/optee/optee-test_git.bb
> +++ b/meta-arm/recipes-security/optee/optee-test_3.8.0.bb
> @@ -10,8 +10,6 @@ require optee.inc
>  
>  DEPENDS = "optee-client optee-os python3-pycryptodomex-native"
>  
> -PV = "3.8.0+git${SRCPV}"
> -
>  SRCREV = "30481e381cb4285706e7516853495a7699c93b2c"
>  SRC_URI = "git://github.com/OP-TEE/optee_test.git \
>             file://0001-host-xtest-Adjust-order-of-including-compiler.h.patch \
> @@ -29,6 +27,7 @@ EXTRA_OEMAKE = " TA_DEV_KIT_DIR=${TA_DEV_KIT_DIR} \
>                   TEEC_EXPORT=${TEEC_EXPORT} \
>                   CROSS_COMPILE_HOST=${TARGET_PREFIX} \
>                   CROSS_COMPILE_TA=${TARGET_PREFIX} \
> +                 LIBGCC_LOCATE_CFLAGS=--sysroot=${STAGING_DIR_HOST} \
>                   V=1 \
>                   O=${B} \
>                 "
> -- 
> 2.17.1
> 

> 
> 
> 


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

end of thread, other threads:[~2020-10-19 13:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-19  9:27 [PATCH v3 1/6] qemuarm64-secureboot: changed format of memory to MB Brett Warren
2020-10-19  9:27 ` [PATCH v3 2/6] optee: upgraded recipes to 3.10 Brett Warren
2020-10-19 13:25   ` [meta-arm] " Jon Mason
2020-10-19  9:27 ` [PATCH v3 3/6] optee: enable clang support Brett Warren
2020-10-19  9:27 ` [PATCH v3 4/6] trusted-firmware-a: " Brett Warren
2020-10-19  9:27 ` [PATCH v3 5/6] wic/qemuarm64: enabled kernel arguments with u-boot Brett Warren
2020-10-19  9:27 ` [PATCH v3 6/6] optee: refactor into .inc files Brett Warren

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.