Last Comment Bug 650467 - Build failure with LDFLAGS=-static-libstdc++
: Build failure with LDFLAGS=-static-libstdc++
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Build Config (show other bugs)
: Trunk
: All Linux
: -- normal (vote)
: mozilla6
Assigned To: Mike Hommey [:glandium]
:
:
Mentors:
Depends on:
Blocks: 643690 1294157
  Show dependency treegraph
 
Reported: 2011-04-16 00:50 PDT by Mike Hommey [:glandium]
Modified: 2016-08-10 10:40 PDT (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Disable libstdc++ compatibility hack when -static-libstdc++ is used or when the C++ compiler is not gcc (795 bytes, patch)
2011-04-16 00:50 PDT, Mike Hommey [:glandium]
no flags Details | Diff | Splinter Review
Alternative: make libstdc++ compatibility opt-in instead of opt-out (1.02 KB, patch)
2011-04-16 03:07 PDT, Mike Hommey [:glandium]
khuey: review+
Details | Diff | Splinter Review

Description Mike Hommey [:glandium] 2011-04-16 00:50:10 PDT
Created attachment 526463 [details] [diff] [review]
Disable libstdc++ compatibility hack when -static-libstdc++ is used or when the C++ compiler is not gcc

The flag is used on c-c, aiui, and leads to:
/tools/gcc-4.5/lib/gcc/i686-pc-linux-gnu/4.5.1/../../../libstdc++.a(ctype.o): In function `std::ctype<char>::_M_widen_init() const':
(.text._ZNKSt5ctypeIcE13_M_widen_initEv+0x0): multiple definition of `std::ctype<char>::_M_widen_init() const'
host_stdc++compat.o:/builds/slave/comm-cen-trunk-lnx/build/mozilla/build/stdc++compat.cpp:111: first defined here
/usr/bin/ld: Warning: size of symbol `std::ctype<char>::_M_widen_init() const' changed from 1 in host_stdc++compat.o to 176 in /tools/gcc-4.5/lib/gcc/i686-pc-linux-gnu/4.5.1/../../../libstdc++.a(ctype.o)

While the flag can now be removed, because what it was used for is gone with bug 643690, other people may be using it as well and it's probably safer to disable our libstdc++ compatibility hack when it's used.

I also added another auto-disable when the C++ compiler is not gcc.
Comment 1 Mike Hommey [:glandium] 2011-04-16 02:41:58 PDT
I'm starting to wonder if it wouldn't be better to invert the libstdc++ compatibility hack setup in configure, and make it opt-in instead of opt-out
Comment 2 Mike Hommey [:glandium] 2011-04-16 03:07:26 PDT
Created attachment 526477 [details] [diff] [review]
Alternative: make libstdc++ compatibility opt-in instead of opt-out

I'm tempted to say it's better this way, since this is really only a constraint for our (Mozilla) builds, which thus needs to be addressed in our mozconfigs.
Comment 3 Kyle Huey [:khuey] (Exited; not receiving bugmail, email if necessary) 2011-04-16 08:39:02 PDT
Comment on attachment 526477 [details] [diff] [review]
Alternative: make libstdc++ compatibility opt-in instead of opt-out

I think I like this approach more.  r=me
Comment 4 Mike Hommey [:glandium] 2011-04-16 09:00:54 PDT
http://hg.mozilla.org/mozilla-central/rev/98094f3afb93

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