Re: NSPR build

"VinuT" <[email protected]> Mon, 1 Jun 2009 12:02:19 -0400
Newsgroups gmane.comp.mozilla.devel.nspr
Message-ID <[email protected]>
Althougg i mention
CC=gcc CXX=g++ ./configure
and it seems to build with gcc,

The linker being used is /usr/ccs/bin/ld which is the Sun linker.

How can i make it use the gcc linker?

"Vinu" <[email protected]> wrote in message 
news:[email protected]...
>I can do a optimized build now with
> ./configure --disable-debug.
>
> However I still get Undefined symbol __eprintf with a debug build.
> even though i did a cleanup and redid everything from scratch.
>
> Do i need to get a newer version of the gcc? Is there any other way to 
> solve this undefined symbol error?
>
> Thanks
> Vinu
>
> "Wan-Teh Chang" <[email protected]> wrote in message 
> news:[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