[uClibc]Mozilla and reentrant functions

Rob McMullen robm at flipturn.org
Sat May 3 16:50:23 UTC 2003


Long time listener, first time caller.  I'm really impressed with
uClibc; so impressed that I'm attempting to replace glibc with uClibc
as the default C library in an entire Gentoo linux install.  (I'll
have a writeup on the progress shortly...)

Anyway, tried compiling Mozilla 1.2.1, and it chugged for ten minutes
or so before failing when linking with libnspr4:

../../../dist/bin/libnspr4.so: undefined reference to `getprotobyname_r'
../../../dist/bin/libnspr4.so: undefined reference to `getprotobynumber_r'

It seems to be a consequence of using the glibc headers, but Mozilla
not actually using configure to test if the functions are there.  It
assumes that if it has the headers, it has the functions.  Relavent
code in Mozilla is mozilla/nsprpub/pr/src/misc/prnetdb.c:

#if (defined(LINUX) && defined(__GLIBC__) && __GLIBC__ >= 2)
#define _PR_HAVE_GETPROTO_R
#define _PR_HAVE_5_ARG_GETPROTO_R
#endif

So, to get Mozilla to work without hacking the Moz source, it looks
like uClibc/libc/inet/getproto.c would have to be modified to be
reentrant (ala resolv.c).

Rob


More information about the uClibc mailing list