lantiq: ltq-vdsl: Do not leak user space CFLAGS into kernel space
authorHauke Mehrtens <hauke@hauke-m.de>
Fri, 2 Mar 2018 23:25:06 +0000 (00:25 +0100)
committerHauke Mehrtens <hauke@hauke-m.de>
Sat, 3 Mar 2018 11:58:55 +0000 (12:58 +0100)
Do not leak the user space CFLAGS into the kernel space any more, this
allows us to activate the MIPS16 build.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
package/kernel/lantiq/ltq-vdsl/Makefile
package/kernel/lantiq/ltq-vdsl/patches/020-not-leak-cflags.patch [new file with mode: 0644]

index 3b085ed8a7dd3854a9d3546ac2e29f1cb18f01bd..d518bd647da4f053aeeeaab664e7cbe019d63f9e 100644 (file)
@@ -9,7 +9,7 @@ include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=ltq-vdsl-vr9
 PKG_VERSION:=4.17.18.6
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_BASE_NAME:=drv_dsl_cpe_api
 PKG_SOURCE:=$(PKG_BASE_NAME)_vrx-$(PKG_VERSION).tar.gz
@@ -19,8 +19,7 @@ PKG_HASH:=b4966a60653acc49254b168c6cc9c49eb36c54548e763617788aa4f252a29f21
 PKG_LICENSE:=GPL-2.0 BSD-2-Clause
 PKG_LICENSE_FILES:=LICENSE
 
-
-PKG_USE_MIPS16:=0
+PKG_FIXUP:=autoreconf
 
 PKG_MAINTAINER:=John Crispin <john@phrozen.org>
 
@@ -42,8 +41,6 @@ define Package/ltq-vdsl-vr9/description
                - VRX200 Family
 endef
 
-EXTRA_CFLAGS = -fno-pic -mno-abicalls -mlong-calls -G 0
-
 MAKE_FLAGS += \
        SHELL="$(BASH)"
 
diff --git a/package/kernel/lantiq/ltq-vdsl/patches/020-not-leak-cflags.patch b/package/kernel/lantiq/ltq-vdsl/patches/020-not-leak-cflags.patch
new file mode 100644 (file)
index 0000000..96e69ac
--- /dev/null
@@ -0,0 +1,32 @@
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -244,10 +244,7 @@ else
+ drv_dsl_cpe_api_common_mod_cflags =
+ endif
+-drv_dsl_cpe_api_common_cflags = -DLINUX -D__LINUX__ -D__KERNEL__ -DEXPORT_SYMTAB \
+-    -pipe -Wall -Wformat -Wimplicit -Wunused -Wswitch -Wcomment -Winline \
+-    -Wuninitialized -Wparentheses -Wsign-compare -Wreturn-type \
+-    -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common
++drv_dsl_cpe_api_common_cflags = -DLINUX -D__LINUX__ -D__KERNEL__ -DEXPORT_SYMTAB
+ if DSL_DBG_MAX_LEVEL_SET
+ drv_dsl_cpe_api_common_cflags += -DDSL_DBG_MAX_LEVEL=$(DSL_DBG_MAX_LEVEL_PRE)
+@@ -257,7 +254,7 @@ endif
+ drv_dsl_cpe_api_target_cflags = $(ADD_DRV_CFLAGS)
+ # compile cflags
+-drv_dsl_cpe_api_compile_cflags = $(EXTRA_DRV_CFLAGS)
++drv_dsl_cpe_api_compile_cflags =
+ if !KERNEL_2_6
+ # the headerfile of linux kernels 2.6.x contain to much arithmetic
+@@ -311,7 +308,7 @@ drv_dsl_cpe_api.ko: $(drv_dsl_cpe_api_SO
+       @echo -e "# drv_dsl_cpe_api: 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_dsl_cpe_api_OBJS)"        >> $(PWD)/Kbuild
+-      @echo -e "EXTRA_CFLAGS := $(CFLAGS) -DHAVE_CONFIG_H $(drv_dsl_cpe_api_CFLAGS) $(DSL_DRIVER_INCL_PATH) $(IFXOS_INCLUDE_PATH) -I@abs_srcdir@/include -I$(PWD)/include"    >> $(PWD)/Kbuild
++      @echo -e "EXTRA_CFLAGS := -DHAVE_CONFIG_H $(drv_dsl_cpe_api_CFLAGS) $(DSL_DRIVER_INCL_PATH) $(IFXOS_INCLUDE_PATH) -I@abs_srcdir@/include -I$(PWD)/include"      >> $(PWD)/Kbuild
+       $(MAKE) ARCH=@KERNEL_ARCH@ -C @KERNEL_BUILD_PATH@ O=@KERNEL_BUILD_PATH@ M=$(PWD) modules
+ clean-generic: