I just downloaded the sources for NSPR 4.7.4 for a Solaris build.
I unzipped and untarred the file and then
cd mozilla/nsprpub
./configure
Here it tries to use the Sun C compiler, but I want to use gcc, So i did
./configure NS_USE_GCC=1
Now i get "checking host system type... Invalid configuration
`NS_USE_GCC=1': machine `NS_USE_GCC=1' not recognized"
but configure starts to use gcc as the default compiler. I cannot understand
how configure figured this out.
Anyways configure continues and makes all the make file.
Then i do
make NS_USE_GCC=1
Now it get the error
make[3]: Entering directory
`/space/xxs/tmp/nspr-4.7.4/mozilla/nsprpub/pr/include/md'
../../../config/./nsinstall -R -m 444 ./_aix32.cfg ./_aix64.cfg ./_beos.cfg
./_bsdi.cfg ./_darwin.cfg ./_dgux.cfg ./_freebsd.cfg ./_hpux32.cfg
./_hpux64.cfg ./_irix32.cfg ./_irix64.cfg ./_linux.cfg ./_ncr.cfg ./_nec.cfg
./_netbsd.cfg ./_nextstep.cfg ./_nto.cfg ./_openbsd.cfg ./_openvms.cfg
./_os2.cfg ./_osf1.cfg ./_qnx.cfg ./_reliantunix.cfg ./_riscos.cfg
./_scoos.cfg ./_solaris.cfg ./_sony.cfg ./_sunos4.cfg ./_symbian.cfg
./_unixware.cfg ./_unixware7.cfg ./_win16.cfg ./_win95.cfg ./_winnt.cfg
../../../dist/include/nspr/md
../../../config/./nsinstall -R -m 444 ./ ../../../dist/include/nspr
../../../config/./nsinstall: cannot make symbolic link
/space/xxs/tmp/nspr-4.7.4/mozilla/nsprpub/dist/include/nspr/.: Invalid
argument
Has anyone who built NSPR successfully on Solaris 8 for Sparc throw light on
this!!!!
Thanks
Vinu
Please configure NSPR as follows to use gcc:
In Bourne shell, Korn shell, or Bash:
CC=gcc CXX=g++ ./configure
In C shell or tcsh:
env CC=gcc CXX=g++ ./configure
Then just type 'gmake'. If you use 'make', please first run 'make -v' to
verify that it is GNU make. Our makefiles require GNU make.
Wan-Teh
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 tried doing a grep for the symbol _eprint in the NSPR directories but
couldnt find it anywhere. So whats wrong here?
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?
Thanks
Vinu
"Wan-Teh Chang" <w...@google.com> wrote in message
news:mailman.251.124346856...@lists.mozilla.org...
Use the --disable-debug option when you run configure.
$ ../nsprpub/configure --disable-debug
- Jon
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
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" <w...@google.com> wrote in message
news:mailman.341.124352936...@lists.mozilla.org...
The linker being used is /usr/ccs/bin/ld which is the Sun linker.
How can i make it use the gcc linker?
"Vinu" <vinu....@pass-consulting.com> wrote in message
news:76OdnaKmXJmUaL7X...@mozilla.org...
The only idea I have is to switch to the Sun Studio compiler.
I'm sorry that I can't help you further because I don't have
access to a Solaris computer. I am very good at fixing build
issues, but in this case I don't have the setup (access to a
Solaris computer with GCC) to do that.
I already did web searches for the linker error message and
I believe I found the same info you found.
Wan-Teh
You can manually change the value of LD for Solaris in
mozilla/nsprpub/configure:
http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/nsprpub/configure&rev=1.256&mark=4770-4771#4767
But you can see that we use the C compiler $(CC) instead of
the linker $(LD) to build shared libraries (the MKSHLIB command).
So I expect that manually changing the value of LD in
mozilla/nsprpub/configure will have no effect.
gcc is hardcoded to use a certain linker. You can find that out
with this command:
gcc -print-prog-name=ld
If it returns just "ld", then you can adjust your PATH environment
variable so that the desired "ld" is used. If it returns a full pathname
such as /usr/ccs/bin/ld, then your gcc was built to use that particular
ld.
Wan-Teh
What version of Solaris and gcc do you use ?
I was able to build NSPR with gcc just fine using the instructions
provided by Wan-Teh.
I am using Solaris 10 x64, with gcc 3.4.3 from /usr/sfw/bin .
I am using Solaris OS 8 i.e SunOS 5.8
And gcc is 3.4.6(I got the binary package from www.sunfreeware.com for Sparc
systems).
I installed gcc using pkgadd.
I am using Solaris 32 bit kernel and not the 64 bit sparcv9 kernel.
Also there is no /usr/sfw directory on my system.
Thanks
Vinu
"Julien R Pierre - Sun Microsystems" <nospam.julien...@sun.com>
wrote in message news:4A26F9A2...@sun.com...
Yes, /usr/sfw/bin was added in Solaris 10 .
Solaris 8 is quite old - it was released in February 2000. While the EOL
date is March 2012, I would strongly recommend you use something newer,
if you have the option.
I suspect there is a problem with the gcc package on www.sunfreeware.com
. These are not officially supported bits.
prerrortable.c doesn't even make any printf calls. nm on prerrortable.o
in my build doesn't show any symbol like the __eprintf that you are
missing. I don't know why the compiler would add this dependency in your
build.
Still, you may want to search all the .a's that come with your gcc
installation, and see if you find one that contains the __eprintf symbol.
FYI, I did a google search on __eprintf and found this :
http://newsgroups.derkeiler.com/Archive/Comp/comp.sys.mac.programmer.help/2007-03/msg00172.html
Apparently, this symbol is used by assert.h , and is supposed to be in
libgcc.a . See if that matches with your system. Is it possible you are
linking against the wrong libgcc.a ?
You may also try to build optimized (set BUILD_OPT=1) and see if that
builds.
If you can't figure out the problem, I would strongly urge you to switch
to an officially supported compiler. The Studio 12 compiler works on
Solaris 8 Sparc 32 bits. We do our official builds of NSPR/NSS with this
compiler on Solaris 8 for SPARC.