From: Tom Hochstein Date: Tue, 16 Mar 2021 12:43:20 +0000 (-0500) Subject: optee-imx: Upgrade to 3.10.0 X-Git-Url: https://code.ossystems.io/gitweb?a=commitdiff_plain;h=be6a39f2faf605330a0ae9a33430e1112ac4d3f5;p=meta-freescale.git optee-imx: Upgrade to 3.10.0 Update all recipes to pull sources from imx_5.4.70_2.3.0 branch in NXP upstream and update SRCREV to match release tags. Update PREFERRED_VERSION of optee for mx8 to point to 3.10.0.imx. Following notes are additions to the version update of recipes: -------------------------- optee-client: - Drop CFLAGS patch as it is already applied upstream optee-os: - Drop gcc10 patch as it is already applied upstream - Add dependency on python3-pycryptodomex-native - Drop NOWERROR flag as package is reworked to disable warnings by default - Rework mkimage load address since tee-init_load_addr.txt is no longer created optee-test: - Drop python3 patch as it is already applied upstream - Remove unused patch files from layer - Add dependency on python3-pycryptodomex-native - Add sysroot to C and C++ flags Fixes #686, fixes #689. Signed-off-by: Tom Hochstein --- diff --git a/conf/machine/include/imx-base.inc b/conf/machine/include/imx-base.inc index 664cfb4f..c0ee3fbc 100644 --- a/conf/machine/include/imx-base.inc +++ b/conf/machine/include/imx-base.inc @@ -335,9 +335,9 @@ PREFERRED_VERSION_libdrm_mx7 ?= "2.4.102.imx" PREFERRED_VERSION_libdrm_mx8 ?= "2.4.102.imx" # Use i.MX optee Version -PREFERRED_VERSION_optee-os_mx8 ?= "3.7.0.imx" -PREFERRED_VERSION_optee-client_mx8 ?= "3.7.0.imx" -PREFERRED_VERSION_optee-test_mx8 ?= "3.7.0.imx" +PREFERRED_VERSION_optee-os_mx8 ?= "3.10.0.imx" +PREFERRED_VERSION_optee-client_mx8 ?= "3.10.0.imx" +PREFERRED_VERSION_optee-test_mx8 ?= "3.10.0.imx" #Use i.MX opencv Version for mx8 PREFERRED_VERSION_opencv_mx8 ?= "4.4.0.imx" diff --git a/recipes-security/optee-imx/optee-client/0001-flags-do-not-override-CFLAGS-from-host.patch b/recipes-security/optee-imx/optee-client/0001-flags-do-not-override-CFLAGS-from-host.patch deleted file mode 100644 index 9c6b1069..00000000 --- a/recipes-security/optee-imx/optee-client/0001-flags-do-not-override-CFLAGS-from-host.patch +++ /dev/null @@ -1,57 +0,0 @@ -From 591461d6efe51989b4a7f4e875cdf37505eba360 Mon Sep 17 00:00:00 2001 -From: Andrey Zhizhikin -Date: Thu, 4 Jun 2020 19:24:05 +0000 -Subject: [PATCH] flags: do not override CFLAGS from host - -Some build systems set CFLAGS in environment before the build, but they -got overridden by CFLAGS immediate assignment operator. - -Replace immediate assignment with append directive and use override -directive, so the former definition of CFLAGS gets passed either from -command line or via environment is completely expanded (see [1] for -detailed explanation of override directive and variable append). - -Link: [1] https://www.gnu.org/software/make/manual/html_node/Override-Directive.html - -Upstream-Status: Backport [https://github.com/OP-TEE/optee_client/pull/211] - -Signed-off-by: Andrey Zhizhikin -Reviewed-by: Jerome Forissier -Reviewed-by: Joakim Bech ---- - flags.mk | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/flags.mk b/flags.mk -index c2f0e1c..65192bc 100644 ---- a/flags.mk -+++ b/flags.mk -@@ -6,7 +6,7 @@ CROSS_COMPILE ?= arm-linux-gnueabihf- - CC ?= $(CROSS_COMPILE)gcc - AR ?= $(CROSS_COMPILE)ar - --CFLAGS := -Wall -Wbad-function-cast -Wcast-align \ -+override CFLAGS += -Wall -Wbad-function-cast -Wcast-align \ - -Werror-implicit-function-declaration -Wextra \ - -Wfloat-equal -Wformat-nonliteral -Wformat-security \ - -Wformat=2 -Winit-self -Wmissing-declarations \ -@@ -16,13 +16,13 @@ CFLAGS := -Wall -Wbad-function-cast -Wcast-align \ - -Wswitch-default -Wunsafe-loop-optimizations \ - -Wwrite-strings -D_FILE_OFFSET_BITS=64 - ifeq ($(CFG_WERROR),y) --CFLAGS += -Werror -+override CFLAGS += -Werror - endif --CFLAGS += -c -fPIC -+override CFLAGS += -c -fPIC - - DEBUG ?= 0 - ifeq ($(DEBUG), 1) --CFLAGS += -DDEBUG -O0 -g -+override CFLAGS += -DDEBUG -O0 -g - endif - - RM := rm -f --- -2.17.1 - diff --git a/recipes-security/optee-imx/optee-client_3.7.0.imx.bb b/recipes-security/optee-imx/optee-client_3.10.0.imx.bb similarity index 78% rename from recipes-security/optee-imx/optee-client_3.7.0.imx.bb rename to recipes-security/optee-imx/optee-client_3.10.0.imx.bb index d83f8a9c..58b6b8a4 100644 --- a/recipes-security/optee-imx/optee-client_3.7.0.imx.bb +++ b/recipes-security/optee-imx/optee-client_3.10.0.imx.bb @@ -1,23 +1,23 @@ -# Copyright (C) 2017-2018 NXP +# Copyright (C) 2017-2020 NXP SUMMARY = "OPTEE Client libs" HOMEPAGE = "http://www.optee.org/" LICENSE = "BSD" LIC_FILES_CHKSUM = "file://LICENSE;md5=69663ab153298557a59c67a60a743e5b" -inherit python3native systemd - -SRCBRANCH = "imx_5.4.24_2.1.0" -SRC_URI = "git://source.codeaurora.org/external/imx/imx-optee-client.git;protocol=https;branch=${SRCBRANCH}" - -SRCREV = "bc0ec8ce1e4dc5ae23f4737ef659338b7cd408fe" - -SRC_URI += "file://tee-supplicant.service \ - file://0001-flags-do-not-override-CFLAGS-from-host.patch \ +SRCBRANCH = "imx_5.4.70_2.3.0" +SRC_URI = " \ + git://source.codeaurora.org/external/imx/imx-optee-client.git;protocol=https;branch=${SRCBRANCH} \ + file://tee-supplicant.service \ " +SRCREV = "2a77cf88d956c34cb4a1c191bea6113e327f5fe0" + S = "${WORKDIR}/git" B = "${WORKDIR}/build" + +inherit python3native systemd + SYSTEMD_SERVICE_${PN} = "tee-supplicant.service" OPTEE_ARCH ?= "arm32" diff --git a/recipes-security/optee-imx/optee-os/0001-optee-os-fix-gcc10-compilation-issue-and-missing-cc-.patch b/recipes-security/optee-imx/optee-os/0001-optee-os-fix-gcc10-compilation-issue-and-missing-cc-.patch deleted file mode 100644 index ab42d340..00000000 --- a/recipes-security/optee-imx/optee-os/0001-optee-os-fix-gcc10-compilation-issue-and-missing-cc-.patch +++ /dev/null @@ -1,162 +0,0 @@ -From 109ed8d9a5351c7bb0fdc0953c7e7fb6cedcad9c Mon Sep 17 00:00:00 2001 -From: Andrey Zhizhikin -Date: Sat, 30 May 2020 22:00:59 +0000 -Subject: [PATCH] optee-os: fix gcc10 compilation issue and missing cc-options - -Backport PR 3891 from upstream to imx fork, which addressed compilation -failure when GCC10 is used. - -Additional changes ported fixed cc-options macro, which allows to query -compiler used if the desired option exists before it could be set. This -solves also the build issues when GCC9 is used to build this component. - -Upstream-Status: Backport [https://github.com/OP-TEE/optee_os/pull/3891] - -Signed-off-by: Andrey Zhizhikin ---- - core/arch/arm/arm.mk | 22 +++++++++++++++++----- - core/core.mk | 5 +---- - mk/cc-option.mk | 9 +++++++++ - mk/gcc.mk | 2 +- - ta/mk/ta_dev_kit.mk | 3 +++ - ta/ta.mk | 1 + - 6 files changed, 32 insertions(+), 10 deletions(-) - create mode 100644 mk/cc-option.mk - -diff --git a/core/arch/arm/arm.mk b/core/arch/arm/arm.mk -index 5defb327..fffa491a 100644 ---- a/core/arch/arm/arm.mk -+++ b/core/arch/arm/arm.mk -@@ -1,3 +1,16 @@ -+# Setup compiler for the core module -+ifeq ($(CFG_ARM64_core),y) -+arch-bits-core := 64 -+else -+arch-bits-core := 32 -+endif -+CROSS_COMPILE_core := $(CROSS_COMPILE$(arch-bits-core)) -+COMPILER_core := $(COMPILER) -+include mk/$(COMPILER_core).mk -+ -+# Defines the cc-option macro using the compiler set for the core module -+include mk/cc-option.mk -+ - CFG_LTC_OPTEE_THREAD ?= y - # Size of emulated TrustZone protected SRAM, 448 kB. - # Only applicable when paging is enabled. -@@ -106,7 +119,7 @@ arm32-platform-aflags-no-hard-float ?= - - arm64-platform-cflags-no-hard-float ?= -mgeneral-regs-only - arm64-platform-cflags-hard-float ?= --arm64-platform-cflags-generic ?= -mstrict-align -+arm64-platform-cflags-generic := -mstrict-align $(call cc-option,-mno-outline-atomics,) - - ifeq ($(DEBUG),1) - # For backwards compatibility -@@ -135,14 +148,12 @@ core-platform-aflags += $(platform-aflags-generic) - core-platform-aflags += $(platform-aflags-debug-info) - - ifeq ($(CFG_ARM64_core),y) --arch-bits-core := 64 - core-platform-cppflags += $(arm64-platform-cppflags) - core-platform-cflags += $(arm64-platform-cflags) - core-platform-cflags += $(arm64-platform-cflags-generic) - core-platform-cflags += $(arm64-platform-cflags-no-hard-float) - core-platform-aflags += $(arm64-platform-aflags) - else --arch-bits-core := 32 - core-platform-cppflags += $(arm32-platform-cppflags) - core-platform-cflags += $(arm32-platform-cflags) - core-platform-cflags += $(arm32-platform-cflags-no-hard-float) -@@ -241,8 +252,9 @@ ta-mk-file-export-add-ta_arm64 += COMPILER ?= gcc_nl_ - ta-mk-file-export-add-ta_arm64 += COMPILER_ta_arm64 ?= $$(COMPILER)_nl_ - endif - --# Set cross compiler prefix for each submodule --$(foreach sm, core $(ta-targets), $(eval CROSS_COMPILE_$(sm) ?= $(CROSS_COMPILE$(arch-bits-$(sm))))) -+# Set cross compiler prefix for each TA target -+$(foreach sm, $(ta-targets), $(eval CROSS_COMPILE_$(sm) ?= $(CROSS_COMPILE$(arch-bits-$(sm))))) -+ - - arm32-sysreg-txt = core/arch/arm/kernel/arm32_sysreg.txt - arm32-sysregs-$(arm32-sysreg-txt)-h := arm32_sysreg.h -diff --git a/core/core.mk b/core/core.mk -index a51cf847..28c7235c 100644 ---- a/core/core.mk -+++ b/core/core.mk -@@ -8,6 +8,7 @@ arch-dir := core/arch/$(ARCH) - platform-dir := $(arch-dir)/plat-$(PLATFORM) - include $(platform-dir)/conf.mk - include mk/config.mk -+# $(ARCH).mk also sets the compiler for the core module - include core/arch/$(ARCH)/$(ARCH).mk - - PLATFORM_$(PLATFORM) := y -@@ -16,10 +17,6 @@ PLATFORM_FLAVOR_$(PLATFORM_FLAVOR) := y - $(eval $(call cfg-depends-all,CFG_PAGED_USER_TA,CFG_WITH_PAGER CFG_WITH_USER_TA)) - include core/crypto.mk - --# Setup compiler for this sub module --COMPILER_$(sm) ?= $(COMPILER) --include mk/$(COMPILER_$(sm)).mk -- - cppflags$(sm) += -D__KERNEL__ - - cppflags$(sm) += -Icore/include -diff --git a/mk/cc-option.mk b/mk/cc-option.mk -new file mode 100644 -index 00000000..4699fbcc ---- /dev/null -+++ b/mk/cc-option.mk -@@ -0,0 +1,9 @@ -+_cc-option-supported = $(if $(shell $(CC$(sm)) $(1) -c -x c /dev/null -o /dev/null 2>/dev/null >/dev/null || echo "Not supported"),,1) -+_cc-opt-cached-var-name = $(subst =,~,$(strip cached-cc-option-$(1)-$(subst $(empty) $(empty),,$(CC$(sm))))) -+define _cc-option -+$(eval _var_name := $(call _cc-opt-cached-var-name,$(1))) -+$(eval $(_var_name) := $(if $(filter $(origin $(_var_name)),undefined),$(call _cc-option-supported,$(1)),$($(_var_name)))) -+$(if $($(_var_name)),$(1),$(2)) -+endef -+cc-option = $(strip $(call _cc-option,$(1),$(2))) -+ -diff --git a/mk/gcc.mk b/mk/gcc.mk -index 1f2c5990..c53a23b1 100644 ---- a/mk/gcc.mk -+++ b/mk/gcc.mk -@@ -12,7 +12,7 @@ nostdinc$(sm) := -nostdinc -isystem $(shell $(CC$(sm)) \ - -print-file-name=include 2> /dev/null) - - # Get location of libgcc from gcc --libgcc$(sm) := $(shell $(CC$(sm)) $(CFLAGS$(arch-bits-$(sm))) $(comp-cflags$(sm)) \ -+libgcc$(sm) := $(shell $(CC$(sm)) $(CFLAGS$(arch-bits-$(sm))) \ - -print-libgcc-file-name 2> /dev/null) - - # Define these to something to discover accidental use -diff --git a/ta/mk/ta_dev_kit.mk b/ta/mk/ta_dev_kit.mk -index 04a4f94b..e4b02ea7 100644 ---- a/ta/mk/ta_dev_kit.mk -+++ b/ta/mk/ta_dev_kit.mk -@@ -92,6 +92,9 @@ clean: - @$(cmd-echo-silent) ' CLEAN $(O)' - ${q}if [ -d "$(O)" ]; then $(RMDIR) $(O); fi - -+include $(ta-dev-kit-dir$(sm))/mk/$(COMPILER_$(sm)).mk -+include $(ta-dev-kit-dir$(sm))/mk/cc-option.mk -+ - subdirs = . - include $(ta-dev-kit-dir$(sm))/mk/subdir.mk - -diff --git a/ta/ta.mk b/ta/ta.mk -index dde7be67..ca17054a 100644 ---- a/ta/ta.mk -+++ b/ta/ta.mk -@@ -157,6 +157,7 @@ $(foreach f, $(libfiles), \ - - # Copy .mk files - ta-mkfiles = mk/compile.mk mk/subdir.mk mk/gcc.mk mk/clang.mk mk/cleandirs.mk \ -+ mk/cc-option.mk \ - ta/arch/$(ARCH)/link.mk ta/arch/$(ARCH)/link_shlib.mk \ - ta/mk/ta_dev_kit.mk - --- -2.17.1 - diff --git a/recipes-security/optee-imx/optee-os_3.7.0.imx.bb b/recipes-security/optee-imx/optee-os_3.10.0.imx.bb similarity index 90% rename from recipes-security/optee-imx/optee-os_3.7.0.imx.bb rename to recipes-security/optee-imx/optee-os_3.10.0.imx.bb index c9cdd39d..f9399496 100644 --- a/recipes-security/optee-imx/optee-os_3.7.0.imx.bb +++ b/recipes-security/optee-imx/optee-os_3.10.0.imx.bb @@ -6,21 +6,21 @@ HOMEPAGE = "http://www.optee.org/" LICENSE = "BSD" LIC_FILES_CHKSUM = "file://LICENSE;md5=c1f21c4f72f372ef38a5a4aee55ec173" -inherit deploy python3native autotools -DEPENDS = "python3-pycrypto-native python3-pyelftools-native u-boot-mkimage-native" +DEPENDS = "python3-pycrypto-native python3-pycryptodomex-native python3-pyelftools-native u-boot-mkimage-native" -SRCBRANCH = "imx_5.4.24_2.1.0" +SRCBRANCH = "imx_5.4.70_2.3.0" SRC_URI = "\ git://source.codeaurora.org/external/imx/imx-optee-os.git;protocol=https;branch=${SRCBRANCH} \ - file://0001-optee-os-fix-gcc10-compilation-issue-and-missing-cc-.patch \ " -SRCREV = "7a49776de59265500f10a247125429fde1555ac1" +SRCREV = "a991c90475bb1c715651e5fe27f7f32cbe61aef9" S = "${WORKDIR}/git" B = "${WORKDIR}/build.${PLATFORM_FLAVOR}" +inherit deploy python3native autotools + # The platform flavor corresponds to the Yocto machine without the leading 'i'. PLATFORM_FLAVOR = "${@d.getVar('MACHINE')[1:]}" PLATFORM_FLAVOR_imx6qpdlsolox = "mx6qsabresd" @@ -51,7 +51,6 @@ EXTRA_OEMAKE = " \ PLATFORM_FLAVOR=${PLATFORM_FLAVOR} \ CROSS_COMPILE=${HOST_PREFIX} \ CROSS_COMPILE64=${HOST_PREFIX} \ - NOWERROR=1 \ LDFLAGS= \ O=${B} \ " @@ -68,7 +67,7 @@ do_deploy () { ${TARGET_PREFIX}objcopy -O binary ${B}/core/tee.elf ${DEPLOYDIR}/tee.${PLATFORM_FLAVOR}.bin if [ "${OPTEE_ARCH}" != "arm64" ]; then - IMX_LOAD_ADDR=`cat ${B}/core/tee-init_load_addr.txt` && \ + IMX_LOAD_ADDR=`${TARGET_PREFIX}readelf -h ${B}/core/tee.elf | grep "Entry point address" | awk '{print $4}'` uboot-mkimage -A arm -O linux -C none -a ${IMX_LOAD_ADDR} -e ${IMX_LOAD_ADDR} \ -d ${DEPLOYDIR}/tee.${PLATFORM_FLAVOR}.bin ${DEPLOYDIR}/uTee-${OPTEE_BIN_EXT} fi diff --git a/recipes-security/optee-imx/optee-test/0001-use-python3-instead-of-python.patch b/recipes-security/optee-imx/optee-test/0001-use-python3-instead-of-python.patch deleted file mode 100644 index 20f190af..00000000 --- a/recipes-security/optee-imx/optee-test/0001-use-python3-instead-of-python.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 6271160639002a2580d80b75b5397a96d56329f2 Mon Sep 17 00:00:00 2001 -From: Scott Branden -Date: Fri, 27 Dec 2019 12:54:28 -0800 -Subject: [PATCH] use python3 instead of python - -use python3 instead of python as python2 is EOL January 2020. - -Signed-off-by: Scott Branden -Reviewed-by: Jerome Forissier -Tested-by: Jerome Forissier (QEMU, CFG_GCM_NIST_VECTORS=y) -Upstream-Status: Backport from v3.8.0 ---- - scripts/file_to_c.py | 4 ++-- - scripts/rsp_to_gcm_test.py | 2 +- - 2 files changed, 3 insertions(+), 3 deletions(-) - -diff --git a/scripts/file_to_c.py b/scripts/file_to_c.py -index ae16f52..b4ce2a2 100755 ---- a/scripts/file_to_c.py -+++ b/scripts/file_to_c.py -@@ -1,4 +1,4 @@ --#!/usr/bin/env python -+#!/usr/bin/env python3 - # SPDX-License-Identifier: BSD-2-Clause - # - # Copyright (c) 2018, Linaro Limited -@@ -29,7 +29,7 @@ def main(): - - f.write("const uint8_t " + args.name + "[] = {\n") - i = 0 -- for x in array.array("B", inf.read()): -+ for x in array.array("B", map(ord, (inf.read()))): - f.write("0x" + '{0:02x}'.format(x) + ",") - i = i + 1 - if i % 8 == 0: -diff --git a/scripts/rsp_to_gcm_test.py b/scripts/rsp_to_gcm_test.py -index 0543541..e4418be 100755 ---- a/scripts/rsp_to_gcm_test.py -+++ b/scripts/rsp_to_gcm_test.py -@@ -1,4 +1,4 @@ --#!/usr/bin/env python -+#!/usr/bin/env python3 - - modes = {'encrypt': 0, 'decrypt': 1} - --- -2.7.4 - diff --git a/recipes-security/optee-imx/optee-test/0003-sock_server-fix-compilation-against-musl-sys-errno.h.patch b/recipes-security/optee-imx/optee-test/0003-sock_server-fix-compilation-against-musl-sys-errno.h.patch deleted file mode 100644 index d32a8eb7..00000000 --- a/recipes-security/optee-imx/optee-test/0003-sock_server-fix-compilation-against-musl-sys-errno.h.patch +++ /dev/null @@ -1,41 +0,0 @@ -From dc8cd1c43edeedb9f7335020537c4ffdddd683f8 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Andr=C3=A9=20Draszik?= -Date: Thu, 7 Feb 2019 01:26:53 +0000 -Subject: [PATCH 1/3] sock_server: fix compilation against musl (sys/errno.h) -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Compiling against musl-libc fails with the following error: - -| In file included from .../host/xtest/sock_server.c:24: -| .../usr/include/sys/errno.h:1:2: error: #warning redirecting incorrect #include to [-Werror=cpp] -| #warning redirecting incorrect #include to -| ^~~~~~~ - -Just remove the needless include. - -Signed-off-by: André Draszik -Acked-by: Jens Wiklander -Reviewed-by: Jerome Forissier ---- -Signed-off-by: André Draszik -Upstream-Status: Backport [3.5.0] - host/xtest/sock_server.c | 1 - - 1 file changed, 1 deletion(-) - -diff --git a/host/xtest/sock_server.c b/host/xtest/sock_server.c -index 0d2ff06..1ba73d6 100644 ---- a/host/xtest/sock_server.c -+++ b/host/xtest/sock_server.c -@@ -21,7 +21,6 @@ - #include - #include - #include --#include - #include - #include - --- -2.23.0.rc1 - diff --git a/recipes-security/optee-imx/optee-test/0004-build-ignore-declaration-after-statement-warnings.patch b/recipes-security/optee-imx/optee-test/0004-build-ignore-declaration-after-statement-warnings.patch deleted file mode 100644 index ed45df60..00000000 --- a/recipes-security/optee-imx/optee-test/0004-build-ignore-declaration-after-statement-warnings.patch +++ /dev/null @@ -1,62 +0,0 @@ -From 1401b89684ee81bf0b3d3dea06e2926b24ba3f97 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Andr=C3=A9=20Draszik?= -Date: Thu, 7 Feb 2019 01:29:08 +0000 -Subject: [PATCH 2/3] build: ignore declaration-after-statement warnings -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -| Makefile:37: recipe for target 'xtest' failed -| make: *** [xtest] Error 2 -| make: *** Waiting for unfinished jobs.... -| arith_taf.c: In function 'get_handle': -| arith_taf.c:56:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] -| int h = handle_get(&hdb, ptr); -| ^~~ -| arith_taf.c: In function 'ta_entry_arith_new_var': -| arith_taf.c:82:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] -| size_t len = TEE_BigIntSizeInU32(params[0].value.a); -| ^~~~~~ -| arith_taf.c: In function 'ta_entry_arith_new_fmm_var': -| arith_taf.c:129:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] -| size_t len = TEE_BigIntFMMSizeInU32(params[0].value.a); -| ^~~~~~ -| arith_taf.c: In function 'ta_entry_arith_free_handle': -| arith_taf.c:150:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] -| void *ptr = put_handle(params[0].value.a & ~HT_MASK); -| ^~~~ -| arith_taf.c: In function 'ta_entry_arith_from_octet_string': -| arith_taf.c:165:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] -| TEE_BigInt *big_int = lookup_handle(HT_BIGINT, params[0].value.a); -| ^~~~~~~~~~ -| arith_taf.c: In function 'ta_entry_arith_from_s32': -| arith_taf.c:181:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] -| TEE_BigInt *big_int = lookup_handle(HT_BIGINT, params[0].value.a); -| ^~~~~~~~~~ - -etc. - -Signed-off-by: André Draszik -Acked-by: Jens Wiklander -Reviewed-by: Jerome Forissier ---- -Signed-off-by: André Draszik -Upstream-Status: Backport [3.5.0] - host/xtest/Makefile | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/host/xtest/Makefile b/host/xtest/Makefile -index f4291e0..e97e555 100644 ---- a/host/xtest/Makefile -+++ b/host/xtest/Makefile -@@ -154,6 +154,7 @@ CFLAGS += -Wall -Wcast-align -Werror \ - -Wmissing-prototypes -Wnested-externs -Wpointer-arith \ - -Wshadow -Wstrict-prototypes -Wswitch-default \ - -Wwrite-strings \ -+ -Wno-declaration-after-statement \ - -Wno-missing-field-initializers -Wno-format-zero-length - endif - --- -2.23.0.rc1 - diff --git a/recipes-security/optee-imx/optee-test/0005-benchmark_1000-fix-compilation-against-musl-uint.patch b/recipes-security/optee-imx/optee-test/0005-benchmark_1000-fix-compilation-against-musl-uint.patch deleted file mode 100644 index 58734aa4..00000000 --- a/recipes-security/optee-imx/optee-test/0005-benchmark_1000-fix-compilation-against-musl-uint.patch +++ /dev/null @@ -1,57 +0,0 @@ -From f74e9f339a8e8cb97fc8ea03bef51d7e3862a60a Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Andr=C3=A9=20Draszik?= -Date: Thu, 7 Feb 2019 01:31:27 +0000 -Subject: [PATCH 3/3] benchmark_1000: fix compilation against musl (uint) -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Compiling against musl-libc fails with the following error: - -| .../host/xtest/benchmark_1000.c: In function 'show_test_result': -| .../host/xtest/benchmark_1000.c:102:2: error: unknown type name 'uint'; did you mean 'int'? -| uint i; -| ^~~~ -| int -| ...host/xtest/benchmark_1000.c:108:16: error: comparison of integer expressions of different signedness: 'int' and 'size_t' {aka 'unsigned int'} [-Werror=sign-compare] -| for (i = 0; i < size; i++) { -| ^ - -etc. - -Convert to using more standard size_t - -Signed-off-by: André Draszik -Acked-by: Jens Wiklander -Reviewed-by: Jerome Forissier ---- -Signed-off-by: André Draszik -Upstream-Status: Backport [3.5.0] - host/xtest/benchmark_1000.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/host/xtest/benchmark_1000.c b/host/xtest/benchmark_1000.c -index bf92fa0..1caf420 100644 ---- a/host/xtest/benchmark_1000.c -+++ b/host/xtest/benchmark_1000.c -@@ -99,7 +99,7 @@ static TEEC_Result run_chunk_access_test(enum storage_benchmark_cmd cmd, - - static void show_test_result(struct test_record records[], size_t size) - { -- uint i; -+ size_t i; - - printf("-----------------+---------------+----------------\n"); - printf(" Data Size (B) \t | Time (s)\t | Speed (kB/s)\t \n"); -@@ -119,7 +119,7 @@ static void chunk_test(ADBG_Case_t *c, enum storage_benchmark_cmd cmd) - { - uint32_t chunk_size = DEFAULT_CHUNK_SIZE; - struct test_record records[ARRAY_SIZE(data_size_table) - 1]; -- uint i; -+ size_t i; - - for (i = 0; data_size_table[i]; i++) { - ADBG_EXPECT_TEEC_SUCCESS(c, --- -2.23.0.rc1 - diff --git a/recipes-security/optee-imx/optee-test/0006-regression_8100-use-null-terminated-strings-with-fil.patch b/recipes-security/optee-imx/optee-test/0006-regression_8100-use-null-terminated-strings-with-fil.patch deleted file mode 100644 index 1a5c4044..00000000 --- a/recipes-security/optee-imx/optee-test/0006-regression_8100-use-null-terminated-strings-with-fil.patch +++ /dev/null @@ -1,88 +0,0 @@ -From 7d566ed585d1e13f444d48fde5705b5be54de4af Mon Sep 17 00:00:00 2001 -From: Ricardo Salveti -Date: Wed, 26 Jun 2019 17:32:11 -0300 -Subject: [PATCH] regression_8100: use null terminated strings with file_to_c - -GCC 9 is more strict with string manipulation, causing the build to -fail as the string data converted via file_to_c is not null terminated, -as described by the following build error: - -regression_8100.c:100:29: error: '%*s' directive argument is not a -nul-terminated string [-Werror=format-overflow=] -tlen = myasprintf(&trust, "%*s", (int)sizeof(regression_8100_ca_crt), - ^~~ - regression_8100_ca_crt); - ~~~~~~~~~~~~~~~~~~~~~~ - -Change file_to_c to terminate the string after conversion and update the -string size to remove the null terminated byte. Also update -regression_8100 to use the size variable defined via file_to_c instead -of manually calling sizeof. - -Signed-off-by: Ricardo Salveti -Acked-by: Jens Wiklander ---- -Signed-off-by: André Draszik -Upstream-Status: Backport [3.6.0] - host/xtest/regression_8100.c | 10 +++++----- - scripts/file_to_c.py | 4 ++-- - 2 files changed, 7 insertions(+), 7 deletions(-) - -diff --git a/host/xtest/regression_8100.c b/host/xtest/regression_8100.c -index 04d62d9..13780e1 100644 ---- a/host/xtest/regression_8100.c -+++ b/host/xtest/regression_8100.c -@@ -91,13 +91,13 @@ static void test_8102(ADBG_Case_t *c) - return; - - clen = myasprintf(&chain, "%*s\n%*s", -- (int)sizeof(regression_8100_my_crt), -+ (int)regression_8100_my_crt_size, - regression_8100_my_crt, -- (int)sizeof(regression_8100_mid_crt), -+ (int)regression_8100_mid_crt_size, - regression_8100_mid_crt); - if (!ADBG_EXPECT_COMPARE_SIGNED(c, clen, !=, -1)) - goto out; -- tlen = myasprintf(&trust, "%*s", (int)sizeof(regression_8100_ca_crt), -+ tlen = myasprintf(&trust, "%*s", (int)regression_8100_ca_crt_size, - regression_8100_ca_crt); - if (!ADBG_EXPECT_COMPARE_SIGNED(c, tlen, !=, -1)) - goto out; -@@ -282,7 +282,7 @@ static void test_8103(ADBG_Case_t *c) - NULL, &ret_orig))) - return; - -- clen = myasprintf(&csr, "%*s", (int)sizeof(regression_8100_my_csr), -+ clen = myasprintf(&csr, "%*s", (int)regression_8100_my_csr_size, - regression_8100_my_csr); - if (!ADBG_EXPECT_COMPARE_SIGNED(c, clen, >=, 0)) - goto out; -@@ -300,7 +300,7 @@ static void test_8103(ADBG_Case_t *c) - if (!ADBG_EXPECT_TEEC_SUCCESS(c, res)) - goto out; - -- myasprintf(&ca, "%*s", (int)sizeof(regression_8100_ca_crt), -+ myasprintf(&ca, "%*s", (int)regression_8100_ca_crt_size, - regression_8100_ca_crt); - if (!ADBG_EXPECT_NOT_NULL(c, ca)) - goto out; -diff --git a/scripts/file_to_c.py b/scripts/file_to_c.py -index 83a9832..ae16f52 100755 ---- a/scripts/file_to_c.py -+++ b/scripts/file_to_c.py -@@ -37,9 +37,9 @@ def main(): - else: - f.write(" ") - -- f.write("};\n") -+ f.write("'\\0'};\n") - f.write("const size_t " + args.name + "_size = sizeof(" + -- args.name + ");\n") -+ args.name + ") - 1;\n") - - f.close() - inf.close() --- -2.23.0.rc1 - diff --git a/recipes-security/optee-imx/optee-test_3.7.0.imx.bb b/recipes-security/optee-imx/optee-test_3.10.0.imx.bb similarity index 79% rename from recipes-security/optee-imx/optee-test_3.7.0.imx.bb rename to recipes-security/optee-imx/optee-test_3.10.0.imx.bb index e0dfdbe2..a8a1b245 100644 --- a/recipes-security/optee-imx/optee-test_3.7.0.imx.bb +++ b/recipes-security/optee-imx/optee-test_3.10.0.imx.bb @@ -1,4 +1,4 @@ -# Copyright (C) 2017-2018 NXP +# Copyright (C) 2017-2020 NXP SUMMARY = "OPTEE test" HOMEPAGE = "http://www.optee.org/" @@ -6,21 +6,18 @@ HOMEPAGE = "http://www.optee.org/" LICENSE = "BSD" LIC_FILES_CHKSUM = "file://LICENSE.md;md5=daa2bcccc666345ab8940aab1315a4fa" -DEPENDS = "optee-os optee-client python3-pycrypto-native openssl" -inherit python3native - -FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" +DEPENDS = "python3-pycrypto-native python3-pycryptodomex-native optee-os optee-client openssl" -SRCBRANCH = "imx_5.4.24_2.1.0" +SRCBRANCH = "imx_5.4.70_2.3.0" -SRC_URI = "git://source.codeaurora.org/external/imx/imx-optee-test.git;protocol=https;branch=${SRCBRANCH} \ - file://0001-use-python3-instead-of-python.patch \ -" +SRC_URI = "git://source.codeaurora.org/external/imx/imx-optee-test.git;protocol=https;branch=${SRCBRANCH}" S = "${WORKDIR}/git" B = "${WORKDIR}/build" -SRCREV = "227d6f4c40eaa6f84fe049b9e48c7b27ad7fab08" +SRCREV = "0c998f42a3fb87b9f2929955cf4b0116cc515091" + +inherit python3native OPTEE_ARCH ?= "arm32" OPTEE_ARCH_armv7a = "arm32" @@ -29,6 +26,9 @@ OPTEE_ARCH_aarch64 = "arm64" TA_DEV_KIT_DIR_arm = "${STAGING_INCDIR}/optee/export-user_ta_arm32/" TA_DEV_KIT_DIR_aarch64 = "${STAGING_INCDIR}/optee/export-user_ta_arm64/" +CFLAGS += "--sysroot=${STAGING_DIR_HOST}" +CXXFLAGS += "--sysroot=${STAGING_DIR_HOST}" + EXTRA_OEMAKE = " \ TA_DEV_KIT_DIR=${TA_DEV_KIT_DIR} \ ARCH=${OPTEE_ARCH} \ @@ -39,6 +39,7 @@ EXTRA_OEMAKE = " \ OPTEE_OPENSSL_EXPORT=${STAGING_INCDIR}/ \ -C ${S} O=${B} \ " + do_compile() { cd ${S} # Top level makefile doesn't seem to handle parallel make gracefully