Skip to contentSkip to conversation

kbuild: find stdarg.h in a new way

PATCH Sam Ravnborg 1 participant 1 message Dec 28, 2004 Kbuild

lore
Share & tools
lore
#0 lore raw

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.

Makefile +3 -1
diff -Nru a/Makefile b/Makefile
@@ -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
diff -Nru a/scripts/Makefile.build b/scripts/Makefile.build
@@ -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) $< ;