Closed Bug 904485 Opened 6 years ago Closed 6 years ago

stdcxx error in build

Categories

(SeaMonkey :: Build Config, defect)

x86
Linux
defect
Not set

Tracking

(seamonkey2.22 fixed)

RESOLVED FIXED
seamonkey2.23
Tracking Status
seamonkey2.22 --- fixed

People

(Reporter: ewong, Assigned: mcsmurf)

References

Details

Attachments

(4 files, 5 obsolete files)

Getting build errors:

make[4]: *** [check] Error 1
make[3]: *** [check] Error 2
make[2]: *** [check] Error 2
make[1]: *** [check] Error 2
make[3]: *** [check] Error 1
make[2]: *** [check] Error 2
TEST-UNEXPECTED-FAIL | /builds/slave/c-cen-t-lnx/build/mozilla/js/src/jit-test/tests/bug765479.js | --ion-eager: /builds/slave/c-cen-t-lnx/build/objdir/mozilla/dist/bin/js: /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.9' not found (required by /builds/slave/c-cen-t-lnx/build/objdir/mozilla/dist/bin/js)
TEST-UNEXPECTED-FAIL | /builds/slave/c-cen-t-lnx/build/mozilla/js/src/jit-test/tests/bug765479.js | : /builds/slave/c-cen-t-lnx/build/objdir/mozilla/dist/bin/js: /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.9' not found (required by /builds/slave/c-cen-t-lnx/build/objdir/mozilla/dist/bin/js)
TEST-UNEXPECTED-FAIL | /builds/slave/c-cen-t-lnx/build/mozilla/js/src/jit-test/tests/bug765479.js | --baseline-eager: /builds/slave/c-cen-t-lnx/build/objdir/mozilla/dist/bin/js: /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.9' not found (required by /builds/slave/c-cen-t-lnx/build/objdir/mozilla/dist/bin/js)
TEST-UNEXPECTED-FAIL | /builds/slave/c-cen-t-lnx/build/mozilla/js/src/jit-test/tests/bug765479.js | --baseline-eager --no-ti --no-fpu: /builds/slave/c-cen-t-lnx/build/objdir/mozilla/dist/bin/js: /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.9' not found (required by /builds/slave/c-cen-t-lnx/build/objdir/mozilla/dist/bin/js)
TEST-UNEXPECTED-FAIL | /builds/slave/c-cen-t-lnx/build/mozilla/js/src/jit-test/tests/bug765479.js | --no-baseline --no-ion: /builds/slave/c-cen-t-lnx/build/objdir/mozilla/dist/bin/js: /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.9' not found (required by /builds/slave/c-cen-t-lnx/build/objdir/mozilla/dist/bin/js)
TEST-UNEXPECTED-FAIL | /builds/slave/c-cen-t-lnx/build/mozilla/js/src/jit-test/tests/bug765479.js | --no-baseline --no-ion --no-ti: /builds/slave/c-cen-t-lnx/build/objdir/mozilla/dist/bin/js: /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.9' not found (required by /builds/slave/c-cen-t-lnx/build/objdir/mozilla/dist/bin/js)
TEST-UNEXPECTED-FAIL | /builds/slave/c-cen-t-lnx/build/mozilla/js/src/jit-test/tests/bug793385.js | : /builds/slave/c-cen-t-lnx/build/objdir/mozilla/dist/bin/js: /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.9' not found (required by /builds/slave/c-cen-t-lnx/build/objdir/mozilla/dist/bin/js)
TEST-UNEXPECTED-FAIL | /builds/slave/c-cen-t-lnx/build/mozilla/js/src/jit-test/tests/bug793385.js | --ion-eager: /builds/slave/c-cen-t-lnx/build/objdir/mozilla/dist/bin/js: /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.9' not found (required by /builds/slave/c-cen-t-lnx/build/objdir/mozilla/dist/bin/js)
TEST-UNEXPECTED-FAIL | /builds/slave/c-cen-t-lnx/build/mozilla/js/src/jit-test/tests/bug793385.js | --baseline-eager --no-ti --no-fpu: /builds/slave/c-cen-t-lnx/build/objdir/mozilla/dist/bin/js: /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.9' not found (required by /builds/slave/c-cen-t-lnx/build/objdir/mozilla/dist/bin/js)
TEST-UNEXPECTED-FAIL | /builds/slave/c-cen-t-lnx/build/mozilla/js/src/jit-test/tests/bug793385.js | --baseline-eager: /builds/slave/c-cen-t-lnx/build/objdir/mozilla/dist/bin/js: /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.9' not found (required by /builds/slave/c-cen-t-lnx/build/objdir/mozilla/dist/bin/js)
TEST-UNEXPECTED-FAIL | /builds/slave/c-cen-t-lnx/build/mozilla/js/src/jit-test/tests/bug793385.js | --no-baseline --no-ion --no-ti: /builds/slave/c-cen-t-lnx/build/objdir/mozilla/dist/bin/js: /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.9' not found (required by /builds/slave/c-cen-t-lnx/build/objdir/mozilla/dist/bin/js)
TEST-UNEXPECTED-FAIL | /builds/slave/c-cen-t-lnx/build/mozilla/js/src/jit-test/tests/bug793385.js | --no-baseline --no-ion: /builds/slave/c-cen-t-lnx/build/objdir/mozilla/dist/bin/js: /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.9' not found (required by /builds/slave/c-cen-t-lnx/build/objdir/mozilla/dist/bin/js)
TEST-UNEXPECTED-FAIL | /builds/slave/c-cen-t-lnx/build/mozilla/js/src/jit-test/tests/bug825379.js | : /builds/slave/c-cen-t-lnx/build/objdir/mozilla/dist/bin/js: /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.9' not found (required by /builds/slave/c-cen-t-lnx/build/objdir/mozilla/dist/bin/js)
TEST-UNEXPECTED-FAIL | /builds/slave/c-cen-t-lnx/build/mozilla/js/src/jit-test/tests/bug825379.js | --ion-eager: /builds/slave/c-cen-t-lnx/build/objdir/mozilla/dist/bin/js: /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.9' not found (required by /builds/slave/c-cen-t-lnx/build/objdir/mozilla/dist/bin/js)

On IRC, tbsaunde suggested that it could be that we stopped building with
--enable-stdcxx-compat.
OS: Windows Vista → Linux
Attached patch bug fix. (v1) (obsolete) — Splinter Review
Assignee: nobody → ewong
Status: NEW → ASSIGNED
Attachment #789442 - Flags: review?(bugspam.Callek)
Attached patch bug fix (v2)Splinter Review
Attachment #789442 - Attachment is obsolete: true
Attachment #789442 - Flags: review?(bugspam.Callek)
Attachment #789450 - Flags: review?(bugspam.Callek)
Comment on attachment 789450 [details] [diff] [review]
bug fix (v2)

Review of attachment 789450 [details] [diff] [review]:
-----------------------------------------------------------------

This is not enough mozconfigs, (we have others under linux that will need this treatment) also I'm unsure if us doing a statically linked libstdc++ will mean this doesn't work.

Might as well land as is though and lets see!
Attachment #789450 - Flags: review?(bugspam.Callek) → review+
http://tbpl-dev.callek.net/php/getParsedLog.php?id=20795232&tree=SeaMonkey#error0

/usr/bin/ccache /tools/gcc-4.5/bin/gcc -o dummy dummy.o -lpthread -static-libstdc++ -Wl,-z,noexecstack -Wl,-z,text   -Wl,-rpath-link,/builds/slave/c-cen-t-lnx/build/objdir/mozilla/dist/bin -Wl,-rpath-link,/usr/local/lib 
gcc: unrecognized option '-static-libstdc++'
Ok, so SeaMonkey Linux mozconfig files manually added '-static-libstdc++' to the LDFLAGS. Originally this was done in Bug 599530 after installation of gcc 4.5.1 on the Linux buildboxen. If I understand this correctly Bug 559964 wanted(!) to add those flags to avoid runtime dependencies on libstdc++ 4.5. See Bug 559964 Comment 141 on that and the buildbot-config changes in that bug. I'm not sure since when --disable/enable-stdcxx-compat exists, but it's certainly the correct solution for us, too (ewong already checked in a patch that does that). So as far as I see this we can just remove our custom *LDFLAGS from the Linux mozconfig files. it was just a workaround that has been replaced by disable/enable-stdcxx-compat a long time ago in the Firefox builds. This avoids statically linking to libstdc++ and might reduce build size a bit (I think...).
Forgot one important sentence: Firefox people wanted to add -static-libstdc++ to their mozconfig files as well, but then used --disable/enable-stdcxx-compat instead as better workaround/fix.
This removes the -static-libstdc++ flag from the Linux mozconfig files. This flag was basically needed so that SeaMonkey ships with a statically linked libstdc++ to avoid runtime dependencies to this more-or-less new lib (well, not that new anymore). Anyway, these days this been replaced by the --enable-stdcxx-compat directive, originally introduced by Bug 643690 in April 2011. This one takes care of all runtime dependencies from gcc 4.2 up to including gcc 4.6.1 as I understand this (see http://mxr.mozilla.org/comm-central/source/mozilla/build/unix/stdc++compat/stdc++compat.cpp).
I'm going to check this in to fix the red, review for this is still wanted though.
Attachment #792433 - Flags: review?(bugspam.Callek)
Comment on attachment 792433 [details] [diff] [review]
Patch to fix Linux mozconfig files

Pushed as https://hg.mozilla.org/comm-central/rev/c2ca0b8f4be9
New build failure:
/builds/slave/c-cen-t-lnx/build/objdir/mozilla/build/unix/elfhack/elfhack -b -f test-array.so
/builds/slave/c-cen-t-lnx/build/objdir/mozilla/build/unix/elfhack/elfhack: /usr/lib/libstdc++.so.6: version `CXXABI_1.3.2' not found (required by /builds/slave/c-cen-t-lnx/build/objdir/mozilla/build/unix/elfhack/elfhack)
make[7]: *** [test-array.so] Error 1

Looks exactly like Bug 779192, fix should almost be the same. Note that I don't see why exporting the LD_LIBRARY_PATH inside mozconfig should not work. We must watch though if l10n builds work fine after that! It might be that the buildbot config change is needed after all because of the env vars (same problem as in Bug 902091 basically, l10n build process does not respect env vars from .mozconfig). But then, I have no idea what binaries exactly get executed by the l10n release/packaging process and if those are affected by this problem.
And also see Bug 800514, same error message, slightly different fix.
So this sets the LD_LIBRARY_PATH to /tools/gcc-4.5/lib for elfhack binary during build process. Lets see if this works, I've modified the nightly mozconfig files only for now.
Comment on attachment 792485 [details] [diff] [review]
Export correct LD_LIBRARY_PATH in Linux mozconfig

Pushed: https://hg.mozilla.org/comm-central/rev/e6f324a5b474

If it works, I'll request review, if not, I'll backout.
(In reply to Frank Wein [:mcsmurf] from comment #12)
> Comment on attachment 792485 [details] [diff] [review]
> Export correct LD_LIBRARY_PATH in Linux mozconfig
> 
> Pushed: https://hg.mozilla.org/comm-central/rev/e6f324a5b474
> 
> If it works, I'll request review, if not, I'll backout.

if it doesn't work, try disabling elfhack (I *think* disabling it will be safe for us, but I'd look closer when I can actually review)
IIRC, the main reason why we didn't switch to stdcxx-compat when it became available was because we didn't know if all of mailnews would be fine with just that subset/shim of the newer libstdc++ - if that works fine now, I'm surely happy with it!
Still getting:

# Fail if the library doesn't have INIT_ARRAY .dynamic info
readelf -d test-array.so | grep '(INIT_ARRAY)'
 0x00000019 (INIT_ARRAY)                 0x54c8
/builds/slave/c-cen-t-lnx/build/objdir/mozilla/build/unix/elfhack/elfhack -b -f test-array.so
/builds/slave/c-cen-t-lnx/build/objdir/mozilla/build/unix/elfhack/elfhack: /usr/lib/libstdc++.so.6: version `CXXABI_1.3.2' not found (required by /builds/slave/c-cen-t-lnx/build/objdir/mozilla/build/unix/elfhack/elfhack)
(In reply to Frank Wein [:mcsmurf] from comment #8)
> Created attachment 792433 [details] [diff] [review]
> Patch to fix Linux mozconfig files
> 
> This removes the -static-libstdc++ flag from the Linux mozconfig files.

I take it then that this will fix bug 754622? If yes we should make sure to document for which SM version this change will become effective.
(In reply to Robert Kaiser (:kairo@mozilla.com) from comment #14)
> IIRC, the main reason why we didn't switch to stdcxx-compat when it became
> available was because we didn't know if all of mailnews would be fine with
> just that subset/shim of the newer libstdc++ - if that works fine now, I'm
> surely happy with it!

Need to see what "works fine" in this case actually means ;) as in: Does it compile fine or do we also need to check if runtime dependencies changed? Anyway, we better check both then.
Attached patch buildbot config patch (obsolete) — Splinter Review
Ok, looks like "export LD_LIBRARY_PATH..." inside mozconfig was not enough. This needs fixing on the buildbot config level. ewong checked manually that this fixes execution of the elfhack binary. LD_LIBRARY_PATH adds an additional diretory to the library search path on Linux where applications check first if a needed library can be found in that directory.
Attachment #792485 - Attachment is obsolete: true
Attachment #792687 - Flags: review?(bugspam.Callek)
Attached patch Add LD_LIBRARY_PATH to env. (v1) (obsolete) — Splinter Review
Attachment #792688 - Flags: review?(bugspam.Callek)
Attachment #792688 - Attachment is obsolete: true
Attachment #792688 - Flags: review?(bugspam.Callek)
Comment on attachment 792485 [details] [diff] [review]
Export correct LD_LIBRARY_PATH in Linux mozconfig

Backed out this changeset again as it did not work: https://hg.mozilla.org/comm-central/rev/ad38da279eab
(In reply to Frank Wein [:mcsmurf] from comment #18)
> Created attachment 792687 [details] [diff] [review]
> buildbot config patch
> 
> Ok, looks like "export LD_LIBRARY_PATH..." inside mozconfig was not enough.
> This needs fixing on the buildbot config level. ewong checked manually that
> this fixes execution of the elfhack binary. LD_LIBRARY_PATH adds an
> additional diretory to the library search path on Linux where applications
> check first if a needed library can be found in that directory.

Can we actually try

 --disable-elf-hack

in mozconfig first, While it is useful I don't want to diverge as much from what MoCo buildbots use for now, also I'm not that sold that its needed based on moco buildbots not using it in their setup.

Per https://wiki.mozilla.org/Elfhack its just used for relocation ordering, which has a slight statrup perf win.
This disables elfhack for the normal Linux builds for now, we'll see what will happen.
Now we hit Bug 554854:
/builds/slave/c-cen-t-lnx/build/objdir/mozilla/dist/host/bin/dump_syms: /usr/lib/libstdc++.so.6: version `CXXABI_1.3.2' not found (required by /builds/slave/c-cen-t-lnx/build/objdir/mozilla/dist/host/bin/dump_syms)
/builds/slave/c-cen-t-lnx/build/objdir/mozilla/dist/host/bin/dump_syms: /usr/lib/libstdc++.so.6: version `CXXABI_1.3.2' not found (required by /builds/slave/c-cen-t-lnx/build/objdir/mozilla/dist/host/bin/dump_syms)
[...]

dump_msys requires the newer libs. Solution there was to hack the Makefile to statically link dump_msys (http://hg.mozilla.org/mozilla-central/rev/33d05f60932b), but this workaround has been backed out in 2012. So it looks like at least for the
========= Started 'make buildsymbols' failed (results: 2, elapsed: 14 secs) (at 2013-08-21 08:22:33.868450) ==========
step (this is where dump_msys is running), we must set LD_LIBRARY_PATH (or convince someone to include the Makefile hack again, quite unlikely that this will work).
Attached patch buildbotcustom patch (obsolete) — Splinter Review
Callek: I think this is as minimal as a buildbot-config/buildbotcustom patch can get for this (I hope I patched the correct file).
Attachment #792687 - Attachment is obsolete: true
Attachment #792687 - Flags: review?(bugspam.Callek)
Attachment #793546 - Flags: review?(bugspam.Callek)
Comment on attachment 793546 [details] [diff] [review]
buildbotcustom patch

I like the first buildbot patch better if you think it should work
Attachment #793546 - Flags: review?(bugspam.Callek) → review-
Ok, back to the buildbot config patch again :D I fixed the library path for Linux64, as the path ends with "lib64" there. If you like this patch better, then I'll backout the "disable elfhack" patch again and check this patch in.
Attachment #793546 - Attachment is obsolete: true
Attachment #793581 - Flags: review?(bugspam.Callek)
Comment on attachment 793581 [details] [diff] [review]
buildbot config patch

check this in, I'll do a reconfig, then after that we can consider backing out the elfhack disable. (since we'll need to trigger new jobs after I reconfig buildbot anyway)
Attachment #793581 - Flags: review?(bugspam.Callek) → review+
http://tbpl-dev.callek.net/php/getParsedLog.php?id=20796272&tree=SeaMonkey#error0

25152: Worker processing files: ('dist/bin/components/libnkgnomevfs.so',)
/builds/slave/c-cen-t-lnx64/build/objdir/mozilla/dist/host/bin/dump_syms: /usr/lib64/libstdc++.so.6: version `CXXABI_1.3.2' not found (required by /builds/slave/c-cen-t-lnx64/build/objdir/mozilla/dist/host/bin/dump_syms)
25140: Submitting jobs for files: ('dist/bin/components/libsuite.so',)
25152: Worker processing files: ('dist/bin/components/libsuite.so',)
/builds/slave/c-cen-t-lnx64/build/objdir/mozilla/dist/host/bin/dump_syms: /usr/lib64/libstdc++.so.6: version `CXXABI_1.3.2' not found (required by /builds/slave/c-cen-t-lnx64/build/objdir/mozilla/dist/host/bin/dump_syms)
make[1]: *** [buildsymbols] Error 1
Updated and reconfig'd the master.
Assignee: ewong → bugzilla
Comment on attachment 793485 [details] [diff] [review]
Patch to disable elfhack

Backed this patch out again in this changeset: https://hg.mozilla.org/comm-central/rev/8b078f2215c3
I've checked on an old Ubuntu 7.10 system that a current Linux tinderbox build still runs fine against libstdc++6 4.2.1 (that's quite old..). I did some basic testing, like browsing, fetching mails, using chatzilla, everything was fine (though this was only a short test). It also works fine in a short test on a Ubuntu 10.04 LTS system (libstdc++ 4.4.3).
Blocks: 754622
Comment on attachment 792433 [details] [diff] [review]
Patch to fix Linux mozconfig files

Review of attachment 792433 [details] [diff] [review]:
-----------------------------------------------------------------

post-landing r+
Attachment #792433 - Flags: review?(bugspam.Callek) → review+
Comment on attachment 789450 [details] [diff] [review]
bug fix (v2)

[Approval Request Comment]
Regression caused by (bug #): -
User impact if declined: Broken Sun Java plugin on Linux due to static libstdc++
Testing completed (on m-c, etc.): Works fine on comm-central, backed for a few weeks, no complains so far
Risk to taking this patch (and alternatives if risky): Some risk, but in the end this will end up on release branch anyway :)
String changes made by this patch: -
Attachment #789450 - Flags: approval-comm-aurora?
Comment on attachment 792433 [details] [diff] [review]
Patch to fix Linux mozconfig files

[Approval Request Comment]
Regression caused by (bug #): -
User impact if declined: Broken Sun Java plugin on Linux due to static libstdc++
Testing completed (on m-c, etc.): Works fine on comm-central, backed for a few weeks, no complains so far
Risk to taking this patch (and alternatives if risky): Some risk, but in the end this will end up on release branch anyway :)
String changes made by this patch: -
Attachment #792433 - Flags: approval-comm-aurora?
(In reply to Frank Wein [:mcsmurf] from comment #36)
> Comment on attachment 792433 [details] [diff] [review]
> Patch to fix Linux mozconfig files
> 
> [Approval Request Comment]
> Regression caused by (bug #): -
> User impact if declined: Broken Sun Java plugin on Linux due to static
> libstdc++
> Testing completed (on m-c, etc.): Works fine on comm-central, backed for a
> few weeks, no complains so far
> Risk to taking this patch (and alternatives if risky): Some risk, but in the
> end this will end up on release branch anyway :)
> String changes made by this patch: -

rs=me a=me CLOSED TREE
Attachment #789450 - Flags: approval-comm-aurora? → approval-comm-aurora+
Attachment #792433 - Flags: approval-comm-aurora? → approval-comm-aurora+
Everything should now be fixed.
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → seamonkey2.23
Depends on: 937035
You need to log in before you can comment on or make changes to this bug.