Closed Bug 591098 Opened 10 years ago Closed 8 years ago

Linking failure with libxul in mailnews/import/build

Categories

(MailNews Core :: Import, defect)

defect
Not set

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: kairo, Unassigned)

References

Details

Attachments

(1 file, 2 obsolete files)

I tried compiling SeaMonkey with |--enable-libxul --enable-incomplete-external-linkage --disable-ldap --disable-tests| today to see how good we are (LDAP is known to not work yet, and I ran into a MailNews test disagreeing with this as well, so I disabled them as well).

What I ran into after applying the bug 591078 fix is the following:


/usr/bin/ccache /usr/bin/g++  -fno-rtti -fno-exceptions -Wall -Wpointer-arith -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Wcast-align -Wno-invalid-offsetof -Wno-variadic-macros -Werror=return-type -pedantic -Wno-long-long -fno-strict-aliasing -fshort-wchar -pthread -pipe  -DNDEBUG -DTRIMMED -Os -freorder-blocks -fno-reorder-functions -fomit-frame-pointer  -fPIC -shared -Wl,-z,defs -Wl,-h,libimport.so -o libimport.so  nsImportModule.o     -lpthread   -Wl,-rpath-link,/mnt/mozilla/build/seamonkey-libxul/mozilla/dist/bin:/usr/lib:/usr/local/lib:/lib -Wl,-rpath-link,/usr/local/lib  -Wl,--whole-archive ../src/libimport_s.a ../text/src/libimptext_s.a ../comm4x/src/libimp4mail_s.a  -Wl,--no-whole-archive -L../../../mozilla/dist/bin -L../../../mozilla/dist/lib  /mnt/mozilla/build/seamonkey-libxul/mozilla/dist/lib/libxpcomglue_s.a -L/mnt/mozilla/build/seamonkey-libxul/mozilla/dist/bin -lxpcom -lmozalloc -L/mnt/mozilla/build/seamonkey-libxul/mozilla/dist/lib -lunicharutil_external_s ../../../mozilla/modules/libreg/src/libmozreg_s.a `/mnt/mozilla/build/seamonkey-libxul/mozilla/dist/bin/nspr-config --prefix=/mnt/mozilla/build/seamonkey-libxul/mozilla/dist --libdir=/mnt/mozilla/build/seamonkey-libxul/mozilla/dist/lib --libs`  -Wl,--version-script -Wl,/mnt/mozilla/hg/comm-central/mozilla/build/unix/gnu-ld-scripts/components-version-script -Wl,-Bsymbolic -ldl -lm    
../src/libimport_s.a(nsImportMail.o): In function `nsImportGenericMail::GetMailboxName(unsigned int, nsISupportsString*)':
nsImportMail.cpp:(.text+0xb9d): undefined reference to `vtable for nsQueryElementAt'
/usr/lib/gcc/i586-suse-linux/4.5/../../../../i586-suse-linux/bin/ld: ../src/libimport_s.a(nsImportMail.o): relocation R_386_GOTOFF against undefined hidden symbol `vtable for nsQueryElementAt' can not be used when making a shared object
/usr/lib/gcc/i586-suse-linux/4.5/../../../../i586-suse-linux/bin/ld: final link failed: Bad value
collect2: ld returned 1 exit status
gmake[6]: *** [libimport.so] Error 1
gmake[6]: Leaving directory `/mnt/mozilla/build/seamonkey-libxul/mailnews/import/build'
gmake[5]: *** [libs] Error 2
Attached patch Use nsMsgUtils patch (obsolete) — Splinter Review
See if this helps.
Comment on attachment 469718 [details] [diff] [review]
Use nsMsgUtils patch

Sorry, doesn't help here...
Attachment #469718 - Flags: feedback-
You probably need to do nsComm4xMail.cpp too (the link may have only reported the first occurrence of the missing symbol).
Attached patch nsComm4xMail too patch (obsolete) — Splinter Review
Added to nsComm4xMail too but still does not work (slightly different message though):
g++  -fno-rtti -fno-exceptions -Wall -Wpointer-arith -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Wcast-align -Wno-invalid-offsetof -Wno-variadic-macros -Werror=return-type -pedantic -Wno-long-long -fno-strict-aliasing -fshort-wchar -pthread -pipe  -DNDEBUG -DTRIMMED -g -O2 -gstabs+ -fPIC -shared -Wl,-z,defs -Wl,-h,libimport.so -o libimport.so  nsImportModule.o     -lpthread    -Wl,-rpath-link,/mozdev/obj-suite-central-xul/mozilla/dist/bin:/usr/lib:/usr/local/lib:/lib -Wl,-rpath-link,/usr/local/lib  -Wl,--whole-archive ../src/libimport_s.a ../text/src/libimptext_s.a ../comm4x/src/libimp4mail_s.a  -Wl,--no-whole-archive -L../../../mozilla/dist/bin -L../../../mozilla/dist/lib  /mozdev/obj-suite-central-xul/mozilla/dist/lib/libxpcomglue_s.a -L/mozdev/obj-suite-central-xul/mozilla/dist/bin -lxpcom -lmozalloc -L/mozdev/obj-suite-central-xul/mozilla/dist/lib -lunicharutil_external_s ../../../mozilla/modules/libreg/src/libmozreg_s.a `/mozdev/obj-suite-central-xul/mozilla/dist/bin/nspr-config --prefix=/mozdev/obj-suite-central-xul/mozilla/dist --libdir=/mozdev/obj-suite-central-xul/mozilla/dist/lib --libs`  -Wl,--version-script -Wl,/mozdev/commsrc/mozilla/build/unix/gnu-ld-scripts/components-version-script -Wl,-Bsymbolic -ldl -lm    
../src/libimport_s.a(nsImportMail.o): In function `ImportMailThread(void*)':
/mozdev/commsrc/mailnews/import/src/nsImportMail.cpp:803: undefined reference to `vtable for MsgQueryElementAt'
/usr/bin/ld: ../src/libimport_s.a(nsImportMail.o): relocation R_386_GOTOFF against undefined hidden symbol `vtable for MsgQueryElementAt' can not be used when making a shared object
/usr/bin/ld: final link failed: Bad value
collect2: ld returned 1 exit status
make[6]: *** [libimport.so] Error 1
make[6]: Leaving directory `/mozdev/obj-suite-central-xul/mailnews/import/build'
make[5]: *** [libs] Error 2
Attachment #469718 - Attachment is obsolete: true
(In reply to comment #4)
> still does not work (slightly different message though):

To be more explicit, it's the same error (and file) but in a different function:
Comment 0: "nsImportGenericMail::GetMailboxName(unsigned int, nsISupportsString*)"
Comment 4: "ImportMailThread(void*)"
No it's not.

The first error was for nsQueryElementAt, which isn't surprising, since that's not exported from libxul.

The second error was for MsgQueryElementAt, which should exist in $(LIB_PREFIX)msgbsutl_s.$(LIB_SUFFIX) or $(LIB_PREFIX)msgbaseutil.$(DLL_SUFFIX) depending on whether this is a static mail build or not.

Strangely I see neither mentioned on the link command line, despite being in mailnews/import/build/Makefile.in; maybe a bug in the Makefile?
Depends on: 582195
This now fails:
../text/src/libimptext_s.a(nsTextAddress.o): In function `nsTextAddress::ProcessLine(char const*, int, nsString_external&)':
/mozdev/commsrc/mailnews/import/text/src/nsTextAddress.cpp:480: undefined reference to `NS_CopyNativeToUnicode(nsACString const&, nsAString&)'
../../base/util/libmsgbsutl_s.a(nsMsgUtils.o): In function `NS_MsgHashIfNecessary(nsString_external&)':
/mozdev/commsrc/mailnews/base/util/nsMsgUtils.cpp:376: undefined reference to `NS_CopyUnicodeToNative(nsAString const&, nsACString&)'
/mozdev/commsrc/mailnews/base/util/nsMsgUtils.cpp:377: undefined reference to `NS_CopyNativeToUnicode(nsACString const&, nsAString&)'
/usr/bin/ld: libimport.so: hidden symbol `NS_CopyNativeToUnicode(nsACString const&, nsAString&)' isn't defined
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: ld returned 1 exit status
make[6]: *** [libimport.so] Error 1

These should be fixed when bug 582195 gets fixed (hopefully).
Attachment #470005 - Attachment is obsolete: true
(In reply to comment #7)
> These should be fixed when bug 582195 gets fixed (hopefully).

Did that bug changeset fix this bug?
Or was it already WorksForMe in the meantime?
This should be set as WorksForMe. I've talked also to Ian Neal.
Bug 657394 also added some import fixes, which may have fixed this too.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.