kbuild: find stdarg.h in a new way
stdarg.h is a compiler specific file.
Following patch is more explicit about how to find this file. In this way we also share the definition with sparse.
Sam
kbuild: Use -isystem gcc --print-file-name=include
Using "-nostdinc -isystem `gcc --print-file-name=include" let
us see full path to compiler specific files when compiling with make V=1 Furthermore it lets us use same definition for sparse (CHECKFLAGS) and the kernel. Tested with gcc 3.3.4 only.
Signed-off-by Sam Ravnborg <[email protected]>
Makefile +3 -1
@@ -330,7 +330,10 @@ KALLSYMS = scripts/kallsyms PERL = perl CHECK = sparse + +NOSTDINC_FLAGS := -nostdinc -isystem $(shell $(CC) -print-file-name=include) CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ +CHECKFLAGS += $(NOSTDINC_FLAGS) MODFLAGS = -DMODULE CFLAGS_MODULE = $(MODFLAGS) AFLAGS_MODULE = $(MODFLAGS)
@@ -338,7 +341,6 @@ CFLAGS_KERNEL = AFLAGS_KERNEL = -NOSTDINC_FLAGS = -nostdinc -iwithprefix include # Use LINUXINCLUDE when you must reference the include/ directory. # Needed to be compatible with the O= option
scripts/Makefile.build +0 -1
@@ -83,7 +83,6 @@ # Linus' kernel sanity checking tool ifneq ($(KBUILD_CHECKSRC),0) - CHECKFLAGS += -I$(shell $(CC) -print-file-name=include) ifeq ($(KBUILD_CHECKSRC),2) quiet_cmd_force_checksrc = CHECK $< cmd_force_checksrc = $(CHECK) $(CHECKFLAGS) $(c_flags) $< ;