[openwrt/openwrt] lantiq: ltq-vdsl-mei: Do not leak user space CFLAGS into kernel space

LEDE Commits lede-commits at lists.infradead.org
Sat Mar 3 04:00:44 PST 2018


hauke pushed a commit to openwrt/openwrt.git, branch master:
https://git.lede-project.org/13639e76dd2431d3688c4dda352b4f1fe24cb7ff

commit 13639e76dd2431d3688c4dda352b4f1fe24cb7ff
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Sat Mar 3 00:23:55 2018 +0100

    lantiq: ltq-vdsl-mei: Do not leak user space CFLAGS into kernel space
    
    Do not leak the user space CFLAGS into the kernel space any more, this
    allows us to activate the MIPS16 build.
    
    This decreases the size of the ipk file from 87589 bytes to 81267 bytes.
    
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/kernel/lantiq/ltq-vdsl-mei/Makefile         |  5 ++---
 .../ltq-vdsl-mei/patches/020-not-leak-cflags.patch  | 21 +++++++++++++++++++++
 2 files changed, 23 insertions(+), 3 deletions(-)

diff --git a/package/kernel/lantiq/ltq-vdsl-mei/Makefile b/package/kernel/lantiq/ltq-vdsl-mei/Makefile
index 96bbc98..aeb0281 100644
--- a/package/kernel/lantiq/ltq-vdsl-mei/Makefile
+++ b/package/kernel/lantiq/ltq-vdsl-mei/Makefile
@@ -9,7 +9,7 @@ include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=ltq-vdsl-vr9-mei
 PKG_VERSION:=1.5.17.6
-PKG_RELEASE:=3
+PKG_RELEASE:=4
 
 PKG_BASE_NAME:=drv_mei_cpe
 PKG_SOURCE:=$(PKG_BASE_NAME)-$(PKG_VERSION).tar.gz
@@ -19,7 +19,6 @@ PKG_HASH:=94f6904364348b7f74087e721968abc28b2564fb9bd8899aa930d36490387662
 PKG_FIXUP:=autoreconf
 PKG_FLAGS:=nonshared
 PKG_MAINTAINER:=John Crispin <john at phrozen.org>
-PKG_USE_MIPS16:=0
 PKG_LICENSE:=GPL-2.0 BSD-2-Clause
 PKG_LICENSE_FILES:=LICENSE
 
@@ -65,7 +64,7 @@ CONFIGURE_ARGS += \
 	--enable-error_print \
 	--enable-ifxos-include="-I$(STAGING_DIR)/usr/include/ifxos/" \
 	--enable-ifxos-library="-L$(STAGING_DIR)/usr/lib" \
-	--enable-add_drv_cflags="-DMEI_DRV_ATM_PTM_INTERFACE_ENABLE=1 -fno-pic -mlong-calls -O2 -g0" \
+	--enable-add_drv_cflags="-DMEI_DRV_ATM_PTM_INTERFACE_ENABLE=1" \
 	--enable-linux-26 \
 	--enable-kernelbuild="$(LINUX_DIR)" \
 	--enable-drv_test_appl=yes \
diff --git a/package/kernel/lantiq/ltq-vdsl-mei/patches/020-not-leak-cflags.patch b/package/kernel/lantiq/ltq-vdsl-mei/patches/020-not-leak-cflags.patch
new file mode 100644
index 0000000..31dbba3
--- /dev/null
+++ b/package/kernel/lantiq/ltq-vdsl-mei/patches/020-not-leak-cflags.patch
@@ -0,0 +1,21 @@
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -213,8 +213,7 @@ drv_mei_cpe_common_cflags = $(AM_CFLAGS)
+ else
+ 
+ drv_mei_cpe_common_cflags = \
+-	$(AM_CFLAGS) -D__KERNEL__ -DLINUX -D__linux__ -DMODULE -DEXPORT_SYMTAB \
+-	-pipe -Wimplicit -Wunused -Wuninitialized -Wsign-compare -Wstrict-aliasing
++	-D__KERNEL__ -DLINUX -D__linux__ -DMODULE -DEXPORT_SYMTAB
+ 
+ endif
+ 
+@@ -354,7 +353,7 @@ drv_mei_cpe.ko: $(drv_mei_cpe_SOURCES)
+ 	@echo -e "# drv_mei_cpe: Generated to build Linux 2.6.x kernel object" > $(PWD)/Kbuild
+ 	@echo -e "obj-m := $(subst .ko,.o,$@)"			>> $(PWD)/Kbuild
+ 	@echo -e "$(subst .ko,,$@)-y := $(drv_mei_cpe_OBJS)"	>> $(PWD)/Kbuild
+-	@echo -e "EXTRA_CFLAGS := $(CFLAGS) $(drv_mei_cpe_CFLAGS) -I at abs_srcdir@ -I at abs_srcdir@/auto_header $(IFXOS_INCLUDE_PATH)" >> $(PWD)/Kbuild
++	@echo -e "EXTRA_CFLAGS := $(drv_mei_cpe_CFLAGS) -I at abs_srcdir@ -I at abs_srcdir@/auto_header $(IFXOS_INCLUDE_PATH)" >> $(PWD)/Kbuild
+ 	$(MAKE) ARCH=@KERNEL_ARCH@ -C @KERNEL_BUILD_PATH@ O=@KERNEL_BUILD_PATH@ M=$(PWD) modules
+ 
+ clean-generic:



More information about the lede-commits mailing list