patch to fix build issue in uClibc testsuite

Jian Peng jipeng at broadcom.com
Fri Apr 15 01:05:39 UTC 2011


Thank you, Bernhard.

I came across a discussion on similar issue at http://www.mail-archive.com/uclibc@uclibc.org/msg04245.html

I like to understand what is the purpose of $(KERNEL_HEADERS).

In my case, KERNEL_HEADERS was used to point to what my own kernel header files (may be slightly different from installed one for debugging purpose).
Those kernel header files were used to build my own lib*.so based on different .config in uClibc (from that was used to build cross toolchain), and install my customized *.so onto target.

I have to use $(KERNEL_HEAERS) to point to both "linux/include" and "linux/arch/mips/include" since "linux/arch/mips/include" has unistd.h that will be used to generate syscall table in uClibc.

In other words, if KERNEL_HEADERS has to be set to point to installed kernel headers, then there is no need for this option, and there is no need to generate install_dir since you can simply create a symlink to sysroot directory as install_dir.

How do you think?

Jian



From: Bernhard Reutner-Fischer [mailto:rep.dot.nop at gmail.com] 
Sent: Saturday, April 09, 2011 1:43 PM
To: Jian Peng; uclibc at uclibc.org
Subject: Re: patch to fix build issue in uClibc testsuite

Jian Peng <jipeng at broadcom.com> wrote:
In test/Rules.mak, $(KERNEL_HEADERS) will be checked and used to generate $(KERNEL_INCLUDES) based on absolute or relative path. The problem is that this check assumes that $(KERNEL_HEADERS) is single word like /user/me/kernel/include, in case that it is "/user/me/kernel/include -I/user/me/kernel/arch/mips/include", $(KERNEL_INCLUDES) will be wrong and leads to unable to find out kernel header files in build process. Here I reworked the logic to check each path in $(KERNEL_HEADERS) individually, then combine them. Signed-off-by: Jian Peng <jipeng2005 at gmail.com> --- test/Rules.mak | 10 +++------- 1 files changed, 3 insertions(+), 7 deletions(-) diff --git a/test/Rules.mak b/test/Rules.mak index 2131a7b..e144b0f 100644 --- a/test/Rules.mak +++ b/test/Rules.mak @@ -46,14 +46,10 @@ export TARGET_ARCH RM_R = $(Q)$(RM) -r LN_S = $(Q)$(LN) -fs +# handle absolute and relative path on each path in $(KERNEL_HEADERS) separately ifneq ($(KERNEL_HEADERS),) -ifeq ($(patsubst /%,/,$(KERNEL_HEADERS)),/) -# Absolute path in KERNEL_HEADERS -KERNEL_INCLUDES += -I$(KERNEL_HEADERS) -else -# Relative path in KERNEL_HEADERS -KERNEL_INCLUDES += -I$(top_builddir)$(KERNEL_HEADERS) -endif +KERNEL_HEADERS := $(patsubst -I%,%,$(KERNEL_HEADERS)) +KERNEL_INCLUDES += $(addprefix -I,$(foreach i,$(KERNEL_HEADERS),$(patsubst .%,$(top_builddir).%,$i))) endif XCOMMON_CFLAGS := -I$(top_builddir)test -D_GNU_SOURCE -- 1.7.4.1
________________________________________
uClibc mailing list uClibc at uclibc.org http://lists.busybox.net/mailman/listinfo/uclibc 

Hi,

You need to use installed kernel headers.


More information about the uClibc mailing list