Subject: Mozilla info [was Re: mozilla maintainer wanted]
To: None <>
From: Brad Spencer <>
List: tech-pkg
Date: 04/25/2000 21:20:30
My experiences building Mozilla M15 under NetBSD/i386/a.out has been less
then fruitful.  Sorry for the lack of patches and the length of this post.

First problem I had:

'gtk-config --libs' returns a string that will not be directly usable by
'ld'.  After you run 'configure' in the top level mozilla tree, edit
config/ and change the TK_LIBS line to:

TK_LIBS		= -L/usr/X11R6/lib -R/usr/X11R6/lib -lgtk -lgdk -L/usr/pkg/lib -R/usr/pkg/lib -lgmodule -lglib -lintl -lXext -lX11 -lm

Second problem I had:

Various Mozilla shared libraries get linked with a static libintl.a.  This
will result in 'RSS relocation ...' sorts of messages from the linker as
it is creating these libraries.  Every time this has ever happened to me
before, the resulting shared libraries wouldn't work.  To fix this, build
and install pkgsrc/devel/gettext.  Then run the following script in

#!/bin/sh -x

cc -c -fPIC -DLOCALEDIR=\"/usr/pkg/share/locale\" -DGNULOCALEDIR=\"/usr/pkg/share/locale\" -DLOCALE_ALIAS_PATH=\"/usr/pkg/share/locale:.\" -DHAVE_CONFIG_H -I.. -I. -I../intl -I../lib  -O2  intl-compat.c
cc -c -fPIC -DLOCALEDIR=\"/usr/pkg/share/locale\" -DGNULOCALEDIR=\"/usr/pkg/share/locale\" -DLOCALE_ALIAS_PATH=\"/usr/pkg/share/locale:.\" -DHAVE_CONFIG_H -I.. -I. -I../intl -I../lib  -O2  bindtextdom.c
cc -c -fPIC -DLOCALEDIR=\"/usr/pkg/share/locale\" -DGNULOCALEDIR=\"/usr/pkg/share/locale\" -DLOCALE_ALIAS_PATH=\"/usr/pkg/share/locale:.\" -DHAVE_CONFIG_H -I.. -I. -I../intl -I../lib  -O2  dcgettext.c
cc -c -fPIC -DLOCALEDIR=\"/usr/pkg/share/locale\" -DGNULOCALEDIR=\"/usr/pkg/share/locale\" -DLOCALE_ALIAS_PATH=\"/usr/pkg/share/locale:.\" -DHAVE_CONFIG_H -I.. -I. -I../intl -I../lib  -O2  dgettext.c
cc -c -fPIC -DLOCALEDIR=\"/usr/pkg/share/locale\" -DGNULOCALEDIR=\"/usr/pkg/share/locale\" -DLOCALE_ALIAS_PATH=\"/usr/pkg/share/locale:.\" -DHAVE_CONFIG_H -I.. -I. -I../intl -I../lib  -O2  gettext.c
cc -c -fPIC -DLOCALEDIR=\"/usr/pkg/share/locale\" -DGNULOCALEDIR=\"/usr/pkg/share/locale\" -DLOCALE_ALIAS_PATH=\"/usr/pkg/share/locale:.\" -DHAVE_CONFIG_H -I.. -I. -I../intl -I../lib  -O2  finddomain.c
cc -c -fPIC -DLOCALEDIR=\"/usr/pkg/share/locale\" -DGNULOCALEDIR=\"/usr/pkg/share/locale\" -DLOCALE_ALIAS_PATH=\"/usr/pkg/share/locale:.\" -DHAVE_CONFIG_H -I.. -I. -I../intl -I../lib  -O2  loadmsgcat.c
cc -c -fPIC -DLOCALEDIR=\"/usr/pkg/share/locale\" -DGNULOCALEDIR=\"/usr/pkg/share/locale\" -DLOCALE_ALIAS_PATH=\"/usr/pkg/share/locale:.\" -DHAVE_CONFIG_H -I.. -I. -I../intl -I../lib  -O2  localealias.c
cc -c -fPIC -DLOCALEDIR=\"/usr/pkg/share/locale\" -DGNULOCALEDIR=\"/usr/pkg/share/locale\" -DLOCALE_ALIAS_PATH=\"/usr/pkg/share/locale:.\" -DHAVE_CONFIG_H -I.. -I. -I../intl -I../lib  -O2  textdomain.c
cc -c -fPIC -DLOCALEDIR=\"/usr/pkg/share/locale\" -DGNULOCALEDIR=\"/usr/pkg/share/locale\" -DLOCALE_ALIAS_PATH=\"/usr/pkg/share/locale:.\" -DHAVE_CONFIG_H -I.. -I. -I../intl -I../lib  -O2  l10nflist.c
cc -c -fPIC -DLOCALEDIR=\"/usr/pkg/share/locale\" -DGNULOCALEDIR=\"/usr/pkg/share/locale\" -DLOCALE_ALIAS_PATH=\"/usr/pkg/share/locale:.\" -DHAVE_CONFIG_H -I.. -I. -I../intl -I../lib  -O2  explodename.c
ld -shared -o bindtextdom.o dcgettext.o dgettext.o explodename.o finddomain.o gettext.o intl-compat.o l10nflist.o loadmsgcat.o localealias.o textdomain.o

Install the resulting into /usr/pkg/lib and run
'ldconfig' if needed.

Third problem I had:

The resulting browser will drop core.  Here is the stack trace from gdb
with a standard 'configure':

#0  0x406a637d in strlen ()
#1  0x408b25d0 in ?? ()
   from /lhome2/brad/mozilla/mozilla/dist/bin/components/
#2  0x40748d79 in ?? ()
   from /lhome2/brad/mozilla/mozilla/dist/bin/components/
#3  0x4076f93b in ?? ()
   from /lhome2/brad/mozilla/mozilla/dist/bin/components/
#4  0x40773284 in ?? ()
   from /lhome2/brad/mozilla/mozilla/dist/bin/components/
#5  0x407747a9 in ?? ()
   from /lhome2/brad/mozilla/mozilla/dist/bin/components/
#6  0x400fce9b in js_ValueToString (cx=0x1d400, v=0) at jsstr.c:2286
#7  0x400a773c in js_ReportUncaughtException (cx=0x1d400) at jsexn.c:645
#8  0x400801d9 in JS_ExecuteScript (cx=0x1d400, obj=0x929e8, script=0xc0b00, 
    rval=0xefbfcec8) at jsapi.c:2661
#9  0x4087cebc in ?? ()
   from /lhome2/brad/mozilla/mozilla/dist/bin/components/
#10 0x4087c561 in ?? ()
   from /lhome2/brad/mozilla/mozilla/dist/bin/components/
#11 0x4087c025 in ?? ()
   from /lhome2/brad/mozilla/mozilla/dist/bin/components/
#12 0x4087bd28 in ?? ()
   from /lhome2/brad/mozilla/mozilla/dist/bin/components/
#13 0x4087b5c9 in ?? ()
   from /lhome2/brad/mozilla/mozilla/dist/bin/components/
#14 0x4087b346 in ?? ()
   from /lhome2/brad/mozilla/mozilla/dist/bin/components/
#15 0x401731de in AutoRegister_enumerate (key=0x70b00, aData=0x110700, 
    aClosure=0xefbfd278) at nsComponentManager.cpp:1907
#16 0x401211ca in _hashEnumerate (he=0xb4340, i=0, arg=0xefbfd1b4)
    at nsHashtable.cpp:89
#17 0x4023e1b5 in PL_HashTableEnumerateEntries (ht=0x1cf60, 
    f=0x40121194 <_hashEnumerate(PLHashEntry *, int, void *)>, arg=0xefbfd1b4)
    at plhash.c:368
#18 0x401216dc in nsHashtable::Enumerate (this=0x1cf40, 
    aEnumFunc=0x40173154 <AutoRegister_enumerate(nsHashKey *, void *, void *)>, closure=0xefbfd278) at nsHashtable.cpp:218
#19 0x40173a7b in nsComponentManagerImpl::AutoRegister (this=0x21100, when=0, 
    inDirSpec=0x0) at nsComponentManager.cpp:1994
#20 0x40182c91 in nsComponentManager::AutoRegister (when=0, directory=0x0)
    at nsRepository.cpp:200
#21 0x4082bf75 in ?? ()
   from /lhome2/brad/mozilla/mozilla/dist/bin/components/
#22 0x3ddd in main1 (argc=1, argv=0xefbfd608, splashScreen=0x0)
    at nsAppRunner.cpp:655
#23 0x50ce in main (argc=1, argv=0xefbfd608) at nsAppRunner.cpp:968

I have no idea why there are '??' in various places.  If you build the
browser with 'configure --enable-optimize --disable-debug' you get the

#0  0x40053f6e in JS_NewStringCopyZ ()
#1  0x404783b9 in ?? ()
   from /lhome2/brad/mozilla/mozilla/dist/bin/components/
#2  0x40487e19 in ?? ()
   from /lhome2/brad/mozilla/mozilla/dist/bin/components/
#3  0x404889b7 in ?? ()
   from /lhome2/brad/mozilla/mozilla/dist/bin/components/
#4  0x40489519 in ?? ()
   from /lhome2/brad/mozilla/mozilla/dist/bin/components/
#5  0x400945da in js_ValueToString ()
#6  0x40068ec7 in js_ReportUncaughtException ()
#7  0x40053b2e in JS_ExecuteScript ()
#8  0x405bfdbf in ?? ()
   from /lhome2/brad/mozilla/mozilla/dist/bin/components/
#9  0x405bf788 in ?? ()
   from /lhome2/brad/mozilla/mozilla/dist/bin/components/
#10 0x405bf38c in ?? ()
   from /lhome2/brad/mozilla/mozilla/dist/bin/components/
#11 0x405bf195 in ?? ()
   from /lhome2/brad/mozilla/mozilla/dist/bin/components/
#12 0x405bedd9 in ?? ()
   from /lhome2/brad/mozilla/mozilla/dist/bin/components/
#13 0x405becaa in ?? ()
   from /lhome2/brad/mozilla/mozilla/dist/bin/components/
#14 0x400dc0a3 in AutoRegister_enumerate ()
#15 0x400afb9b in _hashEnumerate ()
#16 0x40157a72 in PL_HashTableEnumerateEntries ()
#17 0x400aff4c in nsHashtable::Enumerate ()
#18 0x400dc5af in nsComponentManagerImpl::AutoRegister ()
#19 0x400e1f29 in nsComponentManager::AutoRegister ()
#20 0x4058b525 in ?? ()
   from /lhome2/brad/mozilla/mozilla/dist/bin/components/
#21 0x3101 in main1 ()
#22 0x3c41 in main ()

The function 'JS_NewStringCopyZ' does appear to contain a strlen and if
you go back to the original build and run the browser in gdb you can set a
break point and catch it in the act, as it were.  The strlen function is
passed a pointer 0x80004005 which is invalid.

I have not had time to unwind things further to see where this value comes
from.  I don't know if an ELF build would work better, nor have I tried a
different compiler.

Brad Spencer -
[finger for PGP public key]