[uClibc] Problems while including header files in uclinux
Rob Landley
rob at landley.net
Tue Feb 22 18:36:14 UTC 2005
On Tuesday 22 February 2005 11:52 am, Neo Jia wrote:
> Rob,
>
> Thank you for your email. But it seems the problem is the definition
> of the following macros.
No, it isn't?
> The include directory is
> "C:/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.uClibc
>_0.1.0/include/".
The file lives on drive C:? You can build uclibc under DOS?
> In the file <linux/byteorder/little_endian.h>,
A kernel header file, not provided by uclibc...
> I got the "undefined
> error message" for the symbol "__le64", but it was defined in
> <linux/types.h>. But unfortunately, only if we do not define
> "__KERNEL_STRICT_NAMES", "__le64" will be defined as expected. And the
> "__KERNEL_STRICT_NAMES" is defined in <features.h>,
It's also defined in glibc's features.h:
/* Suppress kernel-name space pollution unless user expressedly asks
for it. */
#ifndef _LOOSE_KERNEL_NAMES
# define __KERNEL_STRICT_NAMES
#endif
knoppix at ttyp2[include]$ find . -type f | xargs grep "_LOOSE_KERNEL_NAMES"
./features.h:#ifndef _LOOSE_KERNEL_NAMES
knoppix at ttyp2[include]$
> since the
> "_LOOSE_KERNEL_NAMES" is not defined.
That's from the glibc headers.
> Could you help me on this problem?
Your problem isn't __KERNEL_STRICT_NAMES, your problem can be found by backing
up to your first email:
> Currently, I am working on uclinux based on uclibc. When my source
> code includes <asm\byteorder.h>, which includes the file
> <linux/byteorder/little_endian.h>, it prompts me some undefined
> errors.
I grapped mazur's version 2.6.9.1 linux/byteorder/little_endian.h for __le64,
and this was what I got:
./linux/byteorder/little_endian.h:#define __le64_to_cpu(x) ((__u64)(x))
./linux/byteorder/little_endian.h:#define __le64_to_cpup(x) (*(__u64*)(x))
./linux/byteorder/little_endian.h:#define __le64_to_cpus(x) do {} while (0)
__u64 is defined in your architecture's asm file, in my case:
./asm-i386/types.h:typedef unsigned long long __u64;
So the problem, once again, is that you're not using properly cleaned up
kernel header files. The mazur versions don't _need_ __le64 in
linux/bytehorder/little_endian.h.
> Thanks,
> Neo
Rob
More information about the uClibc
mailing list