[meta-freescale] [PATCH] imx-{lib,vpu}: obey CFLAGS, LDFLAGS

Christopher Larson kergoth at gmail.com
Wed Sep 3 10:49:40 PDT 2014


From: Christopher Larson <chris_larson at mentor.com>

This quiets GNU_HASH warnings when building with an external toolchain.

Signed-off-by: Christopher Larson <chris_larson at mentor.com>
---
 .../imx-lib/imx-lib-11.09.02/obey-variables.patch  | 209 +++++++++++++++++++++
 .../imx-lib-3.10.17-1.0.0/obey-variables.patch     | 209 +++++++++++++++++++++
 recipes-bsp/imx-lib/imx-lib_11.09.02.bb            |   3 +-
 recipes-bsp/imx-lib/imx-lib_3.10.17-1.0.0.bb       |   1 +
 .../imx-vpu/imx-vpu-11.09.02/obey-variables.patch  |  27 +++
 .../imx-vpu-3.10.17-1.0.0/obey-variables.patch     |  27 +++
 recipes-bsp/imx-vpu/imx-vpu_11.09.02.bb            |   1 +
 recipes-bsp/imx-vpu/imx-vpu_3.10.17-1.0.0.bb       |   5 +-
 8 files changed, 480 insertions(+), 2 deletions(-)
 create mode 100644 recipes-bsp/imx-lib/imx-lib-11.09.02/obey-variables.patch
 create mode 100644 recipes-bsp/imx-lib/imx-lib-3.10.17-1.0.0/obey-variables.patch
 create mode 100644 recipes-bsp/imx-vpu/imx-vpu-11.09.02/obey-variables.patch
 create mode 100644 recipes-bsp/imx-vpu/imx-vpu-3.10.17-1.0.0/obey-variables.patch

diff --git a/recipes-bsp/imx-lib/imx-lib-11.09.02/obey-variables.patch b/recipes-bsp/imx-lib/imx-lib-11.09.02/obey-variables.patch
new file mode 100644
index 0000000..901345a
--- /dev/null
+++ b/recipes-bsp/imx-lib/imx-lib-11.09.02/obey-variables.patch
@@ -0,0 +1,209 @@
+Obey CFLAGS, LDFLAGS
+
+Signed-off-by: Christopher Larson <chris_larson at mentor.com>
+Upstream-status: Pending
+
+--- imx-lib-11.09.02.orig/hdmi-cec/Makefile	2014-09-02 13:04:37.114250749 -0700
++++ imx-lib-11.09.02/hdmi-cec/Makefile	2014-09-02 13:04:37.086250568 -0700
+@@ -1,5 +1,6 @@
+ CC ?=$(CROSS_COMPILE)gcc
+ AR ?=$(CROSS_COMPILE)ar
++CFLAGS ?=-O2
+ 
+ # list of platforms which want this test case
+ INCLUDE_LIST:= IMX6Q
+@@ -32,10 +33,10 @@
+ endif
+ 
+ %.o: %.c
+-	$(CC) -D$(PLATFORM) -Wall -O2 -fPIC -c $^ -o $@
++	$(CC) -D$(PLATFORM) -Wall -fPIC $(CFLAGS) -c $^ -o $@
+ 
+ $(LIBNAME).so.$(SONAMEVERSION): $(OBJ)
+-	$(CC) -shared -nostartfiles -Wl,-soname,$@ $^ -o $@
++	$(CC) -shared -nostartfiles -Wl,-soname,$@ $^ -o $@ $(LDFLAGS)
+ 
+ $(LIBNAME).so: $(LIBNAME).so.$(SONAMEVERSION)
+ 	ln -s $< $@
+--- imx-lib-11.09.02.orig/ipu/Makefile	2014-09-02 13:04:37.114250749 -0700
++++ imx-lib-11.09.02/ipu/Makefile	2014-09-02 13:05:11.062458117 -0700
+@@ -1,5 +1,6 @@
+ CC ?=$(CROSS_COMPILE)gcc
+ AR ?=$(CROSS_COMPILE)ar
++CFLAGS ?=-O2
+ 
+ ifeq ($(PLATFORM), IMX6Q)
+ OBJS = mxc_ipu_hl_lib_dummy.o
+@@ -28,7 +29,7 @@
+ endif
+ 
+ $(LIBNAME).so.$(SONAMEVERSION): $(OBJS)
+-	$(CC) -shared -nostartfiles -Wl,-soname,$@ -o $@ $^ -lpthread
++	$(CC) -shared -nostartfiles -Wl,-soname,$@ -o $@ $^ -lpthread $(LDFLAGS)
+ 
+ $(LIBNAME).so: $(LIBNAME).so.$(SONAMEVERSION)
+ 	ln -s $< $@
+@@ -37,7 +38,7 @@
+ ifeq "$(PLATFORM)" ""
+ 	$(error "Unspecified PLATFORM variable")
+ endif
+-	$(CC) -D$(PLATFORM) $(INCLUDE) -Wall -O2 -fPIC -c $^ -o $@
++	$(CC) -D$(PLATFORM) $(INCLUDE) -Wall -fPIC $(CFLAGS) -c $^ -o $@
+ 
+ .PHONY: clean
+ clean:
+--- imx-lib-11.09.02.orig/pxp/Makefile	2014-09-02 13:04:37.114250749 -0700
++++ imx-lib-11.09.02/pxp/Makefile	2014-09-02 13:05:53.354716651 -0700
+@@ -1,5 +1,6 @@
+ CC ?=$(CROSS_COMPILE)gcc
+ AR ?=$(CROSS_COMPILE)ar
++CFLAGS ?=-O2
+ 
+ # list of platforms which want this test case
+ INCLUDE_LIST:=IMX50 IMX51 IMX5 IMX6Q IMX6S
+@@ -25,10 +26,10 @@
+ endif
+ 
+ %.o: %.c
+-	$(CC) -D$(PLATFORM) $(INCLUDE) -Wall -O2 -fPIC -c $^ -o $@
++	$(CC) -D$(PLATFORM) $(INCLUDE) -Wall -fPIC $(CFLAGS) -c $^ -o $@
+ 
+ $(LIBNAME).so.$(SONAMEVERSION): $(OBJ)
+-	$(CC) -shared -nostartfiles -Wl,-soname,$@ $^ -o $@
++	$(CC) -shared -nostartfiles -Wl,-soname,$@ $^ -o $@ $(LDFLAGS)
+ 
+ $(LIBNAME).so: $(LIBNAME).so.$(SONAMEVERSION)
+ 	ln -s $< $@
+--- imx-lib-11.09.02.orig/rng/Makefile	2014-09-02 13:04:37.114250749 -0700
++++ imx-lib-11.09.02/rng/Makefile	2014-09-02 13:04:37.086250568 -0700
+@@ -4,16 +4,17 @@
+ AR = ar -crv
+ RM = rm -f
+ CC ?=$(CROSS_COMPILE)gcc
+-LD=$(CROSS_COMPILE)ld
++LD ?=$(CROSS_COMPILE)ld
++CFLAGS ?=-g
+ 
+ INC := $(INCLUDE)
+ 
+ # Add compilation checks
+-CFLAGS += -g -Wall -W -Wmissing-prototypes -Wstrict-prototypes -Wdeclaration-after-statement -fPIC
++override CFLAGS += -Wall -W -Wmissing-prototypes -Wstrict-prototypes -Wdeclaration-after-statement -fPIC
+ 
+ # In absence of kernel CONFIG flags, set API library to build on
+ # 'unknown' platform.
+-CFLAGS += -DFSL_PLATFORM_OTHER -DFSL_HAVE_RNGC $(INC)
++override CFLAGS += -DFSL_PLATFORM_OTHER -DFSL_HAVE_RNGC $(INC)
+ 
+ OBJS= fsl_shw_rand.o  fsl_shw_hash.o  fsl_shw_sym.o  fsl_shw_user.o         \
+ 		fsl_shw_keystore.o fsl_shw_auth.o  fsl_shw_hmac.o  fsl_shw_wrap.o
+@@ -34,7 +35,7 @@
+ 	$(AR) $@ $^
+ 
+ $(LIBNAME).so.$(SONAMEVERSION): $(OBJS)
+-	$(CC) -shared -nostartfiles -Wl,-soname,$@ -o $@ $^
++	$(CC) -shared -nostartfiles -Wl,-soname,$@ -o $@ $^ $(LDFLAGS)
+ 
+ $(LIBNAME).so: $(LIBNAME).so.$(SONAMEVERSION)
+ 	ln -s $< $@
+--- imx-lib-11.09.02.orig/sahara2/Makefile	2014-09-02 13:04:37.114250749 -0700
++++ imx-lib-11.09.02/sahara2/Makefile	2014-09-02 13:04:37.086250568 -0700
+@@ -4,7 +4,8 @@
+ AR = ar -crv
+ RM = rm -f
+ CC ?=$(CROSS_COMPILE)gcc
+-LD=$(CROSS_COMPILE)ld
++LD ?=$(CROSS_COMPILE)ld
++CFLAGS ?=-g
+ 
+ INC := $(INCLUDE)
+ 
+@@ -18,19 +19,19 @@
+ endif
+ 
+ # Add compilation checks
+-CFLAGS += -g -Wall -W -Wmissing-prototypes -Wstrict-prototypes -Wdeclaration-after-statement -fPIC
++override CFLAGS += -Wall -W -Wmissing-prototypes -Wstrict-prototypes -Wdeclaration-after-statement -fPIC
+ 
+ OBJS= fsl_shw_rand.o  fsl_shw_hash.o  fsl_shw_sym.o  fsl_shw_user.o         \
+       fsl_shw_auth.o  fsl_shw_hmac.o  fsl_shw_wrap.o  fsl_shw_keystore.o um_adaptor.o  sf_util.o
+ 
+ 
+ #CFLAGS += -DSAHARA -DLINUX -I$(APIINCDIR)
+-CFLAGS += -DSAHARA -DLINUX $(INC)
+-CFLAGS += $(TARGET_ARCH)
++override CFLAGS += -DSAHARA -DLINUX $(INC)
++override CFLAGS += $(TARGET_ARCH)
+ # Uncomment to debug Library's creation of structures for driver
+-#CFLAGS +=  -DDIAG_SECURITY_FUNC
++#override CFLAGS +=  -DDIAG_SECURITY_FUNC
+ # Uncomment to simulate memory allocation errors
+-#CFLAGS += -DDIAG_MEM_ERRORS -DDIAG_MEM_CONST=5
++#override CFLAGS += -DDIAG_MEM_ERRORS -DDIAG_MEM_CONST=5
+ 
+ LIBNAME=libsahara
+ SONAMEVERSION=0
+@@ -53,7 +54,7 @@
+ 	$(AR) $@ $^
+ 
+ $(LIBNAME).so.$(SONAMEVERSION): $(OBJS)
+-	$(CC) -shared -nostartfiles -Wl,-soname,$@ -o $@ $^
++	$(CC) -shared -nostartfiles -Wl,-soname,$@ -o $@ $^ $(LDFLAGS)
+ 
+ $(LIBNAME).so: $(LIBNAME).so.$(SONAMEVERSION)
+ 	ln -s $< $@
+--- imx-lib-11.09.02.orig/screenlayer/Makefile	2014-09-02 13:04:37.114250749 -0700
++++ imx-lib-11.09.02/screenlayer/Makefile	2014-09-02 13:04:37.086250568 -0700
+@@ -1,5 +1,6 @@
+ CC ?=$(CROSS_COMPILE)gcc
+ AR ?=$(CROSS_COMPILE)ar
++CFLAGS ?=-O2
+ INC = $(INCLUDE) -I../ipu
+ 
+ OBJS = ScreenLayer.o
+@@ -24,13 +25,13 @@
+ endif
+ 
+ $(LIBNAME).so.$(SONAMEVERSION): $(OBJS)
+-	$(CC) -shared -nostartfiles -Wl,-soname,$@ -o $@ $^ -L../ipu -lipu
++	$(CC) -shared -nostartfiles -Wl,-soname,$@ -o $@ $^ -L../ipu -lipu $(LDFLAGS)
+ 
+ $(LIBNAME).so: $(LIBNAME).so.$(SONAMEVERSION)
+ 	ln -s $< $@
+ 
+ %.o: %.c
+-	$(CC) $(INC) -Wall -O2 -fPIC -c $^ -o $@
++	$(CC) $(INC) -Wall -fPIC $(CFLAGS) -c $^ -o $@
+ 
+ .PHONY: clean
+ clean:
+--- imx-lib-11.09.02.orig/sim/Makefile	2014-09-02 13:04:37.114250749 -0700
++++ imx-lib-11.09.02/sim/Makefile	2014-09-02 13:04:37.086250568 -0700
+@@ -1,9 +1,10 @@
+ CC ?=$(CROSS_COMPILE)gcc
+ AR ?=$(CROSS_COMPILE)ar
++CFLAGS ?=-O2
+ 
+ OBJS = iso7816-3.o
+ 
+-CFLAGS += $(INCLUDE)
++override CFLAGS += $(INCLUDE)
+ 
+ LIBNAME=libsim
+ SONAMEVERSION=0
+@@ -21,13 +22,13 @@
+ 	cp iso7816-3.h $(DEST_DIR)/usr/include
+ 
+ $(LIBNAME).so.$(SONAMEVERSION): $(OBJS)
+-	$(CC) -shared -nostartfiles -Wl,-soname,$@ -o $@ $^ -lpthread
++	$(CC) -shared -nostartfiles -Wl,-soname,$@ -o $@ $^ -lpthread $(LDFLAGS)
+ 
+ $(LIBNAME).so: $(LIBNAME).so.$(SONAMEVERSION)
+ 	ln -s $< $@
+ 
+ %.o: %.c
+-	$(CC) -D$(PLATFORM) $(INCLUDE) -Wall -O2 -fPIC -c $^ -o $@
++	$(CC) -D$(PLATFORM) $(INCLUDE) -Wall -fPIC $(CFLAGS) -c $^ -o $@
+ 
+ else
+ all install :
diff --git a/recipes-bsp/imx-lib/imx-lib-3.10.17-1.0.0/obey-variables.patch b/recipes-bsp/imx-lib/imx-lib-3.10.17-1.0.0/obey-variables.patch
new file mode 100644
index 0000000..cc6319f
--- /dev/null
+++ b/recipes-bsp/imx-lib/imx-lib-3.10.17-1.0.0/obey-variables.patch
@@ -0,0 +1,209 @@
+Obey CFLAGS, LDFLAGS
+
+Signed-off-by: Christopher Larson <chris_larson at mentor.com>
+Upstream-status: Pending
+
+--- imx-lib-3.10.17-1.0.0_beta.orig/hdmi-cec/Makefile
++++ imx-lib-3.10.17-1.0.0_beta/hdmi-cec/Makefile
+@@ -1,5 +1,6 @@
+ CC ?=$(CROSS_COMPILE)gcc
+ AR ?=$(CROSS_COMPILE)ar
++CFLAGS ?=-O2
+ 
+ # list of platforms which want this test case
+ INCLUDE_LIST:= IMX6Q
+@@ -32,10 +33,10 @@ all install :
+ endif
+ 
+ %.o: %.c
+-	$(CC) -D$(PLATFORM) -Wall -O2 -fPIC -c $^ -o $@
++	$(CC) -D$(PLATFORM) -Wall -fPIC $(CFLAGS) -c $^ -o $@
+ 
+ $(LIBNAME).so.$(SONAMEVERSION): $(OBJ)
+-	$(CC) -shared -nostartfiles -Wl,-soname,$@ $^ -o $@
++	$(CC) -shared -nostartfiles -Wl,-soname,$@ $^ -o $@ $(LDFLAGS)
+ 
+ $(LIBNAME).so: $(LIBNAME).so.$(SONAMEVERSION)
+ 	ln -s $< $@
+--- imx-lib-3.10.17-1.0.0_beta.orig/ipu/Makefile
++++ imx-lib-3.10.17-1.0.0_beta/ipu/Makefile
+@@ -1,5 +1,6 @@
+ CC ?=$(CROSS_COMPILE)gcc
+ AR ?=$(CROSS_COMPILE)ar
++CFLAGS ?=-O2
+ 
+ ifeq ($(PLATFORM), IMX6Q)
+ OBJS = mxc_ipu_hl_lib_dummy.o
+@@ -28,7 +29,7 @@ all install:
+ endif
+ 
+ $(LIBNAME).so.$(SONAMEVERSION): $(OBJS)
+-	$(CC) -shared -nostartfiles -Wl,-soname,$@ -o $@ $^
++	$(CC) -shared -nostartfiles -Wl,-soname,$@ -o $@ $^ $(LDFLAGS)
+ 
+ $(LIBNAME).so: $(LIBNAME).so.$(SONAMEVERSION)
+ 	ln -s $< $@
+@@ -37,7 +38,7 @@ $(LIBNAME).so: $(LIBNAME).so.$(SONAMEVER
+ ifeq "$(PLATFORM)" ""
+ 	$(error "Unspecified PLATFORM variable")
+ endif
+-	$(CC) -D$(PLATFORM) $(INCLUDE) -Wall -O2 -fPIC -c $^ -o $@
++	$(CC) -D$(PLATFORM) $(INCLUDE) -Wall -fPIC $(CFLAGS) -c $^ -o $@
+ 
+ .PHONY: clean
+ clean:
+--- imx-lib-3.10.17-1.0.0_beta.orig/pxp/Makefile
++++ imx-lib-3.10.17-1.0.0_beta/pxp/Makefile
+@@ -1,5 +1,6 @@
+ CC ?=$(CROSS_COMPILE)gcc
+ AR ?=$(CROSS_COMPILE)ar
++CFLAGS ?=-O2
+ 
+ # list of platforms which want this test case
+ INCLUDE_LIST:=IMX50 IMX51 IMX5 IMX6Q IMX6S
+@@ -26,10 +27,10 @@ all install :
+ endif
+ 
+ %.o: %.c
+-	$(CC) -D$(PLATFORM) $(INCLUDE) -Wall -O2 -fPIC -c $^ -o $@
++	$(CC) -D$(PLATFORM) $(INCLUDE) -Wall -fPIC $(CFLAGS) -c $^ -o $@
+ 
+ $(LIBNAME).so.$(SONAMEVERSION): $(OBJ)
+-	$(CC) -shared -nostartfiles -Wl,-soname,$@ $(LFLAGS) $^ -o $@
++	$(CC) -shared -nostartfiles -Wl,-soname,$@ $(LFLAGS) $^ -o $@ $(LDFLAGS)
+ 
+ $(LIBNAME).so: $(LIBNAME).so.$(SONAMEVERSION)
+ 	ln -s $< $@
+--- imx-lib-3.10.17-1.0.0_beta.orig/rng/Makefile
++++ imx-lib-3.10.17-1.0.0_beta/rng/Makefile
+@@ -4,16 +4,17 @@ ifeq (,$(findstring $(PLATFORM), $(EXCLU
+ AR = ar -crv
+ RM = rm -f
+ CC ?=$(CROSS_COMPILE)gcc
+-LD=$(CROSS_COMPILE)ld
++LD ?=$(CROSS_COMPILE)ld
++CFLAGS ?=-g
+ 
+ INC := $(INCLUDE)
+ 
+ # Add compilation checks
+-CFLAGS += -g -Wall -W -Wmissing-prototypes -Wstrict-prototypes -Wdeclaration-after-statement -fPIC
++override CFLAGS += -Wall -W -Wmissing-prototypes -Wstrict-prototypes -Wdeclaration-after-statement -fPIC
+ 
+ # In absence of kernel CONFIG flags, set API library to build on
+ # 'unknown' platform.
+-CFLAGS += -DFSL_PLATFORM_OTHER -DFSL_HAVE_RNGC $(INC)
++override CFLAGS += -DFSL_PLATFORM_OTHER -DFSL_HAVE_RNGC $(INC)
+ 
+ OBJS= fsl_shw_rand.o  fsl_shw_hash.o  fsl_shw_sym.o  fsl_shw_user.o         \
+ 		fsl_shw_keystore.o fsl_shw_auth.o  fsl_shw_hmac.o  fsl_shw_wrap.o
+@@ -34,7 +35,7 @@ $(LIBNAME).a: $(OBJS)
+ 	$(AR) $@ $^
+ 
+ $(LIBNAME).so.$(SONAMEVERSION): $(OBJS)
+-	$(CC) -shared -nostartfiles -Wl,-soname,$@ -o $@ $^
++	$(CC) -shared -nostartfiles -Wl,-soname,$@ -o $@ $^ $(LDFLAGS)
+ 
+ $(LIBNAME).so: $(LIBNAME).so.$(SONAMEVERSION)
+ 	ln -s $< $@
+--- imx-lib-3.10.17-1.0.0_beta.orig/sahara2/Makefile
++++ imx-lib-3.10.17-1.0.0_beta/sahara2/Makefile
+@@ -4,7 +4,8 @@ ifeq (,$(findstring $(PLATFORM), $(EXCLU
+ AR = ar -crv
+ RM = rm -f
+ CC ?=$(CROSS_COMPILE)gcc
+-LD=$(CROSS_COMPILE)ld
++LD ?=$(CROSS_COMPILE)ld
++CFLAGS ?=-g
+ 
+ INC := $(INCLUDE)
+ 
+@@ -18,19 +19,19 @@ TARGET_ARCH=-DCONFIG_ARCH_MX5
+ endif
+ 
+ # Add compilation checks
+-CFLAGS += -g -Wall -W -Wmissing-prototypes -Wstrict-prototypes -Wdeclaration-after-statement -fPIC
++override CFLAGS += -Wall -W -Wmissing-prototypes -Wstrict-prototypes -Wdeclaration-after-statement -fPIC
+ 
+ OBJS= fsl_shw_rand.o  fsl_shw_hash.o  fsl_shw_sym.o  fsl_shw_user.o         \
+       fsl_shw_auth.o  fsl_shw_hmac.o  fsl_shw_wrap.o  fsl_shw_keystore.o um_adaptor.o  sf_util.o
+ 
+ 
+ #CFLAGS += -DSAHARA -DLINUX -I$(APIINCDIR)
+-CFLAGS += -DSAHARA -DLINUX $(INC)
+-CFLAGS += $(TARGET_ARCH)
++override CFLAGS += -DSAHARA -DLINUX $(INC)
++override CFLAGS += $(TARGET_ARCH)
+ # Uncomment to debug Library's creation of structures for driver
+-#CFLAGS +=  -DDIAG_SECURITY_FUNC
++#override CFLAGS +=  -DDIAG_SECURITY_FUNC
+ # Uncomment to simulate memory allocation errors
+-#CFLAGS += -DDIAG_MEM_ERRORS -DDIAG_MEM_CONST=5
++#override CFLAGS += -DDIAG_MEM_ERRORS -DDIAG_MEM_CONST=5
+ 
+ LIBNAME=libsahara
+ SONAMEVERSION=0
+@@ -53,7 +54,7 @@ $(LIBNAME).a: $(OBJS)
+ 	$(AR) $@ $^
+ 
+ $(LIBNAME).so.$(SONAMEVERSION): $(OBJS)
+-	$(CC) -shared -nostartfiles -Wl,-soname,$@ -o $@ $^
++	$(CC) -shared -nostartfiles -Wl,-soname,$@ -o $@ $^ $(LDFLAGS)
+ 
+ $(LIBNAME).so: $(LIBNAME).so.$(SONAMEVERSION)
+ 	ln -s $< $@
+--- imx-lib-3.10.17-1.0.0_beta.orig/screenlayer/Makefile
++++ imx-lib-3.10.17-1.0.0_beta/screenlayer/Makefile
+@@ -1,5 +1,6 @@
+ CC ?=$(CROSS_COMPILE)gcc
+ AR ?=$(CROSS_COMPILE)ar
++CFLAGS ?=-O2
+ INC = $(INCLUDE) -I../ipu
+ 
+ OBJS = ScreenLayer.o
+@@ -24,13 +25,13 @@ all install:
+ endif
+ 
+ $(LIBNAME).so.$(SONAMEVERSION): $(OBJS)
+-	$(CC) -shared -nostartfiles -Wl,-soname,$@ -o $@ $^ -L../ipu -lipu
++	$(CC) -shared -nostartfiles -Wl,-soname,$@ -o $@ $^ -L../ipu -lipu $(LDFLAGS)
+ 
+ $(LIBNAME).so: $(LIBNAME).so.$(SONAMEVERSION)
+ 	ln -s $< $@
+ 
+ %.o: %.c
+-	$(CC) $(INC) -Wall -O2 -fPIC -c $^ -o $@
++	$(CC) $(INC) -Wall -fPIC $(CFLAGS) -c $^ -o $@
+ 
+ .PHONY: clean
+ clean:
+--- imx-lib-3.10.17-1.0.0_beta.orig/sim/Makefile
++++ imx-lib-3.10.17-1.0.0_beta/sim/Makefile
+@@ -1,9 +1,10 @@
+ CC ?=$(CROSS_COMPILE)gcc
+ AR ?=$(CROSS_COMPILE)ar
++CFLAGS ?=-O2
+ 
+ OBJS = iso7816-3.o
+ 
+-CFLAGS += $(INCLUDE)
++override CFLAGS += $(INCLUDE)
+ 
+ LIBNAME=libsim
+ SONAMEVERSION=0
+@@ -21,13 +22,13 @@ install:
+ 	cp iso7816-3.h $(DEST_DIR)/usr/include
+ 
+ $(LIBNAME).so.$(SONAMEVERSION): $(OBJS)
+-	$(CC) -shared -nostartfiles -Wl,-soname,$@ -o $@ $^ -lpthread
++	$(CC) -shared -nostartfiles -Wl,-soname,$@ -o $@ $^ -lpthread $(LDFLAGS)
+ 
+ $(LIBNAME).so: $(LIBNAME).so.$(SONAMEVERSION)
+ 	ln -s $< $@
+ 
+ %.o: %.c
+-	$(CC) -D$(PLATFORM) $(INCLUDE) -Wall -O2 -fPIC -c $^ -o $@
++	$(CC) -D$(PLATFORM) $(INCLUDE) -Wall -fPIC $(CFLAGS) -c $^ -o $@
+ 
+ else
+ all install :
diff --git a/recipes-bsp/imx-lib/imx-lib_11.09.02.bb b/recipes-bsp/imx-lib/imx-lib_11.09.02.bb
index 07c6e35..16ca1df 100644
--- a/recipes-bsp/imx-lib/imx-lib_11.09.02.bb
+++ b/recipes-bsp/imx-lib/imx-lib_11.09.02.bb
@@ -1,7 +1,8 @@
 # Copyright (C) 2013 Freescale Semiconductor
 require imx-lib.inc
 
-SRC_URI = "${FSL_MIRROR}/imx-lib-${PV}.tar.gz"
+SRC_URI = "${FSL_MIRROR}/imx-lib-${PV}.tar.gz \
+           file://obey-variables.patch"
 SRC_URI[md5sum] = "a4e7447e35cfac0b966a51f001390d6e"
 SRC_URI[sha256sum] = "3ed082005789db0c9c41e14073417319f4e23f5646a7d21f34840470f4328bd5"
 
diff --git a/recipes-bsp/imx-lib/imx-lib_3.10.17-1.0.0.bb b/recipes-bsp/imx-lib/imx-lib_3.10.17-1.0.0.bb
index 93f5482..212ec3f 100644
--- a/recipes-bsp/imx-lib/imx-lib_3.10.17-1.0.0.bb
+++ b/recipes-bsp/imx-lib/imx-lib_3.10.17-1.0.0.bb
@@ -4,6 +4,7 @@ include imx-lib.inc
 
 PE = "1"
 
+SRC_URI += "file://obey-variables.patch"
 SRC_URI[md5sum] = "8e3346d5f33b5aa5f915a0dd8aa99cc9"
 SRC_URI[sha256sum] = "f42605971977e5fe1ed9e7ce17ea3f97586a23fbc60fa0f679940d379c72303e"
 
diff --git a/recipes-bsp/imx-vpu/imx-vpu-11.09.02/obey-variables.patch b/recipes-bsp/imx-vpu/imx-vpu-11.09.02/obey-variables.patch
new file mode 100644
index 0000000..13f61b2
--- /dev/null
+++ b/recipes-bsp/imx-vpu/imx-vpu-11.09.02/obey-variables.patch
@@ -0,0 +1,27 @@
+Obey CFLAGS, LDFLAGS
+
+Signed-off-by: Christopher Larson <chris_larson at mentor.com>
+Upstream-status: Pending
+
+--- imx-vpu-11.09.02.orig/vpu/Makefile	2014-09-02 13:14:50.862005896 -0700
++++ imx-vpu-11.09.02/vpu/Makefile	2014-09-02 13:15:15.018153222 -0700
+@@ -1,5 +1,6 @@
+ CC ?=$(CROSS_COMPILE)gcc
+ AR ?=$(CROSS_COMPILE)ar
++CFLAGS ?= -O2
+ 
+ # list of platforms which want this test case
+ INCLUDE_LIST:= IMX27ADS IMX51 IMX53 IMX6Q
+@@ -33,10 +34,10 @@
+ endif
+ 
+ %.o: %.c
+-	$(CC) -D$(PLATFORM) -Wall -O2 -fPIC -c $^ -o $@
++	$(CC) -D$(PLATFORM) -Wall -fPIC $(CFLAGS) -c $^ -o $@
+ 
+ $(LIBNAME).so.$(SONAMEVERSION): $(OBJ)
+-	$(CC) -shared -nostartfiles -Wl,-soname,$@ $^ -o $@
++	$(CC) -shared -nostartfiles -Wl,-soname,$@ $^ -o $@ $(LDFLAGS)
+ 
+ $(LIBNAME).so: $(LIBNAME).so.$(SONAMEVERSION)
+ 	ln -s $< $@
diff --git a/recipes-bsp/imx-vpu/imx-vpu-3.10.17-1.0.0/obey-variables.patch b/recipes-bsp/imx-vpu/imx-vpu-3.10.17-1.0.0/obey-variables.patch
new file mode 100644
index 0000000..7071e9e
--- /dev/null
+++ b/recipes-bsp/imx-vpu/imx-vpu-3.10.17-1.0.0/obey-variables.patch
@@ -0,0 +1,27 @@
+Obey CFLAGS, LDFLAGS
+
+Signed-off-by: Christopher Larson <chris_larson at mentor.com>
+Upstream-status: Pending
+
+--- imx-vpu-3.10.17-1.0.0_beta.orig/vpu/Makefile
++++ imx-vpu-3.10.17-1.0.0_beta/vpu/Makefile
+@@ -1,5 +1,6 @@
+ CC ?=$(CROSS_COMPILE)gcc
+ AR ?=$(CROSS_COMPILE)ar
++CFLAGS ?= -O2
+ 
+ # list of platforms which want this test case
+ INCLUDE_LIST:= IMX27ADS IMX51 IMX53 IMX6Q
+@@ -33,10 +34,10 @@ all install :
+ endif
+ 
+ %.o: %.c
+-	$(CC) -D$(PLATFORM) -Wall -O2 -fPIC -c $^ -o $@
++	$(CC) -D$(PLATFORM) -Wall -fPIC $(CFLAGS) -c $^ -o $@
+ 
+ $(LIBNAME).so.$(SONAMEVERSION): $(OBJ)
+-	$(CC) -shared -nostartfiles -Wl,-soname,$@ $^ -o $@ -lpthread
++	$(CC) -shared -nostartfiles -Wl,-soname,$@ $^ -o $@ $(LDFLAGS) -lpthread
+ 
+ $(LIBNAME).so: $(LIBNAME).so.$(SONAMEVERSION)
+ 	ln -s $< $@
diff --git a/recipes-bsp/imx-vpu/imx-vpu_11.09.02.bb b/recipes-bsp/imx-vpu/imx-vpu_11.09.02.bb
index c40c703..c5dd9bd 100644
--- a/recipes-bsp/imx-vpu/imx-vpu_11.09.02.bb
+++ b/recipes-bsp/imx-vpu/imx-vpu_11.09.02.bb
@@ -1,6 +1,7 @@
 # Copyright (C) 2013 Freescale Semiconductor
 require imx-vpu.inc
 
+SRC_URI += "file://obey-variables.patch"
 SRC_URI[md5sum] = "1988a08687a09ef8590e66ff17ac6ed3"
 SRC_URI[sha256sum] = "783f136aa9b9257d4bffbdaf05bdcb85d177c544c3f8a4674421ba7b065ed5c0"
 
diff --git a/recipes-bsp/imx-vpu/imx-vpu_3.10.17-1.0.0.bb b/recipes-bsp/imx-vpu/imx-vpu_3.10.17-1.0.0.bb
index 7ed9590..6ef79e5 100644
--- a/recipes-bsp/imx-vpu/imx-vpu_3.10.17-1.0.0.bb
+++ b/recipes-bsp/imx-vpu/imx-vpu_3.10.17-1.0.0.bb
@@ -4,9 +4,12 @@ require imx-vpu.inc
 
 PE = "1"
 
+SRC_URI += "\
+    file://0001-IOGetVirtMem-returns-1-MAP_FAILED-on-failure.patch \
+    file://obey-variables.patch \
+"
 SRC_URI[md5sum] = "71ea1b803864101ebf88a1bab45514d2"
 SRC_URI[sha256sum] = "cd8a7bd50ff3274db76a331cc6622d3ba4bb7c790ce778f303e49187df2dfd72"
 
-SRC_URI_append = " file://0001-IOGetVirtMem-returns-1-MAP_FAILED-on-failure.patch"
 
 COMPATIBLE_MACHINE = "(mx6)"
-- 
1.8.3.4



More information about the meta-freescale mailing list