Runtime errors linking against NSS

15 views
Skip to first unread message

Benjamin Smedberg

unread,
Jul 21, 2006, 9:48:07 PM7/21/06
to
I have been trying to use GCC trunk to build Firefox trunk sources and the
build works fine. What I am having problems with is when I try to run
Firefox, I get the following errors:

./firefox-bin: /usr/lib64/libnss3.so: version `NSS_3.11.1' not found
(required by ./libxul.so)
./firefox-bin: /usr/lib64/libnss3.so: version `NSS_3.10' not found (required
by ./libxul.so)

I completely don't understand this, because the run-mozilla.sh script is
working correctly and setting LD_LIBRARY_PATH to the Firefox installation
properly. Why would the dynamic linker skip the libnss3.so in dist/bin and
use the one in /usr/lib64 instead?

What additional debugging tools can I use to inspect the "version" of NSS etc?

FC5: x86_64

--BDS

Nelson B

unread,
Jul 22, 2006, 3:14:54 AM7/22/06
to

Hey Benjamin,

Here are some thoughts/questions.
I think the most likely explanation is a build issue when building the
dependent .so (libxul.so) or one of its dependencies.

1. Is this a Linux issue? If not, what platform, what release?

2. are the libs in dist/bin possibly 32-bit libs, and rld is looking for 64?
or vice versa?

3. Did the link step which linked libxul.so perhaps link it with the version
of libnss3.so that is in /usr/lib64, rather than the one in dist/bin?
(e.g. wrong LD_LIBRARY_PATH when libxul.so was linked, or libxul.so linked
before libnss3.so was built?)

4. Does the ldd (or strings) command on libxul.so show the pathname
/usr/lib64/libnss3.so ?

If so, on some OSes, rld will try to load the file from the original file
path name, before looking in LD_LIBRARY_PATH.

--
Nelson B

Message has been deleted

Benjamin Smedberg

unread,
Jul 22, 2006, 2:15:34 PM7/22/06
to
Nelson B wrote:
> Benjamin Smedberg wrote:
>> I have been trying to use GCC trunk to build Firefox trunk sources and the
>> build works fine. What I am having problems with is when I try to run
>> Firefox, I get the following errors:
>>
>> ./firefox-bin: /usr/lib64/libnss3.so: version `NSS_3.11.1' not found
>> (required by ./libxul.so)
>> ./firefox-bin: /usr/lib64/libnss3.so: version `NSS_3.10' not found (required
>> by ./libxul.so)
>>
>> I completely don't understand this, because the run-mozilla.sh script is
>> working correctly and setting LD_LIBRARY_PATH to the Firefox installation
>> properly. Why would the dynamic linker skip the libnss3.so in dist/bin and
>> use the one in /usr/lib64 instead?
>>
>> What additional debugging tools can I use to inspect the "version" of NSS etc?
>>
>> FC5: x86_64
>
> Hey Benjamin,
>
> Here are some thoughts/questions.
> I think the most likely explanation is a build issue when building the
> dependent .so (libxul.so) or one of its dependencies.

This seems likely: I've pasted the link command below, and we're linking
libsmime3.so before libnss3.so. There's an extraneous -rpath /usr/lib64 on
that commandline that shouldn't be there. Let me check the configure results
and see where that came from :-(

> 1. Is this a Linux issue? If not, what platform, what release?

Yes, FC5 x86_64 as I said ;-)

/builds/gcc-trunk/installed/bin/g++-trunk -I/usr/X11R6/include -fno-rtti
-fno-exceptions -Wall -Wconversion -Wpointer-arith -Wcast-align
-Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor
-Wno-long-long -pedantic -fshort-wchar -pthread -pipe -DNDEBUG -DTRIMMED -O
-fPIC -shared -Wl,-z,defs -Wl,-h,libxul.so -o libxul.so
nsStaticXULComponents.o nsRDFResource.o nsUnicharUtils.o
nsCompressedCharMap.o -lpthread -Wl,--whole-archive
../../toolkit/xre/libxulapp_s.a
../../embedding/browser/gtk/src/libgtkembedmoz.a
../../dist/lib/components/libxpconnect.a
../../dist/lib/components/libnecko.a ../../dist/lib/components/libuconv.a
../../dist/lib/components/libi18n.a ../../dist/lib/components/libjar50.a
../../dist/lib/components/libpref.a ../../dist/lib/components/libcaps.a
../../dist/lib/components/librdf.a ../../dist/lib/components/libhtmlpars.a
../../dist/lib/components/libimglib2.a
../../dist/lib/components/libgklayout.a
../../dist/lib/components/libxmlextras.a
../../dist/lib/components/libdocshell.a
../../dist/lib/components/libembedcomponents.a
../../dist/lib/components/libwebbrwsr.a
../../dist/lib/components/libeditor.a
../../dist/lib/components/libnsappshell.a
../../dist/lib/components/libtxmgr.a ../../dist/lib/components/libchrome.a
../../dist/lib/components/libwindowds.a
../../dist/lib/components/libintlapp.a
../../dist/lib/components/libcommandlines.a
../../dist/lib/components/libtoolkitcomps.a
../../dist/lib/components/libpipboot.a ../../dist/lib/components/libpipnss.a
../../dist/lib/components/libgkplugin.a
../../dist/lib/components/libmozfind.a
../../dist/lib/components/libappcomps.a
../../dist/lib/components/libxpinstall.a ../../dist/lib/components/libjsd.a
../../dist/lib/components/libautoconfig.a
../../dist/lib/components/libwebsrvcs.a ../../dist/lib/components/libauth.a
../../dist/lib/components/libcookie.a
../../dist/lib/components/libpermissions.a
../../dist/lib/components/libuniversalchardet.a
../../dist/lib/components/libcomposer.a
../../dist/lib/components/libfileview.a
../../dist/lib/components/libstoragecomps.a
../../dist/lib/components/libplaces.a
../../dist/lib/components/libtkautocomplete.a
../../dist/lib/components/libsatchel.a ../../dist/lib/components/libpippki.a
../../dist/lib/components/libucvmath.a
../../dist/lib/components/libwidget_gtk2.a
../../dist/lib/components/libsystem-pref.a
../../dist/lib/components/libgfxps.a
../../dist/lib/components/libgkgfxthebes.a
../../dist/lib/components/liboji.a
../../dist/lib/components/libaccessibility.a
../../dist/lib/components/libremoteservice.a
../../dist/lib/components/libspellchecker.a ../../dist/lib/libxpcom_core.a
../../dist/lib/libmozreg_s.a ../../dist/lib/libucvutil_s.a
../../dist/lib/libgkgfx.a ../../dist/lib/libgfxshared_s.a
../../dist/lib/libmorkreader_s.a ../../dist/lib/libgtkxtbin.a
../../dist/lib/libgfxpsshar.a ../../dist/lib/libthebes.a
../../dist/lib/libjsj.a -Wl,--no-whole-archive
-Wl,-rpath-link,../../dist/bin -L../../dist/bin -L../../dist/lib
-L../../dist/lib -lmozjpeg -L../../dist/lib -lmozpng -L../../dist/bin
-lmozjs -L../../dist/bin -L../../dist/lib -lcrmf -lsmime3 -lssl3 -lnss3
-lsoftokn3 -L../../dist/lib -lmozz -lpangoft2-1.0 -lpangoxft-1.0
-lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0 -L../../dist/lib
-lmozcairo -lmozlibpixman -L/usr/X11R6/lib64 -lXrender -lfreetype
-lfontconfig -L../../dist/lib -lplds4 -lplc4 -lnspr4 -lpthread -ldl
-L/usr/X11R6/lib64 -lX11 -L/usr/X11R6/lib64 -lXft -lX11 -lfreetype
-lXrender -lfontconfig -lgtk-x11-2.0 -latk-1.0 -lgdk-x11-2.0
-lgdk_pixbuf-2.0 -lm -lpangoxft-1.0 -lpangox-1.0 -lpango-1.0 -lgmodule-2.0
-ldl -lgobject-2.0 -lglib-2.0 -lXt -L/usr/lib64 -Wl,--rpath -Wl,/usr/lib64
-lfreetype -lz -ldl -lm

Nelson B

unread,
Jul 22, 2006, 4:33:03 PM7/22/06
to
Benjamin Smedberg wrote:
> Nelson B wrote:

>> 1. Is this a Linux issue? If not, what platform, what release?
>
> Yes, FC5 x86_64 as I said ;-)

FC5 didn't mean anything to me (Fedora would have) and x86_64 defines
a CPU arch, not an OS. There are other OSes that use it. (e.g. Solaris).

/Nelson

Reply all
Reply to author
Forward
0 new messages