From e6e0b794bad8a092614fa7f37a9e4345aaaabee0 Mon Sep 17 00:00:00 2001 From: Andrey Zhizhikin Date: Sun, 31 May 2020 22:02:35 +0000 Subject: [PATCH] optee-client: add patch to avoid CFLAGS overrides Base optee-client implementation uses immediate assignment of CFLAGS variable in it's build structure, which causes Yocto CFLAGS to be overridden and not properly propagated into the build system. Introduce a patch which uses append operator intead of immediate assignment to have both CFLAGS variables to be combined. Signed-off-by: Andrey Zhizhikin --- ...ags-do-not-override-CFLAGS-from-host.patch | 34 +++++++++++++++++++ .../optee-imx/optee-client_3.2.0.imx.bb | 4 ++- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 recipes-security/optee-imx/optee-client/0001-flags-do-not-override-CFLAGS-from-host.patch 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 new file mode 100644 index 00000000..3bbf898b --- /dev/null +++ b/recipes-security/optee-imx/optee-client/0001-flags-do-not-override-CFLAGS-from-host.patch @@ -0,0 +1,34 @@ +From ea7e0fba6da734e5f99f84d10d456ceaaed05883 Mon Sep 17 00:00:00 2001 +From: Andrey Zhizhikin +Date: Sun, 31 May 2020 20:40:25 +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, so the former +definition of CFLAGS gets properly expanded. + +Upstream-Status: Submitted [https://github.com/OP-TEE/optee_client/pull/211] + +Signed-off-by: Andrey Zhizhikin +--- + flags.mk | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/flags.mk b/flags.mk +index 71f3d18..af13495 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 \ ++CFLAGS += -Wall -Wbad-function-cast -Wcast-align \ + -Werror-implicit-function-declaration -Wextra \ + -Wfloat-equal -Wformat-nonliteral -Wformat-security \ + -Wformat=2 -Winit-self -Wmissing-declarations \ +-- +2.17.1 + diff --git a/recipes-security/optee-imx/optee-client_3.2.0.imx.bb b/recipes-security/optee-imx/optee-client_3.2.0.imx.bb index d3607ed4..19770849 100644 --- a/recipes-security/optee-imx/optee-client_3.2.0.imx.bb +++ b/recipes-security/optee-imx/optee-client_3.2.0.imx.bb @@ -13,7 +13,9 @@ SRC_URI = "${OPTEE_CLIENT_SRC};branch=${SRCBRANCH}" SRCREV = "71a9bef78fff2d5d4db8a2307d3b91e2aa671dc9" -SRC_URI_append = " file://tee-supplicant.service" +SRC_URI += "file://tee-supplicant.service \ + file://0001-flags-do-not-override-CFLAGS-from-host.patch \ +" S = "${WORKDIR}/git" SYSTEMD_SERVICE_${PN} = "tee-supplicant.service" -- 2.40.1