[uClibc]Mozilla and reentrant functions

Erik Andersen andersen at codepoet.org
Sat May 3 23:35:45 UTC 2003


On Sat May 03, 2003 at 12:50:23PM -0400, Rob McMullen wrote:
> 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...)

Sweet!

> 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'

As noted in docs/threads.txt, these are desired, but required for
compliance with SuSv3, and have therefore not yet been
implemented.  Unfortunately, these are still exposed in our
header files, which is clearly a bug.

> 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).

So it would seem.  Patches are welcome.

BTW, I am busy moving so I will have limited new access this
coming week, so don't freak out if it takes several days for
me to respond.

 -Erik

--
Erik B. Andersen             http://codepoet-consulting.com/
--This message was written using 73% post-consumer electrons--


More information about the uClibc mailing list