[uClibc]header files

Brendan J Simon brendan.simon at ctam.com.au
Wed Jul 10 01:09:26 UTC 2002


I have a project where I was using a linux 2.4 kernel and glibc-2.2.5. 
 My compile line had -I<glibc-include-dir> -I<linux-include-dir>.  I am 
now trying to use uClibc to replace glibc.  Using similar compiler flags 
I now get redefined values.  This is because a header file is included 
from the linux include directory AND the uclibc include directory.  eg. 
 The output is:

        CC : build/drivers/hw_test/test.o
/home/aegis/uclibc/branch.0/branch.9/branch.12/branch.0/baseline/myproduct/devel/bin/gcc  
-msoft-float -O2 -Wall -Werror    -DCONFIG_KERNELD -DMODULE -D__KERNEL__ 
-DLINUX -Isrc/include 
-I/home/aegis/linux/branch.2/branch.4/branch.0/branch.0/baseline/src/include 
-nostdinc -nostdinc++ -Isrc/include 
-I/home/aegis/linux/branch.2/branch.4/branch.0/branch.0/baseline/src/include 
-I/home/aegis/uclibc/branch.0/branch.9/branch.12/branch.0/baseline/myproduct/devel/include 
-I/usr/lib/gcc-lib/powerpc-linux/2.95.4/include   -c -o 
build/drivers/hw_test/test.o src/drivers/hw_test/test.c
In file included from 
/home/aegis/uclibc/branch.0/branch.9/branch.12/branch.0/baseline/myproduct/devel/include/stdio.h:65,
                 from src/include/ctam/misc.h:21,
                 from src/drivers/hw_test/test.c:27:
/home/aegis/uclibc/branch.0/branch.9/branch.12/branch.0/baseline/myproduct/devel/include/sys/types.h:207: 
warning: `__BIT_TYPES_DEFINED__' redefined
/home/aegis/linux/branch.2/branch.4/branch.0/branch.0/baseline/src/include/linux/types.h:95: 
warning: this is the location of the previous definition


I am using the tools created by uClibc.  Is it possible to use the 
standard system tools at all ?  ie. using -nostdinc -nostdinc++ and 
pointing to the appropriate header files etc ???

Should I be using the -nostdinc -nostdinc++ flags with the uclibc tools ?

I noticed that the build of uclibc seems to _copy_ all the linux header 
files to the delelopment directory.  Is this correct ?  If so, should I 
still be pointing the compiler to the linux include directory ?  If we 
have two or more versions of a kernel, does that mean I have to compile 
uclibc two or more times and have two or more development directories 
for each kerenl ???

Thanks for any advice,
Brendan Simon.





More information about the uClibc mailing list