kbuild: find stdarg.h in a new way
From: Sam Ravnborg
Date: Tue Dec 28 2004 - 18:27:12 EST
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 <sam@xxxxxxxxxxxx>
diff -Nru a/Makefile b/Makefile
--- a/Makefile 2004-12-29 00:21:09 +01:00
+++ b/Makefile 2004-12-29 00:21:09 +01:00
@@ -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
diff -Nru a/scripts/Makefile.build b/scripts/Makefile.build
--- a/scripts/Makefile.build 2004-12-29 00:21:09 +01:00
+++ b/scripts/Makefile.build 2004-12-29 00:21:09 +01:00
@@ -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) $< ;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/