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

RESOLVED FIXED in mozilla1.7final

Status

()

Core
String
--
critical
RESOLVED FIXED
14 years ago
14 years ago

People

(Reporter: Philip K. Warren, Assigned: Darin Fisher)

Tracking

Trunk
mozilla1.7final
Other
AIX
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

2.23 KB, patch
Benjamin Smedberg
: review+
dbaron
: superreview+
brendan
: approval1.7+
Details | Diff | Splinter Review
(Reporter)

Description

14 years ago
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.
(Reporter)

Comment 1

14 years ago
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
(Reporter)

Updated

14 years ago
Summary: Checkin for Bug 239303 broke AIX build → AIX: Undefined symbols when linking mozilla-bin after Bug 239303
(Assignee)

Updated

14 years ago
Assignee: string → darin
Severity: normal → critical
Target Milestone: --- → mozilla1.7final

Comment 2

14 years ago
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 → ---
(Assignee)

Comment 3

14 years ago
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
(Assignee)

Comment 4

14 years ago
bsmedberg also suggested just moving nsStringAPI.cpp into xpcom/build.
(Assignee)

Comment 5

14 years ago
Created attachment 145341 [details] [diff] [review]
v1 patch

this patch implements bsmedberg's suggestion.
(Assignee)

Updated

14 years ago
Attachment #145341 - Flags: superreview?(dbaron)
Attachment #145341 - Flags: review?(bsmedberg)
(Reporter)

Comment 6

14 years ago
I have verified that this patch fixes the problem - thanks for the quick turnaround!

Comment 7

14 years ago
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.
(Assignee)

Updated

14 years ago
Attachment #145341 - Flags: superreview?(dbaron)
(Assignee)

Comment 9

14 years ago
Created attachment 145350 [details] [diff] [review]
v1.1 patch

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
(Assignee)

Updated

14 years ago
Attachment #145350 - Flags: superreview?(dbaron)
Attachment #145350 - Flags: review?(bsmedberg)

Updated

14 years ago
Attachment #145350 - Flags: review?(bsmedberg) → review+
Attachment #145350 - Flags: superreview?(dbaron) → superreview+
(Assignee)

Updated

14 years ago
Attachment #145350 - Flags: approval1.7?
Darin, do you need a cvs ,v file copy operation to preserve history?

/be
(Assignee)

Comment 11

14 years ago
> 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+
(Assignee)

Comment 13

14 years ago
fixed-on-trunk for 1.7 final
Status: NEW → RESOLVED
Last Resolved: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.