From 37be4bda854d921e4db7f4202c3a99f98c1bfb69 Mon Sep 17 00:00:00 2001 From: Lang Daniel Date: Wed, 15 Feb 2023 09:58:51 +0000 Subject: [PATCH] linux: use -isystem instead of -I in HOSTCC A package might install headers that are incompatible with the kernel's header. One example is the most recent version of pahole (1.24). HOST_CC includes -I$(HOST_DIR)/include which comes before any include logic the kernel might have thus forcing the kernel to prefer headers in HOST_DIR. The logic to substituting -I with -isystem is taken from boot/uboot/uboot.mk. Signed-off-by: Daniel Lang Reviewed-by: Francis Laniel Tested-by: Francis Laniel Signed-off-by: Arnout Vandecappelle --- linux/linux.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux/linux.mk b/linux/linux.mk index 7645b5f507..03d89cd204 100644 --- a/linux/linux.mk +++ b/linux/linux.mk @@ -150,7 +150,7 @@ endif # Disable building host tools with -Werror: newer gcc versions can be # extra picky about some code (https://bugs.busybox.net/show_bug.cgi?id=14826) LINUX_MAKE_FLAGS = \ - HOSTCC="$(HOSTCC) $(HOST_CFLAGS) $(HOST_LDFLAGS)" \ + HOSTCC="$(HOSTCC) $(subst -I/,-isystem /,$(subst -I /,-isystem /,$(HOST_CFLAGS))) $(HOST_LDFLAGS)" \ ARCH=$(KERNEL_ARCH) \ INSTALL_MOD_PATH=$(TARGET_DIR) \ CROSS_COMPILE="$(TARGET_CROSS)" \