[klibc] [PATCH] add linux' arch/$ARCH/include to search path From: Marc Kleine-Budde <mkl at pengutronix.de> Date: Mon, 5 Jan 2009 17:46:47 +0100

Jon Ringle jon at ringle.org
Tue Sep 15 13:08:31 PDT 2009


with the recent move of the includes from linux'
include/asm-$ARCH to arch/$ARCH/asm, klibc fails to compile,
because the in-linux-header files include from asm/, but this
is not in the header search path.

e.g. against linux-2.6.27 arm:

  arm-iwmmx-linux-gnueabi-gcc -Wp,-MD,usr/klibc/.vsnprintf.o.d   -nostdinc -iwithprefix include -Iusr/include/arch/arm -Iusr/include/bits32 -Iusr/klibc/../include -Iusr/include -Ilinux/include   -D__KLIBC__=1 -D__KLIBC_MINOR__=5 -D_BITSIZE=32  -fno-stack-protector -fno-exceptions -mabi=aapcs-linux -mno-thumb-interwork   -Os -march=armv4 -mtune=strongarm -W -Wall -Wno-sign-compare -Wno-unused-parameter   -c -o usr/klibc/vsnprintf.o usr/klibc/vsnprintf.c
In file included from usr/klibc/../include/sys/types.h:15,
                 from usr/klibc/../include/unistd.h:11,
                 from usr/klibc/../include/stdio.h:11,
                 from usr/klibc/vsnprintf.c:13:
linux/include/linux/posix_types.h:47:29: error: asm/posix_types.h: No such file or directory
In file included from usr/klibc/../include/unistd.h:11,
                 from usr/klibc/../include/stdio.h:11,
                 from usr/klibc/vsnprintf.c:13:
usr/klibc/../include/sys/types.h:16:23: error: asm/types.h: No such file or directory
In file included from usr/klibc/../include/unistd.h:11,
                 from usr/klibc/../include/stdio.h:11,
                 from usr/klibc/vsnprintf.c:13:

This patch fixes the problem by adding a -I to linux' arch/$ARCH/asm
to the CPPFLAGS. This will fail on x86 (64 and 32 bit) though, because
in linux x86 is unified, while in klibc it's seperate.

Signed-off-by: Marc Kleine-Budde <mkl at pengutronix.de>
Signed-off-by: Jon Ringle <jon at ringle.org>
---
 scripts/Kbuild.klibc |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/scripts/Kbuild.klibc b/scripts/Kbuild.klibc
index 227b9bd..8d80f2c 100644
--- a/scripts/Kbuild.klibc
+++ b/scripts/Kbuild.klibc
@@ -104,6 +104,7 @@ KLIBCCPPFLAGS    := -nostdinc -iwithprefix include \
 # kernel include paths
 KLIBCKERNELSRC	 ?= $(srctree)/
 KLIBCCPPFLAGS    += -I$(KLIBCKERNELSRC)include		\
+                    -I$(KLIBCKERNELSRC)/arch/$(KLIBCARCHDIR)/include \
                      $(if $(KBUILD_SRC),-I$(KLIBCKERNELOBJ)include2 -I$(KLIBCKERNELOBJ)include -I$(srctree)/include)    \
 		     $(KLIBCARCHINCFLAGS)
 
-- 
1.6.4.rc3.12.gdf73a



More information about the klibc mailing list