Re: NSPR build

Wan-Teh Chang <[email protected]> Thu, 28 May 2009 09:49:14 -0700
Newsgroups gmane.comp.mozilla.devel.nspr
Message-ID <[email protected]>
On Thu, May 28, 2009 at 9:16 AM, VinuT <[email protected]> wrote:
> Yes, I do use GNU make. (make -v shows that), although i cannot find the
> gmake command.
>
> I tried building NSPR 4.7.4 with the suggestions you provided and the build
> seems to go fine, except it fails at final linking stage
> and gives the error.
>
> Undefined                       first referenced
> symbol                             in file
> __eprintf                           misc/./prerrortable.o
> ld: fatal: Symbol referencing errors. No output written to libnspr4.so
> collect2: ld returned 1 exit status
> make[2]: *** [libnspr4.so] Error 1
> make[2]: Leaving directory
> `/space/xxs/tmp/nspr-4.6.4/mozilla/nsprpub/pr/src'
> make[1]: *** [export] Error 2

I think you're very close now.  Unfortunately I don't have
the setup to reproduce this linker error and fix it for you.

The __eprintf symbol is most likely defined in gcc's
runtime library (libgcc.so or libgcc.a).

You can try redoing everything from scratch.  One
way to do that is:

cd mozilla/nsprpub
make distclean

And then redo:

CC=gcc CXX=g++ ./configure
make

> I read on the internet that eprintf is a symbol referenced by the gcc Assert
> macro and doing -DNDEBUG as a build option will make the error go away.
> However I do not know how to pass this option to make.
> Can anybody help me?

You can try passing --disable-debug --enable-optimize to ./configure.
But that will also remove the debugger symbols, so you will need
to resort to printf statements, which should be OK in this case.

Wan-Teh