diff options
| -rw-r--r-- | recipes-security/optee/optee-os-qoriq/0001-Fix-alignment-of-data-for-mempool_alloc_pool.patch | 148 | ||||
| -rw-r--r-- | recipes-security/optee/optee-os-qoriq/0001-arm64-Disable-outline-atomics-when-compiling.patch | 41 | ||||
| -rw-r--r-- | recipes-security/optee/optee-os-qoriq/0001-optee-os-fix-gcc10-compilation-issue-and-missing-cc-.patch | 161 | ||||
| -rw-r--r-- | recipes-security/optee/optee-os-qoriq/0001-use-python3-instead-of-python.patch | 80 | ||||
| -rw-r--r-- | recipes-security/optee/optee-os-qoriq_3.8.0.bb (renamed from recipes-security/optee/optee-os-qoriq_git.bb) | 15 |
5 files changed, 50 insertions, 395 deletions
diff --git a/recipes-security/optee/optee-os-qoriq/0001-Fix-alignment-of-data-for-mempool_alloc_pool.patch b/recipes-security/optee/optee-os-qoriq/0001-Fix-alignment-of-data-for-mempool_alloc_pool.patch deleted file mode 100644 index e22bd6c03..000000000 --- a/recipes-security/optee/optee-os-qoriq/0001-Fix-alignment-of-data-for-mempool_alloc_pool.patch +++ /dev/null | |||
| @@ -1,148 +0,0 @@ | |||
| 1 | From b2dd8747125be413f9b8b7fd7e52f457cabd709c Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Jens Wiklander <jens.wiklander@linaro.org> | ||
| 3 | Date: Tue, 5 Feb 2019 13:05:29 +0100 | ||
| 4 | Subject: [PATCH] Fix alignment of data for mempool_alloc_pool() | ||
| 5 | |||
| 6 | Upstream-Status: Submitted | ||
| 7 | |||
| 8 | Prior to this patch was _TEE_MathAPI_Init() in | ||
| 9 | lib/libutee/tee_api_arith_mpi.c supplying a data buffer which was only 4 | ||
| 10 | byte aligned while mempool_alloc_pool() requires the alignment of long. | ||
| 11 | This will work in 32-bit mode, but could lead to alignment problem in | ||
| 12 | 64-bit mode. The same problem can happen with | ||
| 13 | lib/libutee/tee_api_arith_mpa.c, but so far it has remained hidden. | ||
| 14 | |||
| 15 | Incorrect alignment can result in errors like: | ||
| 16 | E/TA: assertion '!((vaddr_t)data & (POOL_ALIGN - 1))' failed at lib/libutils/ext/mempool.c:134 in mempool_alloc_pool() | ||
| 17 | |||
| 18 | This fix introduces MEMPOOL_ALIGN which specifies required alignment of | ||
| 19 | data supplied to mempool_alloc_pool(). | ||
| 20 | |||
| 21 | Fixes: 062e3d01c039 ("ta: switch to to mbedtls for bignum") | ||
| 22 | Reviewed-by: Joakim Bech <joakim.bech@linaro.org> | ||
| 23 | Tested-by: Joakim Bech <joakim.bech@linaro.org> (QEMU v8) | ||
| 24 | Acked-by: Jerome Forissier <jerome.forissier@linaro.org> | ||
| 25 | Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> | ||
| 26 | --- | ||
| 27 | core/lib/libtomcrypt/src/mpa_desc.c | 2 +- | ||
| 28 | core/lib/libtomcrypt/src/mpi_desc.c | 2 +- | ||
| 29 | lib/libutee/tee_api_arith_mpa.c | 3 ++- | ||
| 30 | lib/libutee/tee_api_arith_mpi.c | 3 +-- | ||
| 31 | lib/libutils/ext/include/mempool.h | 5 ++++- | ||
| 32 | lib/libutils/ext/mempool.c | 9 ++++----- | ||
| 33 | 6 files changed, 13 insertions(+), 11 deletions(-) | ||
| 34 | |||
| 35 | diff --git a/core/lib/libtomcrypt/src/mpa_desc.c b/core/lib/libtomcrypt/src/mpa_desc.c | ||
| 36 | index b407f54..58aa242 100644 | ||
| 37 | --- a/core/lib/libtomcrypt/src/mpa_desc.c | ||
| 38 | +++ b/core/lib/libtomcrypt/src/mpa_desc.c | ||
| 39 | @@ -40,7 +40,7 @@ static struct mempool *get_mpa_scratch_memory_pool(void) | ||
| 40 | #else /* CFG_WITH_PAGER */ | ||
| 41 | static struct mempool *get_mpa_scratch_memory_pool(void) | ||
| 42 | { | ||
| 43 | - static uint32_t data[LTC_MEMPOOL_U32_SIZE] __aligned(__alignof__(long)); | ||
| 44 | + static uint32_t data[LTC_MEMPOOL_U32_SIZE] __aligned(MEMPOOL_ALIGN); | ||
| 45 | |||
| 46 | return mempool_alloc_pool(data, sizeof(data), NULL); | ||
| 47 | } | ||
| 48 | diff --git a/core/lib/libtomcrypt/src/mpi_desc.c b/core/lib/libtomcrypt/src/mpi_desc.c | ||
| 49 | index a43fbb4..67bc3a7 100644 | ||
| 50 | --- a/core/lib/libtomcrypt/src/mpi_desc.c | ||
| 51 | +++ b/core/lib/libtomcrypt/src/mpi_desc.c | ||
| 52 | @@ -38,7 +38,7 @@ static struct mempool *get_mp_scratch_memory_pool(void) | ||
| 53 | #else /* CFG_WITH_PAGER */ | ||
| 54 | static struct mempool *get_mp_scratch_memory_pool(void) | ||
| 55 | { | ||
| 56 | - static uint8_t data[MPI_MEMPOOL_SIZE] __aligned(__alignof__(long)); | ||
| 57 | + static uint8_t data[MPI_MEMPOOL_SIZE] __aligned(MEMPOOL_ALIGN); | ||
| 58 | |||
| 59 | return mempool_alloc_pool(data, sizeof(data), NULL); | ||
| 60 | } | ||
| 61 | diff --git a/lib/libutee/tee_api_arith_mpa.c b/lib/libutee/tee_api_arith_mpa.c | ||
| 62 | index 0f6c7f1..a8ca6aa 100644 | ||
| 63 | --- a/lib/libutee/tee_api_arith_mpa.c | ||
| 64 | +++ b/lib/libutee/tee_api_arith_mpa.c | ||
| 65 | @@ -19,7 +19,8 @@ | ||
| 66 | |||
| 67 | static uint32_t mempool_u32[mpa_scratch_mem_size_in_U32( | ||
| 68 | MPA_INTERNAL_MEM_POOL_SIZE, | ||
| 69 | - CFG_TA_BIGNUM_MAX_BITS)]; | ||
| 70 | + CFG_TA_BIGNUM_MAX_BITS)] | ||
| 71 | + __aligned(MEMPOOL_ALIGN); | ||
| 72 | static mpa_scratch_mem mempool; | ||
| 73 | |||
| 74 | /************************************************************* | ||
| 75 | diff --git a/lib/libutee/tee_api_arith_mpi.c b/lib/libutee/tee_api_arith_mpi.c | ||
| 76 | index 8e2751b..6b074e1 100644 | ||
| 77 | --- a/lib/libutee/tee_api_arith_mpi.c | ||
| 78 | +++ b/lib/libutee/tee_api_arith_mpi.c | ||
| 79 | @@ -42,8 +42,7 @@ static void __noreturn mpi_panic(const char *func, int line, int rc) | ||
| 80 | |||
| 81 | void _TEE_MathAPI_Init(void) | ||
| 82 | { | ||
| 83 | - static uint8_t data[MPI_MEMPOOL_SIZE] | ||
| 84 | - __aligned(__alignof__(mbedtls_mpi_uint)); | ||
| 85 | + static uint8_t data[MPI_MEMPOOL_SIZE] __aligned(MEMPOOL_ALIGN); | ||
| 86 | |||
| 87 | mbedtls_mpi_mempool = mempool_alloc_pool(data, sizeof(data), NULL); | ||
| 88 | if (!mbedtls_mpi_mempool) | ||
| 89 | diff --git a/lib/libutils/ext/include/mempool.h b/lib/libutils/ext/include/mempool.h | ||
| 90 | index 62377df..2a60800 100644 | ||
| 91 | --- a/lib/libutils/ext/include/mempool.h | ||
| 92 | +++ b/lib/libutils/ext/include/mempool.h | ||
| 93 | @@ -19,9 +19,12 @@ struct mempool_item { | ||
| 94 | |||
| 95 | struct mempool; | ||
| 96 | |||
| 97 | +#define MEMPOOL_ALIGN __alignof__(long) | ||
| 98 | + | ||
| 99 | /* | ||
| 100 | * mempool_alloc_pool() - Allocate a new memory pool | ||
| 101 | - * @data: a block of memory to carve out items from | ||
| 102 | + * @data: a block of memory to carve out items from, must | ||
| 103 | + * have an alignment of MEMPOOL_ALIGN. | ||
| 104 | * @size: size fo the block of memory | ||
| 105 | * @release_mem: function to call when the pool has been emptied, | ||
| 106 | * ignored if NULL. | ||
| 107 | diff --git a/lib/libutils/ext/mempool.c b/lib/libutils/ext/mempool.c | ||
| 108 | index f977699..6d38590 100644 | ||
| 109 | --- a/lib/libutils/ext/mempool.c | ||
| 110 | +++ b/lib/libutils/ext/mempool.c | ||
| 111 | @@ -53,7 +53,6 @@ | ||
| 112 | * So the potential fragmentation is mitigated. | ||
| 113 | */ | ||
| 114 | |||
| 115 | -#define POOL_ALIGN __alignof__(long) | ||
| 116 | |||
| 117 | struct mempool { | ||
| 118 | size_t size; /* size of the memory pool, in bytes */ | ||
| 119 | @@ -130,8 +129,8 @@ mempool_alloc_pool(void *data, size_t size, | ||
| 120 | { | ||
| 121 | struct mempool *pool = calloc(1, sizeof(*pool)); | ||
| 122 | |||
| 123 | - COMPILE_TIME_ASSERT(POOL_ALIGN >= __alignof__(struct mempool_item)); | ||
| 124 | - assert(!((vaddr_t)data & (POOL_ALIGN - 1))); | ||
| 125 | + COMPILE_TIME_ASSERT(MEMPOOL_ALIGN >= __alignof__(struct mempool_item)); | ||
| 126 | + assert(!((vaddr_t)data & (MEMPOOL_ALIGN - 1))); | ||
| 127 | |||
| 128 | if (pool) { | ||
| 129 | pool->size = size; | ||
| 130 | @@ -163,13 +162,13 @@ void *mempool_alloc(struct mempool *pool, size_t size) | ||
| 131 | pool->last_offset); | ||
| 132 | offset = pool->last_offset + last_item->size; | ||
| 133 | |||
| 134 | - offset = ROUNDUP(offset, POOL_ALIGN); | ||
| 135 | + offset = ROUNDUP(offset, MEMPOOL_ALIGN); | ||
| 136 | if (offset > pool->size) | ||
| 137 | goto error; | ||
| 138 | } | ||
| 139 | |||
| 140 | size = sizeof(struct mempool_item) + size; | ||
| 141 | - size = ROUNDUP(size, POOL_ALIGN); | ||
| 142 | + size = ROUNDUP(size, MEMPOOL_ALIGN); | ||
| 143 | if (offset + size > pool->size) | ||
| 144 | goto error; | ||
| 145 | |||
| 146 | -- | ||
| 147 | 2.7.4 | ||
| 148 | |||
diff --git a/recipes-security/optee/optee-os-qoriq/0001-arm64-Disable-outline-atomics-when-compiling.patch b/recipes-security/optee/optee-os-qoriq/0001-arm64-Disable-outline-atomics-when-compiling.patch new file mode 100644 index 000000000..086d4333a --- /dev/null +++ b/recipes-security/optee/optee-os-qoriq/0001-arm64-Disable-outline-atomics-when-compiling.patch | |||
| @@ -0,0 +1,41 @@ | |||
| 1 | From f94d9558d9eae48e92ce8d651539b6cf69eb4394 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Joshua Watt <JPEWhacker@gmail.com> | ||
| 3 | Date: Mon, 18 May 2020 20:00:00 -0500 | ||
| 4 | Subject: [PATCH] arm64: Disable outline-atomics when compiling | ||
| 5 | |||
| 6 | Disables the automatic detection of LSE (Large System Extension) | ||
| 7 | instructions when compiling AArch64 code. GCC 10 implements this | ||
| 8 | detection in libgcc using __getauxval(), which optee doesn't implement. | ||
| 9 | This requires that the proper -mcpu is passed to GCC so that the code | ||
| 10 | can be correctly compiled to use either LSE or load-store-exclusive. | ||
| 11 | |||
| 12 | Fixes linker errors like the following when compiling with GCC 10: | ||
| 13 | |||
| 14 | aarch64-linux-ld.bfd: libgcc.a(lse-init.o): | ||
| 15 | in function `init_have_lse_atomics': | ||
| 16 | lse-init.c:44: undefined reference to `__getauxval' | ||
| 17 | core/arch/arm/kernel/link.mk:38: | ||
| 18 | recipe for target 'build/core/all_objs.o' failed | ||
| 19 | |||
| 20 | Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> | ||
| 21 | Upstream-Status: Submitted [https://github.com/OP-TEE/optee_os/pull/3874] | ||
| 22 | --- | ||
| 23 | core/arch/arm/arm.mk | 2 +- | ||
| 24 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 25 | |||
| 26 | diff --git a/core/arch/arm/arm.mk b/core/arch/arm/arm.mk | ||
| 27 | index a18eda3b..07069c66 100644 | ||
| 28 | --- a/core/arch/arm/arm.mk | ||
| 29 | +++ b/core/arch/arm/arm.mk | ||
| 30 | @@ -115,7 +115,7 @@ arm32-platform-aflags-no-hard-float ?= | ||
| 31 | |||
| 32 | arm64-platform-cflags-no-hard-float ?= -mgeneral-regs-only | ||
| 33 | arm64-platform-cflags-hard-float ?= | ||
| 34 | -arm64-platform-cflags-generic ?= -mstrict-align | ||
| 35 | +arm64-platform-cflags-generic ?= -mstrict-align $(call cc-option,-mno-outline-atomics,) | ||
| 36 | |||
| 37 | ifeq ($(DEBUG),1) | ||
| 38 | # For backwards compatibility | ||
| 39 | -- | ||
| 40 | 2.17.1 | ||
| 41 | |||
diff --git a/recipes-security/optee/optee-os-qoriq/0001-optee-os-fix-gcc10-compilation-issue-and-missing-cc-.patch b/recipes-security/optee/optee-os-qoriq/0001-optee-os-fix-gcc10-compilation-issue-and-missing-cc-.patch deleted file mode 100644 index f9c71d0d9..000000000 --- a/recipes-security/optee/optee-os-qoriq/0001-optee-os-fix-gcc10-compilation-issue-and-missing-cc-.patch +++ /dev/null | |||
| @@ -1,161 +0,0 @@ | |||
| 1 | From 027a3b9a33fbb23e1d1d7ed6411d4d112d2a55a1 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 | 21 ++++++++++++++++----- | ||
| 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, 31 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 0a95b1ec..bfcbe896 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 | @@ -95,7 +108,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 | @@ -124,14 +137,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 | @@ -217,8 +228,8 @@ ta-mk-file-export-add-ta_arm64 += CROSS_COMPILE64 ?= $$(CROSS_COMPILE)_nl_ | ||
| 72 | ta-mk-file-export-add-ta_arm64 += CROSS_COMPILE_ta_arm64 ?= $$(CROSS_COMPILE64)_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 | arm32-sysreg-txt = core/arch/arm/kernel/arm32_sysreg.txt | ||
| 81 | arm32-sysregs-$(arm32-sysreg-txt)-h := arm32_sysreg.h | ||
| 82 | diff --git a/core/core.mk b/core/core.mk | ||
| 83 | index 37906792..4eec217a 100644 | ||
| 84 | --- a/core/core.mk | ||
| 85 | +++ b/core/core.mk | ||
| 86 | @@ -8,6 +8,7 @@ arch-dir := core/arch/$(ARCH) | ||
| 87 | platform-dir := $(arch-dir)/plat-$(PLATFORM) | ||
| 88 | include $(platform-dir)/conf.mk | ||
| 89 | include mk/config.mk | ||
| 90 | +# $(ARCH).mk also sets the compiler for the core module | ||
| 91 | include core/arch/$(ARCH)/$(ARCH).mk | ||
| 92 | |||
| 93 | PLATFORM_$(PLATFORM) := y | ||
| 94 | @@ -16,10 +17,6 @@ PLATFORM_FLAVOR_$(PLATFORM_FLAVOR) := y | ||
| 95 | $(call cfg-depends-all,CFG_PAGED_USER_TA,CFG_WITH_PAGER CFG_WITH_USER_TA) | ||
| 96 | include core/crypto.mk | ||
| 97 | |||
| 98 | -# Setup compiler for this sub module | ||
| 99 | -COMPILER_$(sm) ?= $(COMPILER) | ||
| 100 | -include mk/$(COMPILER_$(sm)).mk | ||
| 101 | - | ||
| 102 | cppflags$(sm) += -D__KERNEL__ | ||
| 103 | |||
| 104 | cppflags$(sm) += -Icore/include | ||
| 105 | diff --git a/mk/cc-option.mk b/mk/cc-option.mk | ||
| 106 | new file mode 100644 | ||
| 107 | index 00000000..4699fbcc | ||
| 108 | --- /dev/null | ||
| 109 | +++ b/mk/cc-option.mk | ||
| 110 | @@ -0,0 +1,9 @@ | ||
| 111 | +_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) | ||
| 112 | +_cc-opt-cached-var-name = $(subst =,~,$(strip cached-cc-option-$(1)-$(subst $(empty) $(empty),,$(CC$(sm))))) | ||
| 113 | +define _cc-option | ||
| 114 | +$(eval _var_name := $(call _cc-opt-cached-var-name,$(1))) | ||
| 115 | +$(eval $(_var_name) := $(if $(filter $(origin $(_var_name)),undefined),$(call _cc-option-supported,$(1)),$($(_var_name)))) | ||
| 116 | +$(if $($(_var_name)),$(1),$(2)) | ||
| 117 | +endef | ||
| 118 | +cc-option = $(strip $(call _cc-option,$(1),$(2))) | ||
| 119 | + | ||
| 120 | diff --git a/mk/gcc.mk b/mk/gcc.mk | ||
| 121 | index c516c731..330b200a 100644 | ||
| 122 | --- a/mk/gcc.mk | ||
| 123 | +++ b/mk/gcc.mk | ||
| 124 | @@ -12,7 +12,7 @@ nostdinc$(sm) := -nostdinc -isystem $(shell $(CC$(sm)) \ | ||
| 125 | -print-file-name=include 2> /dev/null) | ||
| 126 | |||
| 127 | # Get location of libgcc from gcc | ||
| 128 | -libgcc$(sm) := $(shell $(CC$(sm)) $(LIBGCC_LOCATE_CFLAGS) $(CFLAGS$(arch-bits-$(sm))) $(comp-cflags$(sm)) \ | ||
| 129 | +libgcc$(sm) := $(shell $(CC$(sm)) $(LIBGCC_LOCATE_CFLAGS) $(CFLAGS$(arch-bits-$(sm))) \ | ||
| 130 | -print-libgcc-file-name 2> /dev/null) | ||
| 131 | |||
| 132 | # Define these to something to discover accidental use | ||
| 133 | diff --git a/ta/mk/ta_dev_kit.mk b/ta/mk/ta_dev_kit.mk | ||
| 134 | index 8473c6df..40e77c3e 100644 | ||
| 135 | --- a/ta/mk/ta_dev_kit.mk | ||
| 136 | +++ b/ta/mk/ta_dev_kit.mk | ||
| 137 | @@ -86,6 +86,9 @@ clean: | ||
| 138 | @$(cmd-echo-silent) ' CLEAN $(O)' | ||
| 139 | ${q}if [ -d "$(O)" ]; then $(RMDIR) $(O); fi | ||
| 140 | |||
| 141 | +include $(ta-dev-kit-dir$(sm))/mk/$(COMPILER_$(sm)).mk | ||
| 142 | +include $(ta-dev-kit-dir$(sm))/mk/cc-option.mk | ||
| 143 | + | ||
| 144 | subdirs = . | ||
| 145 | include $(ta-dev-kit-dir$(sm))/mk/subdir.mk | ||
| 146 | |||
| 147 | diff --git a/ta/ta.mk b/ta/ta.mk | ||
| 148 | index 1b7e999d..e0915d18 100644 | ||
| 149 | --- a/ta/ta.mk | ||
| 150 | +++ b/ta/ta.mk | ||
| 151 | @@ -105,6 +105,7 @@ $(foreach f, $(libfiles), \ | ||
| 152 | |||
| 153 | # Copy .mk files | ||
| 154 | ta-mkfiles = mk/compile.mk mk/subdir.mk mk/gcc.mk mk/cleandirs.mk \ | ||
| 155 | + mk/cc-option.mk \ | ||
| 156 | ta/arch/$(ARCH)/link.mk ta/arch/$(ARCH)/link_shlib.mk \ | ||
| 157 | ta/mk/ta_dev_kit.mk | ||
| 158 | |||
| 159 | -- | ||
| 160 | 2.17.1 | ||
| 161 | |||
diff --git a/recipes-security/optee/optee-os-qoriq/0001-use-python3-instead-of-python.patch b/recipes-security/optee/optee-os-qoriq/0001-use-python3-instead-of-python.patch deleted file mode 100644 index 6ecc6152a..000000000 --- a/recipes-security/optee/optee-os-qoriq/0001-use-python3-instead-of-python.patch +++ /dev/null | |||
| @@ -1,80 +0,0 @@ | |||
| 1 | diff --git a/scripts/arm32_sysreg.py b/scripts/arm32_sysreg.py | ||
| 2 | index bd0c619e..530b0f44 100755 | ||
| 3 | --- a/scripts/arm32_sysreg.py | ||
| 4 | +++ b/scripts/arm32_sysreg.py | ||
| 5 | @@ -1,4 +1,4 @@ | ||
| 6 | -#!/usr/bin/env python | ||
| 7 | +#!/usr/bin/env python3 | ||
| 8 | # SPDX-License-Identifier: BSD-2-Clause | ||
| 9 | # | ||
| 10 | # Copyright (c) 2018, Linaro Limited | ||
| 11 | diff --git a/scripts/gen_hashed_bin.py b/scripts/gen_hashed_bin.py | ||
| 12 | index 67b2b049..619cf26e 100755 | ||
| 13 | --- a/scripts/gen_hashed_bin.py | ||
| 14 | +++ b/scripts/gen_hashed_bin.py | ||
| 15 | @@ -1,4 +1,4 @@ | ||
| 16 | -#!/usr/bin/env python | ||
| 17 | +#!/usr/bin/env python3 | ||
| 18 | # SPDX-License-Identifier: BSD-2-Clause | ||
| 19 | # | ||
| 20 | # Copyright (c) 2014-2017, Linaro Limited | ||
| 21 | diff --git a/scripts/gen_ld_sects.py b/scripts/gen_ld_sects.py | ||
| 22 | index 43e812b5..bc82dd8b 100755 | ||
| 23 | --- a/scripts/gen_ld_sects.py | ||
| 24 | +++ b/scripts/gen_ld_sects.py | ||
| 25 | @@ -1,4 +1,4 @@ | ||
| 26 | -#!/usr/bin/env python | ||
| 27 | +#!/usr/bin/env python3 | ||
| 28 | # SPDX-License-Identifier: BSD-2-Clause | ||
| 29 | # | ||
| 30 | # Copyright (c) 2017, Linaro Limited | ||
| 31 | diff --git a/scripts/pem_to_pub_c.py b/scripts/pem_to_pub_c.py | ||
| 32 | index ddc17c18..69a4355c 100755 | ||
| 33 | --- a/scripts/pem_to_pub_c.py | ||
| 34 | +++ b/scripts/pem_to_pub_c.py | ||
| 35 | @@ -1,4 +1,4 @@ | ||
| 36 | -#!/usr/bin/env python | ||
| 37 | +#!/usr/bin/env python3 | ||
| 38 | # SPDX-License-Identifier: BSD-2-Clause | ||
| 39 | # | ||
| 40 | # Copyright (c) 2015, Linaro Limited | ||
| 41 | diff --git a/scripts/sign.py b/scripts/sign.py | ||
| 42 | index 84fd7714..f6e6b667 100755 | ||
| 43 | --- a/scripts/sign.py | ||
| 44 | +++ b/scripts/sign.py | ||
| 45 | @@ -1,4 +1,4 @@ | ||
| 46 | -#!/usr/bin/env python | ||
| 47 | +#!/usr/bin/env python3 | ||
| 48 | # | ||
| 49 | # Copyright (c) 2015, 2017, Linaro Limited | ||
| 50 | # | ||
| 51 | diff --git a/scripts/symbolize.py b/scripts/symbolize.py | ||
| 52 | index 99a48c70..cbd9884a 100755 | ||
| 53 | --- a/scripts/symbolize.py | ||
| 54 | +++ b/scripts/symbolize.py | ||
| 55 | @@ -1,4 +1,4 @@ | ||
| 56 | -#!/usr/bin/env python | ||
| 57 | +#!/usr/bin/env python3 | ||
| 58 | # SPDX-License-Identifier: BSD-2-Clause | ||
| 59 | # | ||
| 60 | # Copyright (c) 2017, Linaro Limited | ||
| 61 | diff --git a/scripts/ta_bin_to_c.py b/scripts/ta_bin_to_c.py | ||
| 62 | index 1496f816..a01e7f9b 100755 | ||
| 63 | --- a/scripts/ta_bin_to_c.py | ||
| 64 | +++ b/scripts/ta_bin_to_c.py | ||
| 65 | @@ -1,4 +1,4 @@ | ||
| 66 | -#!/usr/bin/env python | ||
| 67 | +#!/usr/bin/env python3 | ||
| 68 | # SPDX-License-Identifier: BSD-2-Clause | ||
| 69 | # | ||
| 70 | # Copyright (c) 2017, Linaro Limited | ||
| 71 | diff --git a/scripts/tee_bin_parser.py b/scripts/tee_bin_parser.py | ||
| 72 | index 8356ad5d..4409074b 100755 | ||
| 73 | --- a/scripts/tee_bin_parser.py | ||
| 74 | +++ b/scripts/tee_bin_parser.py | ||
| 75 | @@ -1,4 +1,4 @@ | ||
| 76 | -#!/usr/bin/env python | ||
| 77 | +#!/usr/bin/env python3 | ||
| 78 | # SPDX-License-Identifier: BSD-2-Clause | ||
| 79 | # | ||
| 80 | # Copyright (c) 2016, Linaro Limited | ||
diff --git a/recipes-security/optee/optee-os-qoriq_git.bb b/recipes-security/optee/optee-os-qoriq_3.8.0.bb index d7b28278b..b8d764ff5 100644 --- a/recipes-security/optee/optee-os-qoriq_git.bb +++ b/recipes-security/optee/optee-os-qoriq_3.8.0.bb | |||
| @@ -2,24 +2,26 @@ SUMMARY = "OP-TEE Trusted OS" | |||
| 2 | DESCRIPTION = "OPTEE OS" | 2 | DESCRIPTION = "OPTEE OS" |
| 3 | 3 | ||
| 4 | LICENSE = "BSD" | 4 | LICENSE = "BSD" |
| 5 | LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=69663ab153298557a59c67a60a743e5b" | 5 | LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=c1f21c4f72f372ef38a5a4aee55ec173" |
| 6 | 6 | ||
| 7 | DEPENDS = "python3-pycrypto-native" | 7 | PV = "3.8+git${SRCPV}" |
| 8 | |||
| 9 | DEPENDS += "python3-pyelftools-native python3-pycryptodome-native python3-pycryptodomex-native dtc-native" | ||
| 8 | 10 | ||
| 9 | inherit deploy python3native | 11 | inherit deploy python3native |
| 10 | 12 | ||
| 11 | SRCREV = "4e8d2e5307b99a91a0cac3ea3560ecb7d62898d6" | ||
| 12 | SRC_URI = "git://source.codeaurora.org/external/qoriq/qoriq-components/optee_os;nobranch=1 \ | 13 | SRC_URI = "git://source.codeaurora.org/external/qoriq/qoriq-components/optee_os;nobranch=1 \ |
| 13 | file://0001-allow-setting-sysroot-for-libgcc-lookup.patch \ | 14 | file://0001-allow-setting-sysroot-for-libgcc-lookup.patch \ |
| 14 | file://0001-Fix-alignment-of-data-for-mempool_alloc_pool.patch \ | 15 | file://0001-arm64-Disable-outline-atomics-when-compiling.patch \ |
| 15 | file://0001-use-python3-instead-of-python.patch \ | ||
| 16 | file://0001-optee-os-fix-gcc10-compilation-issue-and-missing-cc-.patch \ | ||
| 17 | " | 16 | " |
| 17 | SRCREV = "0cb01f7f6aee552ead49990c06f69f73f459cc65" | ||
| 18 | |||
| 18 | S = "${WORKDIR}/git" | 19 | S = "${WORKDIR}/git" |
| 19 | 20 | ||
| 20 | OPTEEMACHINE ?= "${MACHINE}" | 21 | OPTEEMACHINE ?= "${MACHINE}" |
| 21 | OPTEEMACHINE_ls1088ardb-pb = "ls1088ardb" | 22 | OPTEEMACHINE_ls1088ardb-pb = "ls1088ardb" |
| 22 | OPTEEMACHINE_ls1046afrwy = "ls1046ardb" | 23 | OPTEEMACHINE_ls1046afrwy = "ls1046ardb" |
| 24 | OPTEEMACHINE_lx2162aqds = "lx2160aqds" | ||
| 23 | 25 | ||
| 24 | EXTRA_OEMAKE = "PLATFORM=ls-${OPTEEMACHINE} CFG_ARM64_core=y \ | 26 | EXTRA_OEMAKE = "PLATFORM=ls-${OPTEEMACHINE} CFG_ARM64_core=y \ |
| 25 | ARCH=arm \ | 27 | ARCH=arm \ |
| @@ -29,6 +31,7 @@ EXTRA_OEMAKE = "PLATFORM=ls-${OPTEEMACHINE} CFG_ARM64_core=y \ | |||
| 29 | LDFLAGS= \ | 31 | LDFLAGS= \ |
| 30 | LIBGCC_LOCATE_CFLAGS=--sysroot=${STAGING_DIR_HOST} \ | 32 | LIBGCC_LOCATE_CFLAGS=--sysroot=${STAGING_DIR_HOST} \ |
| 31 | " | 33 | " |
| 34 | EXTRA_OEMAKE_append_lx2162aqds = " CFG_EMBED_DTB_SOURCE_FILE=fsl-lx2160a-qds.dts CFG_EMBED_DT=y" | ||
| 32 | 35 | ||
| 33 | OPTEE_ARCH_armv7a = "arm32" | 36 | OPTEE_ARCH_armv7a = "arm32" |
| 34 | OPTEE_ARCH_aarch64 = "arm64" | 37 | OPTEE_ARCH_aarch64 = "arm64" |
