Last Comment Bug 537642 - AIX Port TOC overflow when linking static thunderbird-bin
: AIX Port TOC overflow when linking static thunderbird-bin
Status: RESOLVED FIXED
: fixed-seamonkey2.0.4
Product: MailNews Core
Classification: Components
Component: Build Config (show other bugs)
: Trunk
: PowerPC AIX
: -- normal (vote)
: Thunderbird 3.1b1
Assigned To: Uli Link (:ul-mcamafia)
:
Mentors:
Depends on:
Blocks: 537588
  Show dependency treegraph
 
Reported: 2010-01-03 19:17 PST by Uli Link (:ul-mcamafia)
Modified: 2010-03-18 06:41 PDT (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
beta1-fixed
.2-fixed


Attachments
passed the -bigtoc LDFLAGS only for AIX and static builds (549 bytes, patch)
2010-01-03 19:19 PST, Uli Link (:ul-mcamafia)
no flags Details | Diff | Review
additional LDFLAGS for AIX (596 bytes, patch)
2010-01-11 15:46 PST, Uli Link (:ul-mcamafia)
standard8: review+
Details | Diff | Review
additional LDFLAG for AIX, fixed to comment #5 (548 bytes, patch)
2010-02-08 03:55 PST, Uli Link (:ul-mcamafia)
standard8: approval‑thunderbird3.0.2+
Details | Diff | Review

Description Uli Link (:ul-mcamafia) 2010-01-03 19:17:36 PST
User-Agent:       Mozilla/5.0 (X11; U; AIX 5.1; en-US; rv:1.9.1.6) Gecko/20100101 SeaMonkey/2.0.1
Build Identifier: Thunderbird 3.0.x / Seamonkey 2.0.x

When linking thunderbird-bin configured with --enable-static / --disable-shared
the TOC overflows the 64k size on AIX. Needs additional passing the -bbigtoc LDFLAG in mail/app/Makefile.in

Detaied output:
xlC_r -o thunderbird-bin    -DNDEBUG -DTRIMMED -O2 -qarch=com -qmaxmem=-1 -qalias=noansi  nsMailApp.o nsStaticComponents.o    -lpthreads -bh:5 -Wl,-brtl -blibpath:/usr/lib:/lib    -L../../mozilla/dist/bin -L../../mozilla/dist/lib ../../mozilla/toolkit/xre/libxulapp_s.a -L../../mozilla/staticlib -L/home/ulink/Src/comm-1.9.1/TB3_OBJ_STATIC/mozilla/dist/bin -lmozjs  -L/home/ulink/Src/comm-1.9.1/TB3_OBJ_STATIC/mozilla/dist/bin -lxpcom -lxpcom_core  -liconv `/home/ulink/Src/comm-1.9.1/TB3_OBJ_STATIC/mozilla/dist/bin/nspr-config --prefix=/home/ulink/Src/comm-1.9.1/TB3_OBJ_STATIC/mozilla/dist --libdir=/home/ulink/Src/comm-1.9.1/TB3_OBJ_STATIC/mozilla/dist/lib --libs` -L/opt/freeware/lib -lgtk-x11-2.0 -latk-1.0 -lgdk-x11-2.0 -lgdk_pixbuf-2.0 -lm -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lintl -liconv      -lX11   -lC_r -ldl -lm -lc_r  ../../mozilla/staticlib/components/libpref.a ../../mozilla/staticlib/components/libuconv.a ../../mozilla/staticlib/components/libucvmath.a ../../mozilla/staticlib/components/libi18n.a ../../mozilla/staticlib/components/libnecko.a ../../mozilla/staticlib/components/libauth.a ../../mozilla/staticlib/components/libxpconnect.a ../../mozilla/staticlib/components/libchardet.a ../../mozilla/staticlib/components/libzipwriter.a ../../mozilla/staticlib/components/libmork.a ../../mozilla/staticlib/components/libcookie.a ../../mozilla/staticlib/components/libpermissions.a ../../mozilla/staticlib/components/libstoragecomps.a ../../mozilla/staticlib/components/librdf.a ../../mozilla/staticlib/components/libcaps.a ../../mozilla/staticlib/components/libhtmlpars.a ../../mozilla/staticlib/components/libgkgfxthebes.a ../../mozilla/staticlib/components/libimglib2.a ../../mozilla/staticlib/components/libgkplugin.a ../../mozilla/staticlib/components/libwidget_gtk2.a ../../mozilla/staticlib/components/libtxmgr.a ../../mozilla/staticlib/components/libcomposer.a ../../mozilla/staticlib/components/libgklayout.a ../../mozilla/staticlib/components/libdocshell.a ../../mozilla/staticlib/components/libembedcomponents.a ../../mozilla/staticlib/components/libwebbrwsr.a ../../mozilla/staticlib/components/libnsappshell.a ../../mozilla/staticlib/components/libuniversalchardet.a ../../mozilla/staticlib/components/libchrome.a ../../mozilla/staticlib/components/libmozfind.a ../../mozilla/staticlib/components/libintlapp.a ../../mozilla/staticlib/components/libwindowds.a ../../mozilla/staticlib/components/libxpautocomplete.a ../../mozilla/staticlib/components/libappcomps.a ../../mozilla/staticlib/components/libremoteservice.a ../../mozilla/staticlib/components/libfileview.a ../../mozilla/staticlib/components/libtkautocomplete.a ../../mozilla/staticlib/components/libsatchel.a ../../mozilla/staticlib/components/libcommandlines.a ../../mozilla/staticlib/components/libtoolkitcomps.a ../../mozilla/staticlib/components/libspellchecker.a ../../mozilla/staticlib/components/libunixproxy.a ../../mozilla/staticlib/components/libpipboot.a ../../mozilla/staticlib/components/libpipnss.a ../../mozilla/staticlib/components/libpippki.a ../../mozilla/staticlib/components/libautoconfig.a ../../mozilla/staticlib/components/libsystem-pref.a ../../mozilla/staticlib/components/libmozldap.a ../../mozilla/staticlib/components/libimport.a ../../mozilla/staticlib/components/libmsgsmime.a ../../mozilla/staticlib/components/libmail.a ../../mozilla/staticlib/components/libmailcomps.a ../../mozilla/staticlib/libmozreg_s.a ../../mozilla/staticlib/libunicharutil_s.a ../../mozilla/staticlib/libucvutil_s.a ../../mozilla/staticlib/libgtkxtbin.a ../../mozilla/staticlib/libthebes.a ../../mozilla/staticlib/libgfxshared_s.a ../../mozilla/staticlib/libgfxpsshar.a ../../mozilla/staticlib/libgkgfx.a ../../mozilla/staticlib/libmimecthglue_s.a  -L../../mozilla/modules/libimg/png -lmozpng -L../../mozilla/jpeg -lmozjpeg -lz   -L../../mozilla/dist/bin -L../../mozilla/dist/lib -lcrmf -lsmime3 -lssl3 -lnss3 -lnssutil3 -lsoftokn3  -L../../mozilla/dist/bin -L../../mozilla/dist/lib -lldap60 -lprldap60 -lldif60  -L/opt/freeware/lib -lcairo -lfreetype -lfontconfig    -L/opt/freeware/lib -lXrender -lSM -lICE -lX11 -lcairo   ../../mozilla/gfx/qcms/libmozqcms.a  -lXm -lXt -lgthread-2.0 -L/opt/freeware/lib -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lintl -liconv   -L../../mozilla/dist/lib -lsqlite3 -lodm -lcfg    
ld: 0711-781 ERROR: TOC overflow. TOC size: 66892       Maximum size: 65536
gmake[1]: *** [thunderbird-bin] Error 12
gmake[1]: Leaving directory `/home/ulink/Src/comm-1.9.1/TB3_OBJ_STATIC/mail/app'
gmake: *** [default] Error 2


Reproducible: Always

Steps to Reproduce:
1. Have --enable-static and --disable-shared in you .mozconfig
2. Compile on AIX with IBM XLC/C++ 7.0 (or later)
Actual Results:  
Linker error

Expected Results:  
Linking a working binary
Comment 1 Uli Link (:ul-mcamafia) 2010-01-03 19:19:30 PST
Created attachment 419861 [details] [diff] [review]
passed the -bigtoc LDFLAGS only for AIX and static builds
Comment 2 Uli Link (:ul-mcamafia) 2010-01-03 19:34:22 PST
The -bbigtoc ld flag has a performance penalty. So I always try to use it selective instead as hacking it into the toplevel configure.in script.
Another candidate is the libxul.so, if configured for big libxul.so / small binary. Same trick.
When building 64bit it seems more symbols are exported.
Comment 3 Karsten Düsterloh 2010-01-09 05:08:51 PST
Comment on attachment 419861 [details] [diff] [review]
passed the -bigtoc LDFLAGS only for AIX and static builds

Sorry, but I'm not intimate enough with our build system to review patches to it. :-(
I would have passed on to Mark if you hadn't already asked him for review...
Comment 4 Uli Link (:ul-mcamafia) 2010-01-11 15:46:05 PST
Created attachment 421147 [details] [diff] [review]
additional LDFLAGS for AIX

Repositioned the block ifdef ($(OS_ARCH),AIX) block
Comment 5 Mark Banner (:standard8) 2010-02-08 03:42:05 PST
Comment on attachment 421147 [details] [diff] [review]
additional LDFLAGS for AIX

Sorry for the delay in getting to this.

>+ifeq ($(OS_ARCH),AIX)
>+ifdef  BUILD_STATIC_LIBS
>+LDFLAGS += -bbigtoc
>+endif
>+endif

nit: only one space after ifdef and before BUILD_STATIC_LIBS

r=Standard8 with that fixed.
Comment 6 Uli Link (:ul-mcamafia) 2010-02-08 03:55:44 PST
Created attachment 425781 [details] [diff] [review]
additional LDFLAG for AIX, fixed to comment #5

whitespace fixed
Comment 7 Mark Banner (:standard8) 2010-02-08 13:39:05 PST
Checked in: http://hg.mozilla.org/comm-central/rev/bcba89660b72
Comment 8 Uli Link (:ul-mcamafia) 2010-02-09 03:34:38 PST
Comment on attachment 425781 [details] [diff] [review]
additional LDFLAG for AIX, fixed to comment #5

No risc for everything but AIX,
this patch was locally applied when building TB 3.0 and 3.0.1 w/o problems on AIX 5.1 and AIX 4.3.3
Comment 9 Mark Banner (:standard8) 2010-02-11 06:32:14 PST
Checked in: http://hg.mozilla.org/releases/comm-1.9.1/rev/c82fc38a3a5c
Comment 10 Mark Banner (:standard8) 2010-02-16 12:40:53 PST
Marking as verified fixed for 3.0.2 release - verified that the tree is still building fine, and did visual inspection that the patch only affects AIX.
Comment 11 Uli Link (:ul-mcamafia) 2010-02-17 00:53:57 PST
(In reply to comment #10)
> Marking as verified fixed for 3.0.2 release - verified that the tree is still
> building fine, and did visual inspection that the patch only affects AIX.

Verified with successful build on AIX too.
THX

Note You need to log in before you can comment on or make changes to this bug.