diff options
11 files changed, 30 insertions, 545 deletions
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" | |||
335 | PREFERRED_VERSION_libdrm_mx8 ?= "2.4.102.imx" | 335 | PREFERRED_VERSION_libdrm_mx8 ?= "2.4.102.imx" |
336 | 336 | ||
337 | # Use i.MX optee Version | 337 | # Use i.MX optee Version |
338 | PREFERRED_VERSION_optee-os_mx8 ?= "3.7.0.imx" | 338 | PREFERRED_VERSION_optee-os_mx8 ?= "3.10.0.imx" |
339 | PREFERRED_VERSION_optee-client_mx8 ?= "3.7.0.imx" | 339 | PREFERRED_VERSION_optee-client_mx8 ?= "3.10.0.imx" |
340 | PREFERRED_VERSION_optee-test_mx8 ?= "3.7.0.imx" | 340 | PREFERRED_VERSION_optee-test_mx8 ?= "3.10.0.imx" |
341 | 341 | ||
342 | #Use i.MX opencv Version for mx8 | 342 | #Use i.MX opencv Version for mx8 |
343 | PREFERRED_VERSION_opencv_mx8 ?= "4.4.0.imx" | 343 | 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 @@ | |||
1 | From 591461d6efe51989b4a7f4e875cdf37505eba360 Mon Sep 17 00:00:00 2001 | ||
2 | From: Andrey Zhizhikin <andrey.z@gmail.com> | ||
3 | Date: Thu, 4 Jun 2020 19:24:05 +0000 | ||
4 | Subject: [PATCH] flags: do not override CFLAGS from host | ||
5 | |||
6 | Some build systems set CFLAGS in environment before the build, but they | ||
7 | got overridden by CFLAGS immediate assignment operator. | ||
8 | |||
9 | Replace immediate assignment with append directive and use override | ||
10 | directive, so the former definition of CFLAGS gets passed either from | ||
11 | command line or via environment is completely expanded (see [1] for | ||
12 | detailed explanation of override directive and variable append). | ||
13 | |||
14 | Link: [1] https://www.gnu.org/software/make/manual/html_node/Override-Directive.html | ||
15 | |||
16 | Upstream-Status: Backport [https://github.com/OP-TEE/optee_client/pull/211] | ||
17 | |||
18 | Signed-off-by: Andrey Zhizhikin <andrey.z@gmail.com> | ||
19 | Reviewed-by: Jerome Forissier <jerome@forissier.org> | ||
20 | Reviewed-by: Joakim Bech <joakim.bech@linaro.org> | ||
21 | --- | ||
22 | flags.mk | 8 ++++---- | ||
23 | 1 file changed, 4 insertions(+), 4 deletions(-) | ||
24 | |||
25 | diff --git a/flags.mk b/flags.mk | ||
26 | index c2f0e1c..65192bc 100644 | ||
27 | --- a/flags.mk | ||
28 | +++ b/flags.mk | ||
29 | @@ -6,7 +6,7 @@ CROSS_COMPILE ?= arm-linux-gnueabihf- | ||
30 | CC ?= $(CROSS_COMPILE)gcc | ||
31 | AR ?= $(CROSS_COMPILE)ar | ||
32 | |||
33 | -CFLAGS := -Wall -Wbad-function-cast -Wcast-align \ | ||
34 | +override CFLAGS += -Wall -Wbad-function-cast -Wcast-align \ | ||
35 | -Werror-implicit-function-declaration -Wextra \ | ||
36 | -Wfloat-equal -Wformat-nonliteral -Wformat-security \ | ||
37 | -Wformat=2 -Winit-self -Wmissing-declarations \ | ||
38 | @@ -16,13 +16,13 @@ CFLAGS := -Wall -Wbad-function-cast -Wcast-align \ | ||
39 | -Wswitch-default -Wunsafe-loop-optimizations \ | ||
40 | -Wwrite-strings -D_FILE_OFFSET_BITS=64 | ||
41 | ifeq ($(CFG_WERROR),y) | ||
42 | -CFLAGS += -Werror | ||
43 | +override CFLAGS += -Werror | ||
44 | endif | ||
45 | -CFLAGS += -c -fPIC | ||
46 | +override CFLAGS += -c -fPIC | ||
47 | |||
48 | DEBUG ?= 0 | ||
49 | ifeq ($(DEBUG), 1) | ||
50 | -CFLAGS += -DDEBUG -O0 -g | ||
51 | +override CFLAGS += -DDEBUG -O0 -g | ||
52 | endif | ||
53 | |||
54 | RM := rm -f | ||
55 | -- | ||
56 | 2.17.1 | ||
57 | |||
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 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 @@ | |||
1 | # Copyright (C) 2017-2018 NXP | 1 | # Copyright (C) 2017-2020 NXP |
2 | 2 | ||
3 | SUMMARY = "OPTEE Client libs" | 3 | SUMMARY = "OPTEE Client libs" |
4 | HOMEPAGE = "http://www.optee.org/" | 4 | HOMEPAGE = "http://www.optee.org/" |
5 | LICENSE = "BSD" | 5 | LICENSE = "BSD" |
6 | LIC_FILES_CHKSUM = "file://LICENSE;md5=69663ab153298557a59c67a60a743e5b" | 6 | LIC_FILES_CHKSUM = "file://LICENSE;md5=69663ab153298557a59c67a60a743e5b" |
7 | 7 | ||
8 | inherit python3native systemd | 8 | SRCBRANCH = "imx_5.4.70_2.3.0" |
9 | 9 | SRC_URI = " \ | |
10 | SRCBRANCH = "imx_5.4.24_2.1.0" | 10 | git://source.codeaurora.org/external/imx/imx-optee-client.git;protocol=https;branch=${SRCBRANCH} \ |
11 | SRC_URI = "git://source.codeaurora.org/external/imx/imx-optee-client.git;protocol=https;branch=${SRCBRANCH}" | 11 | file://tee-supplicant.service \ |
12 | |||
13 | SRCREV = "bc0ec8ce1e4dc5ae23f4737ef659338b7cd408fe" | ||
14 | |||
15 | SRC_URI += "file://tee-supplicant.service \ | ||
16 | file://0001-flags-do-not-override-CFLAGS-from-host.patch \ | ||
17 | " | 12 | " |
18 | 13 | ||
14 | SRCREV = "2a77cf88d956c34cb4a1c191bea6113e327f5fe0" | ||
15 | |||
19 | S = "${WORKDIR}/git" | 16 | S = "${WORKDIR}/git" |
20 | B = "${WORKDIR}/build" | 17 | B = "${WORKDIR}/build" |
18 | |||
19 | inherit python3native systemd | ||
20 | |||
21 | SYSTEMD_SERVICE_${PN} = "tee-supplicant.service" | 21 | SYSTEMD_SERVICE_${PN} = "tee-supplicant.service" |
22 | 22 | ||
23 | OPTEE_ARCH ?= "arm32" | 23 | 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 @@ | |||
1 | From 109ed8d9a5351c7bb0fdc0953c7e7fb6cedcad9c Mon Sep 17 00:00:00 2001 | ||
2 | From: Andrey Zhizhikin <andrey.z@gmail.com> | ||
3 | Date: Sat, 30 May 2020 22:00:59 +0000 | ||
4 | Subject: [PATCH] optee-os: fix gcc10 compilation issue and missing cc-options | ||
5 | |||
6 | Backport PR 3891 from upstream to imx fork, which addressed compilation | ||
7 | failure when GCC10 is used. | ||
8 | |||
9 | Additional changes ported fixed cc-options macro, which allows to query | ||
10 | compiler used if the desired option exists before it could be set. This | ||
11 | solves also the build issues when GCC9 is used to build this component. | ||
12 | |||
13 | Upstream-Status: Backport [https://github.com/OP-TEE/optee_os/pull/3891] | ||
14 | |||
15 | Signed-off-by: Andrey Zhizhikin <andrey.z@gmail.com> | ||
16 | --- | ||
17 | core/arch/arm/arm.mk | 22 +++++++++++++++++----- | ||
18 | core/core.mk | 5 +---- | ||
19 | mk/cc-option.mk | 9 +++++++++ | ||
20 | mk/gcc.mk | 2 +- | ||
21 | ta/mk/ta_dev_kit.mk | 3 +++ | ||
22 | ta/ta.mk | 1 + | ||
23 | 6 files changed, 32 insertions(+), 10 deletions(-) | ||
24 | create mode 100644 mk/cc-option.mk | ||
25 | |||
26 | diff --git a/core/arch/arm/arm.mk b/core/arch/arm/arm.mk | ||
27 | index 5defb327..fffa491a 100644 | ||
28 | --- a/core/arch/arm/arm.mk | ||
29 | +++ b/core/arch/arm/arm.mk | ||
30 | @@ -1,3 +1,16 @@ | ||
31 | +# Setup compiler for the core module | ||
32 | +ifeq ($(CFG_ARM64_core),y) | ||
33 | +arch-bits-core := 64 | ||
34 | +else | ||
35 | +arch-bits-core := 32 | ||
36 | +endif | ||
37 | +CROSS_COMPILE_core := $(CROSS_COMPILE$(arch-bits-core)) | ||
38 | +COMPILER_core := $(COMPILER) | ||
39 | +include mk/$(COMPILER_core).mk | ||
40 | + | ||
41 | +# Defines the cc-option macro using the compiler set for the core module | ||
42 | +include mk/cc-option.mk | ||
43 | + | ||
44 | CFG_LTC_OPTEE_THREAD ?= y | ||
45 | # Size of emulated TrustZone protected SRAM, 448 kB. | ||
46 | # Only applicable when paging is enabled. | ||
47 | @@ -106,7 +119,7 @@ arm32-platform-aflags-no-hard-float ?= | ||
48 | |||
49 | arm64-platform-cflags-no-hard-float ?= -mgeneral-regs-only | ||
50 | arm64-platform-cflags-hard-float ?= | ||
51 | -arm64-platform-cflags-generic ?= -mstrict-align | ||
52 | +arm64-platform-cflags-generic := -mstrict-align $(call cc-option,-mno-outline-atomics,) | ||
53 | |||
54 | ifeq ($(DEBUG),1) | ||
55 | # For backwards compatibility | ||
56 | @@ -135,14 +148,12 @@ core-platform-aflags += $(platform-aflags-generic) | ||
57 | core-platform-aflags += $(platform-aflags-debug-info) | ||
58 | |||
59 | ifeq ($(CFG_ARM64_core),y) | ||
60 | -arch-bits-core := 64 | ||
61 | core-platform-cppflags += $(arm64-platform-cppflags) | ||
62 | core-platform-cflags += $(arm64-platform-cflags) | ||
63 | core-platform-cflags += $(arm64-platform-cflags-generic) | ||
64 | core-platform-cflags += $(arm64-platform-cflags-no-hard-float) | ||
65 | core-platform-aflags += $(arm64-platform-aflags) | ||
66 | else | ||
67 | -arch-bits-core := 32 | ||
68 | core-platform-cppflags += $(arm32-platform-cppflags) | ||
69 | core-platform-cflags += $(arm32-platform-cflags) | ||
70 | core-platform-cflags += $(arm32-platform-cflags-no-hard-float) | ||
71 | @@ -241,8 +252,9 @@ ta-mk-file-export-add-ta_arm64 += COMPILER ?= gcc_nl_ | ||
72 | ta-mk-file-export-add-ta_arm64 += COMPILER_ta_arm64 ?= $$(COMPILER)_nl_ | ||
73 | endif | ||
74 | |||
75 | -# Set cross compiler prefix for each submodule | ||
76 | -$(foreach sm, core $(ta-targets), $(eval CROSS_COMPILE_$(sm) ?= $(CROSS_COMPILE$(arch-bits-$(sm))))) | ||
77 | +# Set cross compiler prefix for each TA target | ||
78 | +$(foreach sm, $(ta-targets), $(eval CROSS_COMPILE_$(sm) ?= $(CROSS_COMPILE$(arch-bits-$(sm))))) | ||
79 | + | ||
80 | |||
81 | arm32-sysreg-txt = core/arch/arm/kernel/arm32_sysreg.txt | ||
82 | arm32-sysregs-$(arm32-sysreg-txt)-h := arm32_sysreg.h | ||
83 | diff --git a/core/core.mk b/core/core.mk | ||
84 | index a51cf847..28c7235c 100644 | ||
85 | --- a/core/core.mk | ||
86 | +++ b/core/core.mk | ||
87 | @@ -8,6 +8,7 @@ arch-dir := core/arch/$(ARCH) | ||
88 | platform-dir := $(arch-dir)/plat-$(PLATFORM) | ||
89 | include $(platform-dir)/conf.mk | ||
90 | include mk/config.mk | ||
91 | +# $(ARCH).mk also sets the compiler for the core module | ||
92 | include core/arch/$(ARCH)/$(ARCH).mk | ||
93 | |||
94 | PLATFORM_$(PLATFORM) := y | ||
95 | @@ -16,10 +17,6 @@ PLATFORM_FLAVOR_$(PLATFORM_FLAVOR) := y | ||
96 | $(eval $(call cfg-depends-all,CFG_PAGED_USER_TA,CFG_WITH_PAGER CFG_WITH_USER_TA)) | ||
97 | include core/crypto.mk | ||
98 | |||
99 | -# Setup compiler for this sub module | ||
100 | -COMPILER_$(sm) ?= $(COMPILER) | ||
101 | -include mk/$(COMPILER_$(sm)).mk | ||
102 | - | ||
103 | cppflags$(sm) += -D__KERNEL__ | ||
104 | |||
105 | cppflags$(sm) += -Icore/include | ||
106 | diff --git a/mk/cc-option.mk b/mk/cc-option.mk | ||
107 | new file mode 100644 | ||
108 | index 00000000..4699fbcc | ||
109 | --- /dev/null | ||
110 | +++ b/mk/cc-option.mk | ||
111 | @@ -0,0 +1,9 @@ | ||
112 | +_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) | ||
113 | +_cc-opt-cached-var-name = $(subst =,~,$(strip cached-cc-option-$(1)-$(subst $(empty) $(empty),,$(CC$(sm))))) | ||
114 | +define _cc-option | ||
115 | +$(eval _var_name := $(call _cc-opt-cached-var-name,$(1))) | ||
116 | +$(eval $(_var_name) := $(if $(filter $(origin $(_var_name)),undefined),$(call _cc-option-supported,$(1)),$($(_var_name)))) | ||
117 | +$(if $($(_var_name)),$(1),$(2)) | ||
118 | +endef | ||
119 | +cc-option = $(strip $(call _cc-option,$(1),$(2))) | ||
120 | + | ||
121 | diff --git a/mk/gcc.mk b/mk/gcc.mk | ||
122 | index 1f2c5990..c53a23b1 100644 | ||
123 | --- a/mk/gcc.mk | ||
124 | +++ b/mk/gcc.mk | ||
125 | @@ -12,7 +12,7 @@ nostdinc$(sm) := -nostdinc -isystem $(shell $(CC$(sm)) \ | ||
126 | -print-file-name=include 2> /dev/null) | ||
127 | |||
128 | # Get location of libgcc from gcc | ||
129 | -libgcc$(sm) := $(shell $(CC$(sm)) $(CFLAGS$(arch-bits-$(sm))) $(comp-cflags$(sm)) \ | ||
130 | +libgcc$(sm) := $(shell $(CC$(sm)) $(CFLAGS$(arch-bits-$(sm))) \ | ||
131 | -print-libgcc-file-name 2> /dev/null) | ||
132 | |||
133 | # Define these to something to discover accidental use | ||
134 | diff --git a/ta/mk/ta_dev_kit.mk b/ta/mk/ta_dev_kit.mk | ||
135 | index 04a4f94b..e4b02ea7 100644 | ||
136 | --- a/ta/mk/ta_dev_kit.mk | ||
137 | +++ b/ta/mk/ta_dev_kit.mk | ||
138 | @@ -92,6 +92,9 @@ clean: | ||
139 | @$(cmd-echo-silent) ' CLEAN $(O)' | ||
140 | ${q}if [ -d "$(O)" ]; then $(RMDIR) $(O); fi | ||
141 | |||
142 | +include $(ta-dev-kit-dir$(sm))/mk/$(COMPILER_$(sm)).mk | ||
143 | +include $(ta-dev-kit-dir$(sm))/mk/cc-option.mk | ||
144 | + | ||
145 | subdirs = . | ||
146 | include $(ta-dev-kit-dir$(sm))/mk/subdir.mk | ||
147 | |||
148 | diff --git a/ta/ta.mk b/ta/ta.mk | ||
149 | index dde7be67..ca17054a 100644 | ||
150 | --- a/ta/ta.mk | ||
151 | +++ b/ta/ta.mk | ||
152 | @@ -157,6 +157,7 @@ $(foreach f, $(libfiles), \ | ||
153 | |||
154 | # Copy .mk files | ||
155 | ta-mkfiles = mk/compile.mk mk/subdir.mk mk/gcc.mk mk/clang.mk mk/cleandirs.mk \ | ||
156 | + mk/cc-option.mk \ | ||
157 | ta/arch/$(ARCH)/link.mk ta/arch/$(ARCH)/link_shlib.mk \ | ||
158 | ta/mk/ta_dev_kit.mk | ||
159 | |||
160 | -- | ||
161 | 2.17.1 | ||
162 | |||
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 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/" | |||
6 | LICENSE = "BSD" | 6 | LICENSE = "BSD" |
7 | LIC_FILES_CHKSUM = "file://LICENSE;md5=c1f21c4f72f372ef38a5a4aee55ec173" | 7 | LIC_FILES_CHKSUM = "file://LICENSE;md5=c1f21c4f72f372ef38a5a4aee55ec173" |
8 | 8 | ||
9 | inherit deploy python3native autotools | 9 | DEPENDS = "python3-pycrypto-native python3-pycryptodomex-native python3-pyelftools-native u-boot-mkimage-native" |
10 | DEPENDS = "python3-pycrypto-native python3-pyelftools-native u-boot-mkimage-native" | ||
11 | 10 | ||
12 | SRCBRANCH = "imx_5.4.24_2.1.0" | 11 | SRCBRANCH = "imx_5.4.70_2.3.0" |
13 | 12 | ||
14 | SRC_URI = "\ | 13 | SRC_URI = "\ |
15 | git://source.codeaurora.org/external/imx/imx-optee-os.git;protocol=https;branch=${SRCBRANCH} \ | 14 | git://source.codeaurora.org/external/imx/imx-optee-os.git;protocol=https;branch=${SRCBRANCH} \ |
16 | file://0001-optee-os-fix-gcc10-compilation-issue-and-missing-cc-.patch \ | ||
17 | " | 15 | " |
18 | 16 | ||
19 | SRCREV = "7a49776de59265500f10a247125429fde1555ac1" | 17 | SRCREV = "a991c90475bb1c715651e5fe27f7f32cbe61aef9" |
20 | 18 | ||
21 | S = "${WORKDIR}/git" | 19 | S = "${WORKDIR}/git" |
22 | B = "${WORKDIR}/build.${PLATFORM_FLAVOR}" | 20 | B = "${WORKDIR}/build.${PLATFORM_FLAVOR}" |
23 | 21 | ||
22 | inherit deploy python3native autotools | ||
23 | |||
24 | # The platform flavor corresponds to the Yocto machine without the leading 'i'. | 24 | # The platform flavor corresponds to the Yocto machine without the leading 'i'. |
25 | PLATFORM_FLAVOR = "${@d.getVar('MACHINE')[1:]}" | 25 | PLATFORM_FLAVOR = "${@d.getVar('MACHINE')[1:]}" |
26 | PLATFORM_FLAVOR_imx6qpdlsolox = "mx6qsabresd" | 26 | PLATFORM_FLAVOR_imx6qpdlsolox = "mx6qsabresd" |
@@ -51,7 +51,6 @@ EXTRA_OEMAKE = " \ | |||
51 | PLATFORM_FLAVOR=${PLATFORM_FLAVOR} \ | 51 | PLATFORM_FLAVOR=${PLATFORM_FLAVOR} \ |
52 | CROSS_COMPILE=${HOST_PREFIX} \ | 52 | CROSS_COMPILE=${HOST_PREFIX} \ |
53 | CROSS_COMPILE64=${HOST_PREFIX} \ | 53 | CROSS_COMPILE64=${HOST_PREFIX} \ |
54 | NOWERROR=1 \ | ||
55 | LDFLAGS= \ | 54 | LDFLAGS= \ |
56 | O=${B} \ | 55 | O=${B} \ |
57 | " | 56 | " |
@@ -68,7 +67,7 @@ do_deploy () { | |||
68 | ${TARGET_PREFIX}objcopy -O binary ${B}/core/tee.elf ${DEPLOYDIR}/tee.${PLATFORM_FLAVOR}.bin | 67 | ${TARGET_PREFIX}objcopy -O binary ${B}/core/tee.elf ${DEPLOYDIR}/tee.${PLATFORM_FLAVOR}.bin |
69 | 68 | ||
70 | if [ "${OPTEE_ARCH}" != "arm64" ]; then | 69 | if [ "${OPTEE_ARCH}" != "arm64" ]; then |
71 | IMX_LOAD_ADDR=`cat ${B}/core/tee-init_load_addr.txt` && \ | 70 | IMX_LOAD_ADDR=`${TARGET_PREFIX}readelf -h ${B}/core/tee.elf | grep "Entry point address" | awk '{print $4}'` |
72 | uboot-mkimage -A arm -O linux -C none -a ${IMX_LOAD_ADDR} -e ${IMX_LOAD_ADDR} \ | 71 | uboot-mkimage -A arm -O linux -C none -a ${IMX_LOAD_ADDR} -e ${IMX_LOAD_ADDR} \ |
73 | -d ${DEPLOYDIR}/tee.${PLATFORM_FLAVOR}.bin ${DEPLOYDIR}/uTee-${OPTEE_BIN_EXT} | 72 | -d ${DEPLOYDIR}/tee.${PLATFORM_FLAVOR}.bin ${DEPLOYDIR}/uTee-${OPTEE_BIN_EXT} |
74 | fi | 73 | 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 @@ | |||
1 | From 6271160639002a2580d80b75b5397a96d56329f2 Mon Sep 17 00:00:00 2001 | ||
2 | From: Scott Branden <scott.branden@broadcom.com> | ||
3 | Date: Fri, 27 Dec 2019 12:54:28 -0800 | ||
4 | Subject: [PATCH] use python3 instead of python | ||
5 | |||
6 | use python3 instead of python as python2 is EOL January 2020. | ||
7 | |||
8 | Signed-off-by: Scott Branden <scott.branden@broadcom.com> | ||
9 | Reviewed-by: Jerome Forissier <jerome@forissier.org> | ||
10 | Tested-by: Jerome Forissier <jerome@forissier.org> (QEMU, CFG_GCM_NIST_VECTORS=y) | ||
11 | Upstream-Status: Backport from v3.8.0 | ||
12 | --- | ||
13 | scripts/file_to_c.py | 4 ++-- | ||
14 | scripts/rsp_to_gcm_test.py | 2 +- | ||
15 | 2 files changed, 3 insertions(+), 3 deletions(-) | ||
16 | |||
17 | diff --git a/scripts/file_to_c.py b/scripts/file_to_c.py | ||
18 | index ae16f52..b4ce2a2 100755 | ||
19 | --- a/scripts/file_to_c.py | ||
20 | +++ b/scripts/file_to_c.py | ||
21 | @@ -1,4 +1,4 @@ | ||
22 | -#!/usr/bin/env python | ||
23 | +#!/usr/bin/env python3 | ||
24 | # SPDX-License-Identifier: BSD-2-Clause | ||
25 | # | ||
26 | # Copyright (c) 2018, Linaro Limited | ||
27 | @@ -29,7 +29,7 @@ def main(): | ||
28 | |||
29 | f.write("const uint8_t " + args.name + "[] = {\n") | ||
30 | i = 0 | ||
31 | - for x in array.array("B", inf.read()): | ||
32 | + for x in array.array("B", map(ord, (inf.read()))): | ||
33 | f.write("0x" + '{0:02x}'.format(x) + ",") | ||
34 | i = i + 1 | ||
35 | if i % 8 == 0: | ||
36 | diff --git a/scripts/rsp_to_gcm_test.py b/scripts/rsp_to_gcm_test.py | ||
37 | index 0543541..e4418be 100755 | ||
38 | --- a/scripts/rsp_to_gcm_test.py | ||
39 | +++ b/scripts/rsp_to_gcm_test.py | ||
40 | @@ -1,4 +1,4 @@ | ||
41 | -#!/usr/bin/env python | ||
42 | +#!/usr/bin/env python3 | ||
43 | |||
44 | modes = {'encrypt': 0, 'decrypt': 1} | ||
45 | |||
46 | -- | ||
47 | 2.7.4 | ||
48 | |||
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 @@ | |||
1 | From dc8cd1c43edeedb9f7335020537c4ffdddd683f8 Mon Sep 17 00:00:00 2001 | ||
2 | From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <andre.draszik@jci.com> | ||
3 | Date: Thu, 7 Feb 2019 01:26:53 +0000 | ||
4 | Subject: [PATCH 1/3] sock_server: fix compilation against musl (sys/errno.h) | ||
5 | MIME-Version: 1.0 | ||
6 | Content-Type: text/plain; charset=UTF-8 | ||
7 | Content-Transfer-Encoding: 8bit | ||
8 | |||
9 | Compiling against musl-libc fails with the following error: | ||
10 | |||
11 | | In file included from .../host/xtest/sock_server.c:24: | ||
12 | | .../usr/include/sys/errno.h:1:2: error: #warning redirecting incorrect #include <sys/errno.h> to <errno.h> [-Werror=cpp] | ||
13 | | #warning redirecting incorrect #include <sys/errno.h> to <errno.h> | ||
14 | | ^~~~~~~ | ||
15 | |||
16 | Just remove the needless include. | ||
17 | |||
18 | Signed-off-by: André Draszik <andre.draszik@jci.com> | ||
19 | Acked-by: Jens Wiklander <jens.wiklander@linaro.org> | ||
20 | Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> | ||
21 | --- | ||
22 | Signed-off-by: André Draszik <andre.draszik@jci.com> | ||
23 | Upstream-Status: Backport [3.5.0] | ||
24 | host/xtest/sock_server.c | 1 - | ||
25 | 1 file changed, 1 deletion(-) | ||
26 | |||
27 | diff --git a/host/xtest/sock_server.c b/host/xtest/sock_server.c | ||
28 | index 0d2ff06..1ba73d6 100644 | ||
29 | --- a/host/xtest/sock_server.c | ||
30 | +++ b/host/xtest/sock_server.c | ||
31 | @@ -21,7 +21,6 @@ | ||
32 | #include <netdb.h> | ||
33 | #include <netinet/in.h> | ||
34 | #include <poll.h> | ||
35 | -#include <sys/errno.h> | ||
36 | #include <sys/socket.h> | ||
37 | #include <unistd.h> | ||
38 | |||
39 | -- | ||
40 | 2.23.0.rc1 | ||
41 | |||
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 @@ | |||
1 | From 1401b89684ee81bf0b3d3dea06e2926b24ba3f97 Mon Sep 17 00:00:00 2001 | ||
2 | From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <andre.draszik@jci.com> | ||
3 | Date: Thu, 7 Feb 2019 01:29:08 +0000 | ||
4 | Subject: [PATCH 2/3] build: ignore declaration-after-statement warnings | ||
5 | MIME-Version: 1.0 | ||
6 | Content-Type: text/plain; charset=UTF-8 | ||
7 | Content-Transfer-Encoding: 8bit | ||
8 | |||
9 | | Makefile:37: recipe for target 'xtest' failed | ||
10 | | make: *** [xtest] Error 2 | ||
11 | | make: *** Waiting for unfinished jobs.... | ||
12 | | arith_taf.c: In function 'get_handle': | ||
13 | | arith_taf.c:56:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] | ||
14 | | int h = handle_get(&hdb, ptr); | ||
15 | | ^~~ | ||
16 | | arith_taf.c: In function 'ta_entry_arith_new_var': | ||
17 | | arith_taf.c:82:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] | ||
18 | | size_t len = TEE_BigIntSizeInU32(params[0].value.a); | ||
19 | | ^~~~~~ | ||
20 | | arith_taf.c: In function 'ta_entry_arith_new_fmm_var': | ||
21 | | arith_taf.c:129:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] | ||
22 | | size_t len = TEE_BigIntFMMSizeInU32(params[0].value.a); | ||
23 | | ^~~~~~ | ||
24 | | arith_taf.c: In function 'ta_entry_arith_free_handle': | ||
25 | | arith_taf.c:150:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] | ||
26 | | void *ptr = put_handle(params[0].value.a & ~HT_MASK); | ||
27 | | ^~~~ | ||
28 | | arith_taf.c: In function 'ta_entry_arith_from_octet_string': | ||
29 | | arith_taf.c:165:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] | ||
30 | | TEE_BigInt *big_int = lookup_handle(HT_BIGINT, params[0].value.a); | ||
31 | | ^~~~~~~~~~ | ||
32 | | arith_taf.c: In function 'ta_entry_arith_from_s32': | ||
33 | | arith_taf.c:181:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] | ||
34 | | TEE_BigInt *big_int = lookup_handle(HT_BIGINT, params[0].value.a); | ||
35 | | ^~~~~~~~~~ | ||
36 | |||
37 | etc. | ||
38 | |||
39 | Signed-off-by: André Draszik <andre.draszik@jci.com> | ||
40 | Acked-by: Jens Wiklander <jens.wiklander@linaro.org> | ||
41 | Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> | ||
42 | --- | ||
43 | Signed-off-by: André Draszik <andre.draszik@jci.com> | ||
44 | Upstream-Status: Backport [3.5.0] | ||
45 | host/xtest/Makefile | 1 + | ||
46 | 1 file changed, 1 insertion(+) | ||
47 | |||
48 | diff --git a/host/xtest/Makefile b/host/xtest/Makefile | ||
49 | index f4291e0..e97e555 100644 | ||
50 | --- a/host/xtest/Makefile | ||
51 | +++ b/host/xtest/Makefile | ||
52 | @@ -154,6 +154,7 @@ CFLAGS += -Wall -Wcast-align -Werror \ | ||
53 | -Wmissing-prototypes -Wnested-externs -Wpointer-arith \ | ||
54 | -Wshadow -Wstrict-prototypes -Wswitch-default \ | ||
55 | -Wwrite-strings \ | ||
56 | + -Wno-declaration-after-statement \ | ||
57 | -Wno-missing-field-initializers -Wno-format-zero-length | ||
58 | endif | ||
59 | |||
60 | -- | ||
61 | 2.23.0.rc1 | ||
62 | |||
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 @@ | |||
1 | From f74e9f339a8e8cb97fc8ea03bef51d7e3862a60a Mon Sep 17 00:00:00 2001 | ||
2 | From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <andre.draszik@jci.com> | ||
3 | Date: Thu, 7 Feb 2019 01:31:27 +0000 | ||
4 | Subject: [PATCH 3/3] benchmark_1000: fix compilation against musl (uint) | ||
5 | MIME-Version: 1.0 | ||
6 | Content-Type: text/plain; charset=UTF-8 | ||
7 | Content-Transfer-Encoding: 8bit | ||
8 | |||
9 | Compiling against musl-libc fails with the following error: | ||
10 | |||
11 | | .../host/xtest/benchmark_1000.c: In function 'show_test_result': | ||
12 | | .../host/xtest/benchmark_1000.c:102:2: error: unknown type name 'uint'; did you mean 'int'? | ||
13 | | uint i; | ||
14 | | ^~~~ | ||
15 | | int | ||
16 | | ...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] | ||
17 | | for (i = 0; i < size; i++) { | ||
18 | | ^ | ||
19 | |||
20 | etc. | ||
21 | |||
22 | Convert to using more standard size_t | ||
23 | |||
24 | Signed-off-by: André Draszik <andre.draszik@jci.com> | ||
25 | Acked-by: Jens Wiklander <jens.wiklander@linaro.org> | ||
26 | Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> | ||
27 | --- | ||
28 | Signed-off-by: André Draszik <andre.draszik@jci.com> | ||
29 | Upstream-Status: Backport [3.5.0] | ||
30 | host/xtest/benchmark_1000.c | 4 ++-- | ||
31 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
32 | |||
33 | diff --git a/host/xtest/benchmark_1000.c b/host/xtest/benchmark_1000.c | ||
34 | index bf92fa0..1caf420 100644 | ||
35 | --- a/host/xtest/benchmark_1000.c | ||
36 | +++ b/host/xtest/benchmark_1000.c | ||
37 | @@ -99,7 +99,7 @@ static TEEC_Result run_chunk_access_test(enum storage_benchmark_cmd cmd, | ||
38 | |||
39 | static void show_test_result(struct test_record records[], size_t size) | ||
40 | { | ||
41 | - uint i; | ||
42 | + size_t i; | ||
43 | |||
44 | printf("-----------------+---------------+----------------\n"); | ||
45 | printf(" Data Size (B) \t | Time (s)\t | Speed (kB/s)\t \n"); | ||
46 | @@ -119,7 +119,7 @@ static void chunk_test(ADBG_Case_t *c, enum storage_benchmark_cmd cmd) | ||
47 | { | ||
48 | uint32_t chunk_size = DEFAULT_CHUNK_SIZE; | ||
49 | struct test_record records[ARRAY_SIZE(data_size_table) - 1]; | ||
50 | - uint i; | ||
51 | + size_t i; | ||
52 | |||
53 | for (i = 0; data_size_table[i]; i++) { | ||
54 | ADBG_EXPECT_TEEC_SUCCESS(c, | ||
55 | -- | ||
56 | 2.23.0.rc1 | ||
57 | |||
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 @@ | |||
1 | From 7d566ed585d1e13f444d48fde5705b5be54de4af Mon Sep 17 00:00:00 2001 | ||
2 | From: Ricardo Salveti <ricardo@foundries.io> | ||
3 | Date: Wed, 26 Jun 2019 17:32:11 -0300 | ||
4 | Subject: [PATCH] regression_8100: use null terminated strings with file_to_c | ||
5 | |||
6 | GCC 9 is more strict with string manipulation, causing the build to | ||
7 | fail as the string data converted via file_to_c is not null terminated, | ||
8 | as described by the following build error: | ||
9 | |||
10 | regression_8100.c:100:29: error: '%*s' directive argument is not a | ||
11 | nul-terminated string [-Werror=format-overflow=] | ||
12 | tlen = myasprintf(&trust, "%*s", (int)sizeof(regression_8100_ca_crt), | ||
13 | ^~~ | ||
14 | regression_8100_ca_crt); | ||
15 | ~~~~~~~~~~~~~~~~~~~~~~ | ||
16 | |||
17 | Change file_to_c to terminate the string after conversion and update the | ||
18 | string size to remove the null terminated byte. Also update | ||
19 | regression_8100 to use the size variable defined via file_to_c instead | ||
20 | of manually calling sizeof. | ||
21 | |||
22 | Signed-off-by: Ricardo Salveti <ricardo@foundries.io> | ||
23 | Acked-by: Jens Wiklander <jens.wiklander@linaro.org> | ||
24 | --- | ||
25 | Signed-off-by: André Draszik <andre.draszik@jci.com> | ||
26 | Upstream-Status: Backport [3.6.0] | ||
27 | host/xtest/regression_8100.c | 10 +++++----- | ||
28 | scripts/file_to_c.py | 4 ++-- | ||
29 | 2 files changed, 7 insertions(+), 7 deletions(-) | ||
30 | |||
31 | diff --git a/host/xtest/regression_8100.c b/host/xtest/regression_8100.c | ||
32 | index 04d62d9..13780e1 100644 | ||
33 | --- a/host/xtest/regression_8100.c | ||
34 | +++ b/host/xtest/regression_8100.c | ||
35 | @@ -91,13 +91,13 @@ static void test_8102(ADBG_Case_t *c) | ||
36 | return; | ||
37 | |||
38 | clen = myasprintf(&chain, "%*s\n%*s", | ||
39 | - (int)sizeof(regression_8100_my_crt), | ||
40 | + (int)regression_8100_my_crt_size, | ||
41 | regression_8100_my_crt, | ||
42 | - (int)sizeof(regression_8100_mid_crt), | ||
43 | + (int)regression_8100_mid_crt_size, | ||
44 | regression_8100_mid_crt); | ||
45 | if (!ADBG_EXPECT_COMPARE_SIGNED(c, clen, !=, -1)) | ||
46 | goto out; | ||
47 | - tlen = myasprintf(&trust, "%*s", (int)sizeof(regression_8100_ca_crt), | ||
48 | + tlen = myasprintf(&trust, "%*s", (int)regression_8100_ca_crt_size, | ||
49 | regression_8100_ca_crt); | ||
50 | if (!ADBG_EXPECT_COMPARE_SIGNED(c, tlen, !=, -1)) | ||
51 | goto out; | ||
52 | @@ -282,7 +282,7 @@ static void test_8103(ADBG_Case_t *c) | ||
53 | NULL, &ret_orig))) | ||
54 | return; | ||
55 | |||
56 | - clen = myasprintf(&csr, "%*s", (int)sizeof(regression_8100_my_csr), | ||
57 | + clen = myasprintf(&csr, "%*s", (int)regression_8100_my_csr_size, | ||
58 | regression_8100_my_csr); | ||
59 | if (!ADBG_EXPECT_COMPARE_SIGNED(c, clen, >=, 0)) | ||
60 | goto out; | ||
61 | @@ -300,7 +300,7 @@ static void test_8103(ADBG_Case_t *c) | ||
62 | if (!ADBG_EXPECT_TEEC_SUCCESS(c, res)) | ||
63 | goto out; | ||
64 | |||
65 | - myasprintf(&ca, "%*s", (int)sizeof(regression_8100_ca_crt), | ||
66 | + myasprintf(&ca, "%*s", (int)regression_8100_ca_crt_size, | ||
67 | regression_8100_ca_crt); | ||
68 | if (!ADBG_EXPECT_NOT_NULL(c, ca)) | ||
69 | goto out; | ||
70 | diff --git a/scripts/file_to_c.py b/scripts/file_to_c.py | ||
71 | index 83a9832..ae16f52 100755 | ||
72 | --- a/scripts/file_to_c.py | ||
73 | +++ b/scripts/file_to_c.py | ||
74 | @@ -37,9 +37,9 @@ def main(): | ||
75 | else: | ||
76 | f.write(" ") | ||
77 | |||
78 | - f.write("};\n") | ||
79 | + f.write("'\\0'};\n") | ||
80 | f.write("const size_t " + args.name + "_size = sizeof(" + | ||
81 | - args.name + ");\n") | ||
82 | + args.name + ") - 1;\n") | ||
83 | |||
84 | f.close() | ||
85 | inf.close() | ||
86 | -- | ||
87 | 2.23.0.rc1 | ||
88 | |||
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 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 @@ | |||
1 | # Copyright (C) 2017-2018 NXP | 1 | # Copyright (C) 2017-2020 NXP |
2 | 2 | ||
3 | SUMMARY = "OPTEE test" | 3 | SUMMARY = "OPTEE test" |
4 | HOMEPAGE = "http://www.optee.org/" | 4 | HOMEPAGE = "http://www.optee.org/" |
@@ -6,21 +6,18 @@ HOMEPAGE = "http://www.optee.org/" | |||
6 | LICENSE = "BSD" | 6 | LICENSE = "BSD" |
7 | LIC_FILES_CHKSUM = "file://LICENSE.md;md5=daa2bcccc666345ab8940aab1315a4fa" | 7 | LIC_FILES_CHKSUM = "file://LICENSE.md;md5=daa2bcccc666345ab8940aab1315a4fa" |
8 | 8 | ||
9 | DEPENDS = "optee-os optee-client python3-pycrypto-native openssl" | 9 | DEPENDS = "python3-pycrypto-native python3-pycryptodomex-native optee-os optee-client openssl" |
10 | inherit python3native | ||
11 | |||
12 | FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" | ||
13 | 10 | ||
14 | SRCBRANCH = "imx_5.4.24_2.1.0" | 11 | SRCBRANCH = "imx_5.4.70_2.3.0" |
15 | 12 | ||
16 | SRC_URI = "git://source.codeaurora.org/external/imx/imx-optee-test.git;protocol=https;branch=${SRCBRANCH} \ | 13 | SRC_URI = "git://source.codeaurora.org/external/imx/imx-optee-test.git;protocol=https;branch=${SRCBRANCH}" |
17 | file://0001-use-python3-instead-of-python.patch \ | ||
18 | " | ||
19 | 14 | ||
20 | S = "${WORKDIR}/git" | 15 | S = "${WORKDIR}/git" |
21 | B = "${WORKDIR}/build" | 16 | B = "${WORKDIR}/build" |
22 | 17 | ||
23 | SRCREV = "227d6f4c40eaa6f84fe049b9e48c7b27ad7fab08" | 18 | SRCREV = "0c998f42a3fb87b9f2929955cf4b0116cc515091" |
19 | |||
20 | inherit python3native | ||
24 | 21 | ||
25 | OPTEE_ARCH ?= "arm32" | 22 | OPTEE_ARCH ?= "arm32" |
26 | OPTEE_ARCH_armv7a = "arm32" | 23 | OPTEE_ARCH_armv7a = "arm32" |
@@ -29,6 +26,9 @@ OPTEE_ARCH_aarch64 = "arm64" | |||
29 | TA_DEV_KIT_DIR_arm = "${STAGING_INCDIR}/optee/export-user_ta_arm32/" | 26 | TA_DEV_KIT_DIR_arm = "${STAGING_INCDIR}/optee/export-user_ta_arm32/" |
30 | TA_DEV_KIT_DIR_aarch64 = "${STAGING_INCDIR}/optee/export-user_ta_arm64/" | 27 | TA_DEV_KIT_DIR_aarch64 = "${STAGING_INCDIR}/optee/export-user_ta_arm64/" |
31 | 28 | ||
29 | CFLAGS += "--sysroot=${STAGING_DIR_HOST}" | ||
30 | CXXFLAGS += "--sysroot=${STAGING_DIR_HOST}" | ||
31 | |||
32 | EXTRA_OEMAKE = " \ | 32 | EXTRA_OEMAKE = " \ |
33 | TA_DEV_KIT_DIR=${TA_DEV_KIT_DIR} \ | 33 | TA_DEV_KIT_DIR=${TA_DEV_KIT_DIR} \ |
34 | ARCH=${OPTEE_ARCH} \ | 34 | ARCH=${OPTEE_ARCH} \ |
@@ -39,6 +39,7 @@ EXTRA_OEMAKE = " \ | |||
39 | OPTEE_OPENSSL_EXPORT=${STAGING_INCDIR}/ \ | 39 | OPTEE_OPENSSL_EXPORT=${STAGING_INCDIR}/ \ |
40 | -C ${S} O=${B} \ | 40 | -C ${S} O=${B} \ |
41 | " | 41 | " |
42 | |||
42 | do_compile() { | 43 | do_compile() { |
43 | cd ${S} | 44 | cd ${S} |
44 | # Top level makefile doesn't seem to handle parallel make gracefully | 45 | # Top level makefile doesn't seem to handle parallel make gracefully |