Commit cb4f38e1 authored by Sam Ravnborg's avatar Sam Ravnborg

kbuild: Use LINUXINCLUDE to specify include/ directory

Peter Chubb <peterc@gelato.unsw.edu.au> reported that building i386
on a non-i386 platform failed, because gcc could not locate boot.h.
Root cause was the extra include2 directory used when using O=
to specify the output directory.
Added LINUXINCLUDE as a portable way to specify the include/
directory, and changed the two users.
This avoids hardcoding 'include2' in non-kbuild core files.
Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
parent 64fc2d35
...@@ -294,9 +294,13 @@ AFLAGS_KERNEL = ...@@ -294,9 +294,13 @@ AFLAGS_KERNEL =
NOSTDINC_FLAGS = -nostdinc -iwithprefix include NOSTDINC_FLAGS = -nostdinc -iwithprefix include
CPPFLAGS := -D__KERNEL__ -Iinclude \ # Use LINUXINCLUDE when you must reference the include/ directory.
# Needed to be compatible with the O= option
LINUXINCLUDE := -Iinclude \
$(if $(KBUILD_SRC),-Iinclude2 -I$(srctree)/include) $(if $(KBUILD_SRC),-Iinclude2 -I$(srctree)/include)
CPPFLAGS := -D__KERNEL__ $(LINUXINCLUDE)
CFLAGS := -Wall -Wstrict-prototypes -Wno-trigraphs \ CFLAGS := -Wall -Wstrict-prototypes -Wno-trigraphs \
-fno-strict-aliasing -fno-common -fno-strict-aliasing -fno-common
AFLAGS := -D__ASSEMBLY__ AFLAGS := -D__ASSEMBLY__
...@@ -306,7 +310,7 @@ export VERSION PATCHLEVEL SUBLEVEL EXTRAVERSION KERNELRELEASE ARCH \ ...@@ -306,7 +310,7 @@ export VERSION PATCHLEVEL SUBLEVEL EXTRAVERSION KERNELRELEASE ARCH \
CPP AR NM STRIP OBJCOPY OBJDUMP MAKE AWK GENKSYMS PERL UTS_MACHINE \ CPP AR NM STRIP OBJCOPY OBJDUMP MAKE AWK GENKSYMS PERL UTS_MACHINE \
HOSTCXX HOSTCXXFLAGS LDFLAGS_BLOB LDFLAGS_MODULE CHECK HOSTCXX HOSTCXXFLAGS LDFLAGS_BLOB LDFLAGS_MODULE CHECK
export CPPFLAGS NOSTDINC_FLAGS OBJCOPYFLAGS LDFLAGS export CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS LDFLAGS
export CFLAGS CFLAGS_KERNEL CFLAGS_MODULE export CFLAGS CFLAGS_KERNEL CFLAGS_MODULE
export AFLAGS AFLAGS_KERNEL AFLAGS_MODULE export AFLAGS AFLAGS_KERNEL AFLAGS_MODULE
......
...@@ -31,7 +31,7 @@ subdir- := compressed ...@@ -31,7 +31,7 @@ subdir- := compressed
host-progs := tools/build host-progs := tools/build
HOSTCFLAGS_build.o := -Iinclude HOSTCFLAGS_build.o := $(LINUXINCLUDE)
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
......
...@@ -25,7 +25,7 @@ CROSS32_COMPILE ?= ...@@ -25,7 +25,7 @@ CROSS32_COMPILE ?=
BOOTCC := $(CROSS32_COMPILE)gcc BOOTCC := $(CROSS32_COMPILE)gcc
HOSTCC := gcc HOSTCC := gcc
BOOTCFLAGS := $(HOSTCFLAGS) -Iinclude -fno-builtin BOOTCFLAGS := $(HOSTCFLAGS) $(LINUXINCLUDE) -fno-builtin
BOOTAS := $(CROSS32_COMPILE)as BOOTAS := $(CROSS32_COMPILE)as
BOOTAFLAGS := -D__ASSEMBLY__ $(BOOTCFLAGS) -traditional BOOTAFLAGS := -D__ASSEMBLY__ $(BOOTCFLAGS) -traditional
BOOTLD := $(CROSS32_COMPILE)ld BOOTLD := $(CROSS32_COMPILE)ld
......
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