You need CC or gcc compiler when you compiling the NSS
We prefer the CC or cc compiler wich comes with solaris studio, you can download solaris studio from oracle site.
Un zip the solaris studio and set path to compiler CC or cc
export PATH=/usr/ccs/bin:/usr/sfw/bin:/opt/SolarisStudio12.3-solaris-sparc-bin/solarisstudio12.3/bin:$PATH
export CFLAGS=-m32
export CXX=CC
export CC=cc
Go to nss folder
cd nss
Compilation command :
gmake nss_build_all
or
gmake BUILD_OPT=1 NSPR_INCLUDE_DIR=/root/nss/ USE_SYSTEM_ZLIB=1 ZLIB_LIBS=-lz nss_build_all
Trouble shoot issues while compilation
Issue 1:
ld.so.1: certutil: fatal: libssl3.so: open failed: No such file or directory
Solution:
reinevm01: # ldd certutil
libssl3.so => /lib/libssl3.so
libsmime3.so => /lib/libsmime3.so
libnss3.so => /lib/libnss3.so
check the symbolic link for the certuitl and add the lib path to LD_LIBRARY_PATH
Issue 2:
checking whether the C compiler works... no
configure: error: in `/home/kanmu03/nss-3.20/nspr':
configure: error: C compiler cannot create executables
Solution:
Add the solaris studio bin folder path in $PATH
Issue 3:
ld: fatal: library -lplc4: not found
ld: fatal: library -lplds4: not found
Solution:
Goto
nss-3.20/dist/SunOS5.10_DBG.OBJ/lib/
bash-3.2# ldd libplc4.so
ldd: libplc4.so: cannot open file: No such file or directory
bash-3.2# ls -ltr
total 112
drwxr-xr-x 3 root root 185 Nov 10 11:53 cpu
lrwxrwxrwx 1 root root 51 Nov 10 12:11 libnspr4.a -> ../../../nspr/SunOS5.10_DBG.OBJ/pr/src/./libnspr4.a
lrwxrwxrwx 1 root root 52 Nov 10 12:11 libnspr4.so -> ../../../nspr/SunOS5.10_DBG.OBJ/pr/src/./libnspr4.so
lrwxrwxrwx 1 root root 51 Nov 10 12:11 libplds4.a -> ../../../nspr/SunOS5.10_DBG.OBJ/lib/ds/./libplds4.a
lrwxrwxrwx 1 root root 52 Nov 10 12:11 libplds4.so -> ../../../nspr/SunOS5.10_DBG.OBJ/lib/ds/./libplds4.so
lrwxrwxrwx 1 root root 56 Nov 10 12:11 libplc4.a -> ../../../nspr/SunOS5.10_DBG.OBJ/lib/libc/src/./libplc4.a
lrwxrwxrwx 1 root root 57 Nov 10 12:11 libplc4.so -> ../../../nspr/SunOS5.10_DBG.OBJ/lib/libc/src/./libplc4.so
All are soft links here and soft links path are incorrect here. please copy the original so files created in below.
cd nss-3.20
bash-3.2# cp nspr/lib/libc/src/libplc4.so dist/SunOS5.10_DBG.OBJ/lib/
bash-3.2# cp nspr/lib/ds/libplds4.so dist/SunOS5.10_DBG.OBJ/lib/
cp nspr/pr/src/libnspr4.so dist/SunOS5.10_DBG.OBJ/lib/
Issue 4:
ld: fatal: Symbol referencing errors. No output written to libnspr4.so
Solution:
Go to nspr folder and Build nspr with
./Configure
Issue 5:
gmake[4]: ../../../config/./nsinstall: Command not found
solution:
If you start compilation with NSPR then this error will through
so don't do first nspr build ,
Do NSS build only from nss folder.
cd nss
gmake BUILD_OPT=1 NSPR_INCLUDE_DIR=/root/nss/ USE_SYSTEM_ZLIB=1 ZLIB_LIBS=-lz nss_build_all