Link Errors with Firefox 3

2 views
Skip to first unread message

John Cebasek

unread,
Aug 8, 2008, 4:44:44 PM8/8/08
to Mozilla Embedding
Hi All:

We have a plugin and associated dylibs on Mac OS X that works with
Firefox 2, which now must be brought up Firefox 3. I've got the code
compiling, but I'm having a weird link error. Well, it's not that
weird, it's not finding a bunch of symbols. But where did they go?

The (beginning) of the errors are as follows:

__ZNK9nsAString12BeginReadingEv
__ZN9nsAString17DefaultComparatorEPKtS1_j
__ZNK9nsAString6EqualsERKS_PFiPKtS3_jE
__ZNK10nsACString12BeginReadingEv
/build_files/VizibleObjectModelImpl.build/Debug/VizibleObjectModel
(STLport).build/Objects
normal/ppc/FrameFactory.o reference to undefined
__ZNK9nsAString12BeginReadingEv
/build_files/VizibleObjectModelImpl.build/Debug/VizibleObjectModel
(STLport).build/Objects
normal/ppc/MetaData.o reference to undefined
__ZNK9nsAString12BeginReadingEv
/build_files/VizibleObjectModelImpl.build/Debug/VizibleObjectModel
(STLport).build/Objects-normal/ppc/Viewer.o
reference to undefined __ZNK9nsAString12BeginReadingEv

If memory serves, nsAString and nsCString are pretty basic to the
Firefox code.

When I first compiled Firefox to build the dylibs, I just followed
the instructions on mozilla developer page. MinefieldDebug seems to
work just fine!

Our build script just cd's to the mozilla directory and calls the
make -f client.mk build command.

Here's our mozconfig:

. $topsrcdir/browser/config/mozconfig
. $topsrcdir/build/macosx/universal/mozconfig
ac_add_options --enable-svg
ac_add_options --enable-quartz
ac_add_options --enable-optimize
ac_add_options --disable-debug
ac_add_options --disable-static
ac_add_options --enable-shared
ac_add_options --disable-tests
ac_add_options --disable-libxul
ac_add_options --enable-xpcom-obsolete
ac_add_options --with-macos-sdk=/Developer/SDKs/MacOSX10.4u.sdk
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/../build
mk_add_options MOZ_MAKE_FLAGS="-j4" # use parallel make

I did add the enable-xpcom-obsolete to produce libxpcom_compat.dylib
(which was produced from the Firefox 2.0 code), but the link errors
occurred.

So, I have a few questions. Were nsAString and nsCString moved? And
what dylib must I link to in order to link successfully? Is a change
to .mozconfig needed?

Thanks in advance for your time


Best regards


John Cebasek


Sergey Yanovich

unread,
Aug 8, 2008, 5:09:21 PM8/8/08
to
John Cebasek wrote:
> I've got the code compiling, but I'm having a weird link error.

Odds are your link command is wrong. I used to have similar issues until
I migrated my project to use Mozilla Build System. Instruction can be
found here [1].

> Here's our mozconfig:
>
> .. $topsrcdir/browser/config/mozconfig
> .. $topsrcdir/build/macosx/universal/mozconfig


> ac_add_options --enable-svg
> ac_add_options --enable-quartz
> ac_add_options --enable-optimize
> ac_add_options --disable-debug
> ac_add_options --disable-static
> ac_add_options --enable-shared
> ac_add_options --disable-tests
> ac_add_options --disable-libxul

What's wrong with libxul?

Mozilla project is extremely sophisticated, and only the official
configuration (the default one) is always known to work.

1.
http://developer.mozilla.org/en/docs/Creating_XULRunner_Apps_with_the_Mozilla_Build_System

--
Sergey Yanovich

Benjamin Smedberg

unread,
Aug 9, 2008, 10:26:46 PM8/9/08
to
John Cebasek wrote:

> We have a plugin and associated dylibs on Mac OS X that works with
> Firefox 2, which now must be brought up Firefox 3. I've got the code
> compiling, but I'm having a weird link error. Well, it's not that weird,
> it's not finding a bunch of symbols. But where did they go?
>
> The (beginning) of the errors are as follows:
>
> __ZNK9nsAString12BeginReadingEv
> __ZN9nsAString17DefaultComparatorEPKtS1_j
> __ZNK9nsAString6EqualsERKS_PFiPKtS3_jE
> __ZNK10nsACString12BeginReadingEv
> /build_files/VizibleObjectModelImpl.build/Debug/VizibleObjectModel(STLport).build/Objects

There are two versions of "nsAString". There is the internal, unstable
version, and a frozen/stable version. It appears that you are (correctly)
linking to the stable version, but are not linking against the necessary
libraries.

Please see http://developer.mozilla.org/en/docs/XPCOM_Glue

You want the "Frozen linkage: dependent glue" strategy.

> When I first compiled Firefox to build the dylibs, I just followed the
> instructions on mozilla developer page. MinefieldDebug seems to work
> just fine!
>
> Our build script just cd's to the mozilla directory and calls the make
> -f client.mk build command.
>
> Here's our mozconfig:
>
> . $topsrcdir/browser/config/mozconfig
> . $topsrcdir/build/macosx/universal/mozconfig

...


> ac_add_options --with-macos-sdk=/Developer/SDKs/MacOSX10.4u.sdk
> mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/../build
> mk_add_options MOZ_MAKE_FLAGS="-j4" # use parallel make

This is the only part of the mozconfig you should have. Please remove all
the rest of the options, especially options such as --disable-libxul and
--enable-xpcom-obsolete which cause fairly radical changes to the linking
strategy used for the app.

--BDS

Reply all
Reply to author
Forward
0 new messages