Closed Bug 239441 Opened 20 years ago Closed 20 years ago

AIX: Undefined symbols when linking mozilla-bin after Bug 239303

Categories

(Core :: XPCOM, defect)

Other
AIX
defect
Not set
critical

Tracking

()

RESOLVED FIXED
mozilla1.7final

People

(Reporter: pkwarren, Assigned: darin.moz)

Details

Attachments

(1 file, 1 obsolete file)

The checkin for Bug 239303 broke the AIX build. xpfe/boostrap/mozilla-bin now
fails to link with the following errors:

xlC_r -o mozilla-bin    -DNDEBUG -DTRIMMED -DWIDGET_DLL=\"libwidget_gtk.so\"
-DGFXWIN_DLL=\"libgfx_gtk.so\" -I/opt/freeware/include/gtk-1.2
-I/opt/freeware/include/glib-1.2 -I/opt/freeware/lib/glib/include  nsAppRunner.o
nsWindowCreator.o showOSAlert.o nsSigHandlers.o nsStackFrameUnix.o
nsNativeAppSupportGtk.o nsNativeAppSupportBase.o  -bh:5 -Wl,-brtl
-blibpath:/usr/lib:/lib  -L../../dist/bin -L../../dist/lib   
../../dist/lib/libstring_s.a ../../dist/lib/libxpcomglue.a  -L../../dist/bin
-lmozjs -L/home/pkw/sb/mozilla/trunk/mozilla/obj-tinder/dist/lib -lplds4 -lplc4
-lnspr4 -lpthreads -ldl   -L/opt/freeware/lib -Wl,-brtl -lgtk -lgdk -lgmodule
-lglib -lintl -lXext -lX11 -lm  -lX11  -lC_r -ldl -lm -lc_r      
ld: 0711-317 ERROR: Undefined symbol: .NS_CopyNativeToUnicode(const
nsACString&,nsAString&)
ld: 0711-317 ERROR: Undefined symbol: .NS_CopyUnicodeToNative(const
nsAString&,nsACString&)
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.

AIX is one of the platforms which requires all symbols to be resolved at link time.
The NS_CopyNativeToUnicode and NS_CopyUnicodeToNative symbols now exist in the
libstring_s.a library but are undefined. These symbols exist in the
libxpcomio_s.a library, but since we are only linking against libstring_s.a and
libxpcomglue.a libraries for mozilla-bin, they are coming up as undefined.

pkw@ut:~/sb/mozilla/trunk/mozilla/obj-tinder/dist/lib$ nm -pB libstring_s.a |
grep 'NS_Copy'
         - U .NS_CopyNativeToUnicode(const nsACString&,nsAString&)
         - U .NS_CopyUnicodeToNative(const nsAString&,nsACString&

pkw@ut:~/sb/mozilla/trunk/mozilla/obj-tinder/dist/lib$ nm -pB libxpcomio_s.a |
grep 'NS_Copy'
      4120 T .NS_CopyNativeToUnicode(const nsACString&,nsAString&)
      5360 T .NS_CopyUnicodeToNative(const nsAString&,nsACString&)
      6992 D NS_CopyNativeToUnicode(const nsACString&,nsAString&)
      6812 d NS_CopyNativeToUnicode(const nsACString&,nsAString&)
      7100 D NS_CopyUnicodeToNative(const nsAString&,nsACString&)
      6848 d NS_CopyUnicodeToNative(const nsAString&,nsACString&)
         - U .NS_CopyUnicodeToNative(const nsAString&,nsACString&)
         - U .NS_CopyNativeToUnicode(const nsACString&,nsAString&)

The origin of these two symbols in the string library:
http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/xpcom/string/src/nsStringAPI.cpp#211
Summary: Checkin for Bug 239303 broke AIX build → AIX: Undefined symbols when linking mozilla-bin after Bug 239303
Assignee: string → darin
Severity: normal → critical
Target Milestone: --- → mozilla1.7final
1) (hacky solution) ifdef out GRE_BUILD for AIX in xpfe/bootstrap/Makefile.in
   since we certainly don't use a GRE yet
2) fix all the code linked into mozilla-bin to use nsEmbedString and stop linking
   the string_s library (we should never have linked it to begin with, but...)
Severity: critical → normal
Target Milestone: mozilla1.7final → ---
another solution: move the implementation of nsStringAPI.cpp into its own static
library (libstringembed_s.a).  that way, mozilla-bin can link against the rest
of the string library but not the nsStringAPI part.
Severity: normal → critical
Target Milestone: --- → mozilla1.7final
bsmedberg also suggested just moving nsStringAPI.cpp into xpcom/build.
Attached patch v1 patch (obsolete) — Splinter Review
this patch implements bsmedberg's suggestion.
Attachment #145341 - Flags: superreview?(dbaron)
Attachment #145341 - Flags: review?(bsmedberg)
I have verified that this patch fixes the problem - thanks for the quick turnaround!
Comment on attachment 145341 [details] [diff] [review]
v1 patch

unfortunately, CPPSRCS cannot be in subdirs like that... it messes up the
dependency-tracking. We either need to actually move the file in CVS, or
nsinstall it into the new directory.
Attachment #145341 - Flags: review?(bsmedberg) → review-
or you could use VPATH? if this doesn't need to work on windows.
Attachment #145341 - Flags: superreview?(dbaron)
Attached patch v1.1 patchSplinter Review
ok, this patch assumes nsStringAPI.cpp has been moved into xpcom/build.

i spoke to dougt, and he is ok with this change.
Attachment #145341 - Attachment is obsolete: true
Attachment #145350 - Flags: superreview?(dbaron)
Attachment #145350 - Flags: review?(bsmedberg)
Attachment #145350 - Flags: review?(bsmedberg) → review+
Attachment #145350 - Flags: superreview?(dbaron) → superreview+
Attachment #145350 - Flags: approval1.7?
Darin, do you need a cvs ,v file copy operation to preserve history?

/be
> Darin, do you need a cvs ,v file copy operation to preserve history?

that would be nice, and i was going to talk to leaf about that, but it is not so
important since the file is young and i already have blame for most if not all
of it.
Comment on attachment 145350 [details] [diff] [review]
v1.1 patch

a=brendan@mozilla.org for 1.7.

/be
Attachment #145350 - Flags: approval1.7? → approval1.7+
fixed-on-trunk for 1.7 final
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Component: String → XPCOM
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: