[PATCH] arm/optee: Simplify examples recipe

[email protected]
Newsgroups org.yoctoproject.lists.meta-arm
Message-ID <[email protected]>
From: Vyacheslav Yurkov <[email protected]>

Signed-off-by: Vyacheslav Yurkov <[email protected]>
---
 .../recipes-security/optee/optee-examples.inc |  6 ++--
 ...001-Makefile-Avoid-variable-override.patch | 32 +++++++++++++++++++
 2 files changed, 35 insertions(+), 3 deletions(-)
 create mode 100644 meta-arm/recipes-security/optee/optee-examples/0001-Makefile-Avoid-variable-override.patch

diff --git a/meta-arm/recipes-security/optee/optee-examples.inc b/meta-arm/recipes-security/optee/optee-examples.inc
index 648e8c2e..f274f6fa 100644
--- a/meta-arm/recipes-security/optee/optee-examples.inc
+++ b/meta-arm/recipes-security/optee/optee-examples.inc
@@ -12,11 +12,11 @@ inherit python3native
 require optee.inc
 
 SRC_URI = "git://github.com/linaro-swg/optee_examples.git;branch=master;protocol=https \
+           file://0001-Makefile-Avoid-variable-override.patch \
            "
 
-EXTRA_OEMAKE += "TA_DEV_KIT_DIR=${TA_DEV_KIT_DIR} \
-                 HOST_CROSS_COMPILE=${HOST_PREFIX} \
-                 TA_CROSS_COMPILE=${HOST_PREFIX} \
+EXTRA_OEMAKE = "TA_DEV_KIT_DIR=${TA_DEV_KIT_DIR} \
+                 CROSS_COMPILE=${HOST_PREFIX} \
                  OUTPUT_DIR=${B} \
                "
 
diff --git a/meta-arm/recipes-security/optee/optee-examples/0001-Makefile-Avoid-variable-override.patch b/meta-arm/recipes-security/optee/optee-examples/0001-Makefile-Avoid-variable-override.patch
new file mode 100644
index 00000000..170fe461
--- /dev/null
+++ b/meta-arm/recipes-security/optee/optee-examples/0001-Makefile-Avoid-variable-override.patch
@@ -0,0 +1,32 @@
+From ad981dad843712c21a01f61461fd5cd34f147b4a Mon Sep 17 00:00:00 2001
+From: Vyacheslav Yurkov <[email protected]>
+Date: Thu, 9 Oct 2025 08:30:52 +0000
+Subject: [PATCH] Makefile: Avoid variable override
+
+When CROSS_COMPILE is set in the environment / command line, we should
+not directly pass it to the subshell, otherwise it's evaluated to an
+empty string.
+
+Signed-off-by: Vyacheslav Yurkov <[email protected]>
+Acked-by: Jerome Forissier <[email protected]>
+Acked-by: Mikko Rapeli [email protected]
+
+Upstream-Status: Backport
+[https://github.com/linaro-swg/optee_examples/commit/bbaca7ef34c82c052c6e1470cf379561952fc995]
+---
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index 9359d95..4256139 100644
+--- a/Makefile
++++ b/Makefile
+@@ -12,7 +12,7 @@ clean: examples-clean prepare-for-rootfs-clean
+ 
+ examples:
+ 	@for example in $(EXAMPLE_LIST); do \
+-		$(MAKE) -C $$example CROSS_COMPILE="$(HOST_CROSS_COMPILE)" || exit 1; \
++		$(MAKE) -C $$example || exit 1; \
+ 	done
+ 
+ examples-clean:
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.