From 1c7d6584a7811b7785ae5c1e378f14b5ba0971cf Mon Sep 17 00:00:00 2001 From: takeshi_hoshina Date: Mon, 2 Nov 2020 11:07:33 +0900 Subject: basesystem-jj recipes --- ...01-flags-do-not-override-CFLAGS-from-host.patch | 54 ++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 bsp/meta-freescale/recipes-security/optee-imx/optee-client/0001-flags-do-not-override-CFLAGS-from-host.patch (limited to 'bsp/meta-freescale/recipes-security/optee-imx/optee-client/0001-flags-do-not-override-CFLAGS-from-host.patch') diff --git a/bsp/meta-freescale/recipes-security/optee-imx/optee-client/0001-flags-do-not-override-CFLAGS-from-host.patch b/bsp/meta-freescale/recipes-security/optee-imx/optee-client/0001-flags-do-not-override-CFLAGS-from-host.patch new file mode 100644 index 00000000..86c360f2 --- /dev/null +++ b/bsp/meta-freescale/recipes-security/optee-imx/optee-client/0001-flags-do-not-override-CFLAGS-from-host.patch @@ -0,0 +1,54 @@ +From 6a600c5637c5446ab3d11eb4304a1dd473ec503e 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 | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/flags.mk b/flags.mk +index 71f3d18..faabef9 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 \ +@@ -15,11 +15,11 @@ CFLAGS := -Wall -Wbad-function-cast -Wcast-align \ + -Wpointer-arith -Wshadow -Wstrict-prototypes \ + -Wswitch-default -Wunsafe-loop-optimizations \ + -Wwrite-strings -Werror +-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 + -- cgit 1.2.3-korg