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>
Thu, 18 Mar 2021 09:53:26 +0000 (10:53 +0100)
This resolves issues uncovered by musl updates

Signed-off-by: Felix Fietkau <nbd@nbd.name>
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 9485830d0f4fa93d8dffb1f4b047ad84bc941c85..aa6619e78f2b2a9298d347c850aa48cd29661635 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 ebd88bb352f21574d4a9412de2d5917f54a33634..648c826ccb9278c9c23dfa88f81862c7c808cbb2 100644 (file)
@@ -33,7 +33,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 bac73a300cdc1e6d47eae961b2b3b91af0fa5ab7..fa2cd295ab63b9c271086577a56ecda2f4ceac81 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 \