Commit c97a20fb authored by Sam Ravnborg's avatar Sam Ravnborg

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: default avatarSam Ravnborg <sam@ravnborg.org>
parent df3e98d6
...@@ -330,7 +330,10 @@ DEPMOD = /sbin/depmod ...@@ -330,7 +330,10 @@ DEPMOD = /sbin/depmod
KALLSYMS = scripts/kallsyms KALLSYMS = scripts/kallsyms
PERL = perl PERL = perl
CHECK = sparse CHECK = sparse
NOSTDINC_FLAGS := -nostdinc -isystem $(shell $(CC) -print-file-name=include)
CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__
CHECKFLAGS += $(NOSTDINC_FLAGS)
MODFLAGS = -DMODULE MODFLAGS = -DMODULE
CFLAGS_MODULE = $(MODFLAGS) CFLAGS_MODULE = $(MODFLAGS)
AFLAGS_MODULE = $(MODFLAGS) AFLAGS_MODULE = $(MODFLAGS)
...@@ -338,7 +341,6 @@ LDFLAGS_MODULE = -r ...@@ -338,7 +341,6 @@ LDFLAGS_MODULE = -r
CFLAGS_KERNEL = CFLAGS_KERNEL =
AFLAGS_KERNEL = AFLAGS_KERNEL =
NOSTDINC_FLAGS = -nostdinc -iwithprefix include
# Use LINUXINCLUDE when you must reference the include/ directory. # Use LINUXINCLUDE when you must reference the include/ directory.
# Needed to be compatible with the O= option # Needed to be compatible with the O= option
......
...@@ -83,7 +83,6 @@ __build: $(if $(KBUILD_BUILTIN),$(builtin-target) $(lib-target) $(extra-y)) \ ...@@ -83,7 +83,6 @@ __build: $(if $(KBUILD_BUILTIN),$(builtin-target) $(lib-target) $(extra-y)) \
# Linus' kernel sanity checking tool # Linus' kernel sanity checking tool
ifneq ($(KBUILD_CHECKSRC),0) ifneq ($(KBUILD_CHECKSRC),0)
CHECKFLAGS += -I$(shell $(CC) -print-file-name=include)
ifeq ($(KBUILD_CHECKSRC),2) ifeq ($(KBUILD_CHECKSRC),2)
quiet_cmd_force_checksrc = CHECK $< quiet_cmd_force_checksrc = CHECK $<
cmd_force_checksrc = $(CHECK) $(CHECKFLAGS) $(c_flags) $< ; cmd_force_checksrc = $(CHECK) $(CHECKFLAGS) $(c_flags) $< ;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment