glibc on sh4, redeclaration of ntohl
Dimi Shahbaz
dshahbaz@ixiacom.com
Mon May 13 18:58:00 GMT 2002
Hi,
I'm trying to build glibc for sh4. After installing the kernel headers
to the right place and building binutils and gcc for the target, I try
to build glibc. All seems to be building fine, until:
In file included from ../include/netinet/in.h:1,
from ../resolv/resolv.h:64,
from ../include/resolv.h:11,
from ../linuxthreads/internals.h:23,
from thread_dbP.h:8,
from td_init.c:21:
../inet/netinet/in.h:259: parse error before '(' token
../inet/netinet/in.h:259: parse error before "__u32"
../inet/netinet/in.h:260: parse error before '(' token
../inet/netinet/in.h:260: parse error before "__u16"
../inet/netinet/in.h:262: parse error before '(' token
../inet/netinet/in.h:262: parse error before "__u32"
../inet/netinet/in.h:264: parse error before '(' token
../inet/netinet/in.h:264: parse error before "__u16"
In file included from ../include/netinet/in.h:1,
from ../resolv/resolv.h:64,
from ../include/resolv.h:11,
from ../linuxthreads/internals.h:23,
from thread_dbP.h:8,
from td_init.c:21:
../inet/netinet/in.h:285:1: warning: "ntohl" redefined
/home2/dimator/opt/sh4/sh-linux/include/linux/byteorder/generic.h:169:1:
warning: this is the location of the previous definition
../inet/netinet/in.h:286:1: warning: "ntohs" redefined
/home2/dimator/opt/sh4/sh-linux/include/linux/byteorder/generic.h:175:1:
warning: this is the location of the previous definition
../inet/netinet/in.h:287:1: warning: "htonl" redefined
/home2/dimator/opt/sh4/sh-linux/include/linux/byteorder/generic.h:168:1:
warning: this is the location of the previous definition
../inet/netinet/in.h:288:1: warning: "htons" redefined
/home2/dimator/opt/sh4/sh-linux/include/linux/byteorder/generic.h:174:1:
warning: this is the location of the previous definition
My hack was to comment out the offending lines from
glibc-2.2.5/inet/netinet/in.h. This gets the build to finish, but it's
pretty crude.
Another approach might be to #undef the 4 functions just before the
redefining lines in netinet/in.h. This would allow the kernel to have
it's own versions of the functions, and userspace programs who include
netinet/in.h to have their own as well.
Has anyone else ran into this problem?
Thanks
Dimi
------
Want more information? See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com
More information about the crossgcc
mailing list