Closed Bug 397146 Opened 18 years ago Closed 17 years ago

Link errors in static build of Seamonkey due to double inclusion of object module

Categories

(SeaMonkey :: General, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 461938

People

(Reporter: swsnyder, Unassigned)

Details

When Seamonkey (trunk, 21 Sep 2007) is built with "ac_add_options --enable-static --disable-shared" the object module nsTypeAheadFind.obj is included twice in the final link of seamonkey.exe, causing fatal duplication of symbols. Here's what happens. First, nsTypeAheadFind.obj is compiled and added to library fastfind_s.lib, which in turn is later added to library tkitcmps.lib. Then it is compiled again and added to library suitetypeaheadfind.lib. At the final link of seamonkey.exe both suitetypeaheadfind.lib and tkitcmps.lib are input files on the linker command line, causing duplicate symbols to be complained about. This same code builds correctly for the usual --shared build of Seamonkey.
The gory details: link -NOLOGO -OUT:seamonkey.exe -PDB:seamonkey.pdb -SUBSYSTEM:WINDOWS -NXCOMPAT-SAFESEH /HEAP:0x40000 nsSuiteApp.obj nsStaticComponents.obj ./module.res ../../toolkit/xre/xulapp_s.lib -LIBPATH:../../staticlib ../../dist/lib/js3250.lib ../../dist/lib/sqlite3.lib ../../dist/lib/xpcom.lib ../../dist/lib/xpcom_core.lib../../dist/lib/nspr4.lib ../../dist/lib/plc4.lib ../../dist/lib/plds4.lib ../../staticlib/components/xppref32.lib ../../staticlib/components/uconv.lib ../../staticlib/components/ucvmath.lib ../../staticlib/components/i18n.lib ../../staticlib/components/necko.lib ../../staticlib/components/auth.lib ../../staticlib/components/xpc3250.lib ../../staticlib/components/chardet.lib ../../staticlib/components/zipwriter.lib ../../staticlib/components/mork.lib ../../staticlib/components/cookie.lib ../../staticlib/components/perms.lib ../../staticlib/components/strgcmps.lib ../../staticlib/components/rdf.lib ../../staticlib/components/caps.lib ../../staticlib/components/gkparser.lib ../../staticlib/components/gkgfxthebes.lib ../../staticlib/components/imgicon.lib ../../staticlib/components/imglib2.lib ../../staticlib/components/gkplugin.lib ../../staticlib/components/gkwidget.lib ../../staticlib/components/txmgr.lib ../../staticlib/components/composer.lib ../../staticlib/components/gklayout.lib ../../staticlib/components/docshell.lib ../../staticlib/components/embedcomponents.lib ../../staticlib/components/webbrwsr.lib ../../staticlib/components/appshell.lib ../../staticlib/components/xmlextras.lib ../../staticlib/components/universalchardet.lib ../../staticlib/components/oji.lib ../../staticlib/components/chrome.lib ../../staticlib/components/mozfind.lib ../../staticlib/components/intlapp.lib ../../staticlib/components/windowds.lib ../../staticlib/components/xpautoc.lib ../../staticlib/components/appcomps.lib ../../staticlib/components/tkautoc.lib ../../staticlib/components/satchel.lib ../../staticlib/components/cmdlines.lib ../../staticlib/components/tkitcmps.lib ../../staticlib/components/spellchk.lib ../../staticlib/components/pipboot.lib ../../staticlib/components/pipnss.lib ../../staticlib/components/pippki.lib../../staticlib/components/autoconfig.lib ../../staticlib/components/wallet.lib../../staticlib/components/wlltvwrs.lib ../../staticlib/components/suitetypeaheadfind.lib ../../staticlib/components/import.lib ../../staticlib/components/msgsmime.lib ../../staticlib/components/msgMapi.lib ../../staticlib/components/mail.lib ../../staticlib/components/suite.lib ../../staticlib/mozreg_s.lib ../../staticlib/unicharutil_s.lib ../../staticlib/ucvutil_s.lib ../../staticlib/thebes.lib../../staticlib/gfxshared_s.lib ../../staticlib/gkgfx.lib ../../staticlib/jsj3250.lib ../../staticlib/mimecthglue_s.lib ../../modules/libimg/png/png.lib ../../jpeg/jpeg3250.lib ../../modules/zlib/src/mozz.lib ../../dist/lib/mozlcms.lib ../../dist/lib/crmf.lib ../../dist/lib/smime3.lib ../../dist/lib/ssl3.lib ../../dist/lib/nss3.lib ../../dist/lib/softokn3.lib ../../gfx/cairo/cairo/src/mozcairo.lib ../../gfx/cairo/libpixman/src/mozlibpixman.lib comctl32.lib comdlg32.lib uuid.lib shell32.lib ole32.lib oleaut32.lib version.lib winspool.lib imm32.lib usp10.lib kernel32.lib user32.lib gdi32.lib winmm.lib wsock32.lib advapi32.lib comctl32.lib comdlg32.lib uuid.lib shell32.lib ole32.lib oleaut32.lib version.lib winspool.lib nsSuiteApp.obj : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance suitetypeaheadfind.lib(nsTypeAheadFind.obj) : error LNK2005: "protected: unsigned int __thiscall nsTypeAheadFind::PrefsReset(void)" (?PrefsReset@nsTypeAheadFind@@IAEIXZ) already defined in tkitcmps.lib(nsTypeAheadFind.obj) suitetypeaheadfind.lib(nsTypeAheadFind.obj) : error LNK2005: "protected: struct already_AddRefed<class nsIPresShell> __thiscall nsTypeAheadFind::GetPresShell(void)" (?GetPresShell@nsTypeAheadFind@@IAE?AU?$already_AddRefed@VnsIPresShell@@@@XZ) already defined in tkitcmps.lib(nsTypeAheadFind.obj) suitetypeaheadfind.lib(nsTypeAheadFind.obj) : error LNK2005: "public: virtual __thiscall nsTypeAheadFind::~nsTypeAheadFind(void)" (??1nsTypeAheadFind@@UAE@XZ) already defined in tkitcmps.lib(nsTypeAheadFind.obj) suitetypeaheadfind.lib(nsTypeAheadFind.obj) : error LNK2005: "public: __thiscallnsTypeAheadFind::nsTypeAheadFind(void)" (??0nsTypeAheadFind@@QAE@XZ) already defined in tkitcmps.lib(nsTypeAheadFind.obj) suitetypeaheadfind.lib(nsTypeAheadFind.obj) : error LNK2005: "public: virtual unsigned long __stdcall nsTypeAheadFind::Release(void)" (?Release@nsTypeAheadFind@@UAGKXZ) already defined in tkitcmps.lib(nsTypeAheadFind.obj) suitetypeaheadfind.lib(nsTypeAheadFind.obj) : error LNK2005: "public: virtual unsigned long __stdcall nsTypeAheadFind::AddRef(void)" (?AddRef@nsTypeAheadFind@@UAGKXZ) already defined in tkitcmps.lib(nsTypeAheadFind.obj) suitetypeaheadfind.lib(nsTypeAheadFind.obj) : error LNK2005: "public: virtual unsigned int __stdcall nsTypeAheadFind::QueryInterface(struct nsID const &,void **)" (?QueryInterface@nsTypeAheadFind@@UAGIABUnsID@@PAPAX@Z) already defined in tkitcmps.lib(nsTypeAheadFind.obj) suitetypeaheadfind.lib(nsTypeAheadFind.obj) : error LNK2005: "protected: void __thiscall nsTypeAheadFind::RangeStartsInsideLink(class nsIDOMRange *,class nsIPresShell *,int *,int *)" (?RangeStartsInsideLink@nsTypeAheadFind@@IAEXPAVnsIDOMRange@@PAVnsIPresShell@@PAH2@Z) already defined in tkitcmps.lib(nsTypeAheadFind.obj) suitetypeaheadfind.lib(nsTypeAheadFind.obj) : error LNK2005: "protected: void __thiscall nsTypeAheadFind::GetSelection(class nsIPresShell *,class nsISelectionController * *,class nsISelection * *)" (?GetSelection@nsTypeAheadFind@@IAEXPAVnsIPresShell@@PAPAVnsISelectionController@@PAPAVnsISelection@@@Z) already defined in tkitcmps.lib(nsTypeAheadFind.obj) suitetypeaheadfind.lib(nsTypeAheadFind.obj) : error LNK2005: "protected: void __thiscall nsTypeAheadFind::PlayNotFoundSound(void)" (?PlayNotFoundSound@nsTypeAheadFind@@IAEXXZ) already defined in tkitcmps.lib(nsTypeAheadFind.obj) suitetypeaheadfind.lib(nsTypeAheadFind.obj) : error LNK2005: "public: virtual unsigned int __stdcall nsTypeAheadFind::QueryInterface(struct nsID const &,void **)" (?QueryInterface@nsTypeAheadFind@@UAGIABUnsID@@PAPAX@Z) already defined in tkitcmps.lib(nsTypeAheadFind.obj) suitetypeaheadfind.lib(nsTypeAheadFind.obj) : error LNK2005: "protected: void __thiscall nsTypeAheadFind::RangeStartsInsideLink(class nsIDOMRange *,class nsIPresShell *,int *,int *)" (?RangeStartsInsideLink@nsTypeAheadFind@@IAEXPAVnsIDOMRange@@PAVnsIPresShell@@PAH2@Z) already defined in tkitcmps.lib(nsTypeAheadFind.obj) suitetypeaheadfind.lib(nsTypeAheadFind.obj) : error LNK2005: "protected: void __thiscall nsTypeAheadFind::GetSelection(class nsIPresShell *,class nsISelectionController * *,class nsISelection * *)" (?GetSelection@nsTypeAheadFind@@IAEXPAVnsIPresShell@@PAPAVnsISelectionController@@PAPAVnsISelection@@@Z) already defined in tkitcmps.lib(nsTypeAheadFind.obj) suitetypeaheadfind.lib(nsTypeAheadFind.obj) : error LNK2005: "protected: void __thiscall nsTypeAheadFind::PlayNotFoundSound(void)" (?PlayNotFoundSound@nsTypeAheadFind@@IAEXXZ) already defined in tkitcmps.lib(nsTypeAheadFind.obj) suitetypeaheadfind.lib(nsTypeAheadFind.obj) : error LNK2005: "protected: void __thiscall nsTypeAheadFind::SaveFind(void)" (?SaveFind@nsTypeAheadFind@@IAEXXZ) already defined in tkitcmps.lib(nsTypeAheadFind.obj) suitetypeaheadfind.lib(nsTypeAheadFind.obj) : error LNK2005: "public: virtual unsigned int __stdcall nsTypeAheadFind::Observe(class nsISupports *,char const *,unsigned short const *)" (?Observe@nsTypeAheadFind@@UAGIPAVnsISupports@@PBDPBG@Z)already defined in tkitcmps.lib(nsTypeAheadFind.obj) Creating library seamonkey.lib and object seamonkey.exp nsStaticComponents.obj : error LNK2001: unresolved external symbol "unsigned int__cdecl nsSuiteModule_NSGetModule(class nsIComponentManager *,class nsIFile *,class nsIModule * *)" (?nsSuiteModule_NSGetModule@@YAIPAVnsIComponentManager@@PAVnsIFile@@PAPAVnsIModule@@@Z) mozcairo.lib(cairo-win32-printing-surface.obj) : error LNK2001: unresolved external symbol __imp__GradientFill@24 seamonkey.exe : fatal error LNK1120: 2 unresolved externals make[5]: *** [seamonkey.exe] Error 96 make[4]: *** [libs] Error 2 make[3]: *** [libs_tier_app] Error 2 make[2]: *** [tier_app] Error 2 make[1]: *** [default] Error 2 make: *** [build] Error 2
Removing the typeaheadfind extension from the build entirely "fixes" the problem. E.g.: ac_add_options --enable-static --disable-shared ac_add_options --enable-extensions=default,-typeaheadfind I still get those last 2, non-typeaheadfind, symbol errors in the link (as shown above), but at least the 16 nsTypeAheadFind errors are gone.
Hmmm... Hard to know if I should be happy that this is a known problem, or unhappy that it has gone unaddressed for 21 months.
Static builds of SeaMonkey have never been supported, as far as I know.
Blocks: 464671
suite typeaheadfind has been removed from the build, so the fix for that bug fixed this one, which makes this a dupe of the other.
No longer blocks: 464671
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → DUPLICATE
Target Milestone: seamonkey2.0a1 → ---
You need to log in before you can comment on or make changes to this bug.