uClibc 0.9.33.2 fils to build with Linux 3.10

Emmanuel Deloget emmanuel.deloget at efixo.com
Tue Jul 2 14:23:18 UTC 2013


Hi everybody,

As you probably know, Linux 3.10 was released this weekend so I decided to
give it a try.

I built a few script a while ago to create cross-compilation toolchains so
I used these script (they don't work perfectly but they appear to be able
to build a somewhat correct toolchain) to rebuild my toolchain with
uClibc 0.9.33.2 with the kernel headers of Linux 3.10. This failed with
this error :

...
...
  CC libc/inet/if_index.os
In file included from /home/me/.build/armeb-uclinux/linux-dev/usr/include/linux/kernel.h:4:0,
                 from /home/me/.build/armeb-uclinux/linux-dev/usr/include/linux/netlink.h:4,
                 from /home/me/.build/armeb-uclinux/linux-dev/usr/include/linux/rtnetlink.h:5,
                 from libc/inet/netlinkaccess.h:27,
                 from libc/inet/if_index.c:37:
/home/me/.build/armeb-uclinux/linux-dev/usr/include/linux/sysinfo.h:8:2: error: unknown type name '__kernel_long_t'
/home/me/.build/armeb-uclinux/linux-dev/usr/include/linux/sysinfo.h:9:2: error: unknown type name '__kernel_ulong_t'
/home/me/.build/armeb-uclinux/linux-dev/usr/include/linux/sysinfo.h:10:2: error: unknown type name '__kernel_ulong_t'
/home/me/.build/armeb-uclinux/linux-dev/usr/include/linux/sysinfo.h:11:2: error: unknown type name '__kernel_ulong_t'
/home/me/.build/armeb-uclinux/linux-dev/usr/include/linux/sysinfo.h:12:2: error: unknown type name '__kernel_ulong_t'
/home/me/.build/armeb-uclinux/linux-dev/usr/include/linux/sysinfo.h:13:2: error: unknown type name '__kernel_ulong_t'
/home/me/.build/armeb-uclinux/linux-dev/usr/include/linux/sysinfo.h:14:2: error: unknown type name '__kernel_ulong_t'
/home/me/.build/armeb-uclinux/linux-dev/usr/include/linux/sysinfo.h:15:2: error: unknown type name '__kernel_ulong_t'
/home/me/.build/armeb-uclinux/linux-dev/usr/include/linux/sysinfo.h:18:2: error: unknown type name '__kernel_ulong_t'
/home/me/.build/armeb-uclinux/linux-dev/usr/include/linux/sysinfo.h:19:2: error: unknown type name '__kernel_ulong_t'
/home/me/.build/armeb-uclinux/linux-dev/usr/include/linux/sysinfo.h:21:22: error: '__kernel_ulong_t' undeclared here (not in a function)


The problem is tied to a recent Linux commit [1] which introduces a
dependency to linux/kernel.h (and thus linux/sysinfo.h) into
linux/netlink.h.

It turns out that sysinfo.h needs to have __kernel_ulong_t and
__kernel_long_t which are defined in the kernel header
asm/posix_types.h, which is superseeded by (in my case)
arm/bits/kernel_types.h. The problem is comming right now : this
file does not define __kernel_ulong_t and __kernel_long_t.

To resolve the issue on my target ARM platform, I used the following
patch :

Index: a/libc/sysdeps/linux/arm/bits/kernel_types.h
===================================================================
--- a/libc/sysdeps/linux/arm/bits/kernel_types.h
+++ b/libc/sysdeps/linux/arm/bits/kernel_types.h
@@ -32,6 +32,8 @@
 typedef unsigned short        __kernel_old_gid_t;
 typedef long long        __kernel_loff_t;
 typedef __kernel_dev_t        __kernel_old_dev_t;
+typedef long            __kernel_long_t;
+typedef unsigned long        __kernel_ulong_t;
 
 typedef struct {
 #ifdef __USE_ALL


This patch is obviously not complete, as every target architecture
has be be changed (and I'm not even sure the typedefs are correct;
I suspect they are). Unfortunately, my knowledge of the different
targets is minimal and I'm not in a position where I can submit a
fully correct patch. Anyway, I hope the analysis and the patch
above will help you in your quest to fix this new issue.

[1] https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit?id=ccdfcc398594ddf3f77348c5a10938dbe9efefbe

If you need further information, do not hesitate to contact me.

Best regards,

-- Emmanuel Deloget



More information about the uClibc mailing list