[uclibc-ng-devel] Building with 2.6.22 kernel headers

Alex Potapenko opotapenko at gmail.com
Thu Apr 7 14:45:15 CEST 2016


I've reported build failure with vanilla 2.6.22 kernel headers some
while ago. I then turned to a custom mipsel kernel that fixed the
issue. However, now I need an ARMv5 2.6.22 toolchain to support some
legacy devices, which leads to the same issue.

The problems happen when libc/inet/if_index.c and libc/inet/ifaddrs.c
are being compiled. There's clearly a conflict between kernel headers
(<linux/uio.h> and <linux/socket.h>) and some uClibc-ng headers
(<bits/uio.h> and <bits/socket.h>): some types (like struct iovec) are
being re-defined. For Optware-ng, I fixed this by making sure that
<bits/uio.h> and <bits/socket.h> are skipped:

These patches allowed me to build uClibc-ng 1.0.13, and produced a
working toolchain (tested some built packages on an ARMv7 router).
However, I haven't tested it on any kernel headers versions other than
2.6.22, so more investigation is needed. There should be a more
elegant way around this, I think, but I'm sharing this in hope that it
can be useful.


More information about the devel mailing list