netbase (ping6) and kernel bitops
I was trying to build netbase, but it fails on ARM like so:
gcc -O2 -Wall -g -Iinclude-glibc -include include-glibc/glibc-bugs.h -I/usr/include -I../include ping6.c -lresolv -o ping6
/tmp/ccJIc0C0.o: In function `main':
/root/egcs/netbase/netbase-3.16/iputils/ping6.c:577: undefined reference to `clear_bit'
/root/egcs/netbase/netbase-3.16/iputils/ping6.c:577: relocation truncated to fit: R_ARM_PC24 clear_bit
/root/egcs/netbase/netbase-3.16/iputils/ping6.c:578: undefined reference to `clear_bit'
/root/egcs/netbase/netbase-3.16/iputils/ping6.c:578: relocation truncated to fit: R_ARM_PC24 clear_bit
/root/egcs/netbase/netbase-3.16/iputils/ping6.c:579: undefined reference to `clear_bit'
/root/egcs/netbase/netbase-3.16/iputils/ping6.c:579: relocation truncated to fit: R_ARM_PC24 clear_bit
/root/egcs/netbase/netbase-3.16/iputils/ping6.c:580: undefined reference to `clear_bit'
/root/egcs/netbase/netbase-3.16/iputils/ping6.c:580: relocation truncated to fit: R_ARM_PC24 clear_bit
/root/egcs/netbase/netbase-3.16/iputils/ping6.c:582: undefined reference to `clear_bit'
/root/egcs/netbase/netbase-3.16/iputils/ping6.c:582: relocation truncated to fit: R_ARM_PC24 clear_bit
collect2: ld returned 1 exit status
make: *** [ping6] Error 1
make: Leaving directory `/disk-3/egcs/netbase/netbase-3.16/iputils'
make: *** [build-stamp] Error 1
Ignoring the ugly error messages, it seems that ping6.c is trying to
use the clear_bit() bit operation from the kernel sources. On the
other architectures, this seems to be defined as an inline in the
kernel sources. In the Linux ARM kernel, the bitops functions aren't
inlined for some reason.
More to the point - isn't it horribly non-portable to be using
internal kernel headers/functions to be doing this user-space task?
Isn't there a better way of doing it?