build: use -nostdinc and -isystem in NOSTDINC_FLAGS for out-of-tree kernel modules
authorFelix Fietkau <nbd@nbd.name>
Thu, 18 Mar 2021 06:22:11 +0000 (07:22 +0100)
committerFelix Fietkau <nbd@nbd.name>
Sun, 4 Apr 2021 09:39:51 +0000 (11:39 +0200)
This resolves issues uncovered by musl updates

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry-picked from commit 9ac47ee46918c45b91f4e4d1fa76b1e26b9d57fe)

include/kernel.mk
package/kernel/ath10k-ct/Makefile
package/kernel/mt76/Makefile
package/kernel/mwlwifi/Makefile
package/kernel/rtl8812au-ct/Makefile

index d2a5b421384b862c8964e23e0fd748c7e2d75ce2..e4074a48f4b27b3522b95b239af0817b5bacfec9 100644 (file)
@@ -118,6 +118,9 @@ KERNEL_MAKE_FLAGS = \
        cmd_syscalls= \
        $(if $(__package_mk),KBUILD_EXTRA_SYMBOLS="$(wildcard $(PKG_SYMVERS_DIR)/*.symvers)")
 
+KERNEL_NOSTDINC_FLAGS = \
+       -nostdinc $(if $(DUMP),, -isystem $(shell $(TARGET_CC) -print-file-name=include))
+
 ifeq ($(call qstrip,$(CONFIG_EXTERNAL_KERNEL_TREE))$(call qstrip,$(CONFIG_KERNEL_GIT_CLONE_URI)),)
   KERNEL_MAKE_FLAGS += \
        KERNELRELEASE=$(LINUX_VERSION)
index 32b294a69fdf5858d41f033b6b211815421482d6..a225bd8b191fce713c342bbe7b674283d3f6ee75 100644 (file)
@@ -52,7 +52,8 @@ $(call KernelPackage/ath10k-ct)
   VARIANT:=smallbuffers
 endef
 
-NOSTDINC_FLAGS = \
+NOSTDINC_FLAGS := \
+       $(KERNEL_NOSTDINC_FLAGS) \
        -I$(PKG_BUILD_DIR) \
        -I$(STAGING_DIR)/usr/include/mac80211-backport/uapi \
        -I$(STAGING_DIR)/usr/include/mac80211-backport \
index 810ee4c3d43314b8bcc3a4f9f4ce43ed28c08150..45375ef564e187c72f6f8b8472ea779837554b61 100644 (file)
@@ -235,7 +235,8 @@ endef
 
 TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include/libnl-tiny
 
-NOSTDINC_FLAGS = \
+NOSTDINC_FLAGS := \
+       $(KERNEL_NOSTDINC_FLAGS) \
        -I$(PKG_BUILD_DIR) \
        -I$(STAGING_DIR)/usr/include/mac80211-backport/uapi \
        -I$(STAGING_DIR)/usr/include/mac80211-backport \
index 749fbbe90fd8ef35c2eff7885518224d29dcc9ec..eb986dca03c2d20c696b9cb476325189a235c7c5 100644 (file)
@@ -34,7 +34,8 @@ define KernelPackage/mwlwifi
   AUTOLOAD:=$(call AutoLoad,50,mwlwifi)
 endef
 
-NOSTDINC_FLAGS = \
+NOSTDINC_FLAGS := \
+       $(KERNEL_NOSTDINC_FLAGS) \
        -I$(PKG_BUILD_DIR) \
        -I$(STAGING_DIR)/usr/include/mac80211-backport/uapi \
        -I$(STAGING_DIR)/usr/include/mac80211-backport \
index aac754de7f10604f74d9b86b2b6b1058845c2189..4dab3fd23265d24aa7e8eab679ef6ae67da96006 100644 (file)
@@ -31,7 +31,8 @@ define KernelPackage/rtl8812au-ct
   PROVIDES:=kmod-rtl8812au
 endef
 
-NOSTDINC_FLAGS = \
+NOSTDINC_FLAGS := \
+       $(KERNEL_NOSTDINC_FLAGS) \
        -I$(PKG_BUILD_DIR) \
        -I$(PKG_BUILD_DIR)/include \
        -I$(STAGING_DIR)/usr/include/mac80211-backport \