Closed Bug 936790 Opened 11 years ago Closed 11 years ago

(gcc 4.5) Build error: "We don't want these libstdc++ symbols to be used" when building with --enable-stdcxx-compat and WebRTC

Categories

(Firefox Build System :: General, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(firefox28 fixed, firefox29 fixed)

RESOLVED FIXED
mozilla29
Tracking Status
firefox28 --- fixed
firefox29 --- fixed

People

(Reporter: wgianopoulos, Assigned: mcsmurf)

References

Details

(Keywords: regression, Whiteboard: [qa-])

Attachments

(1 file)

Error is:

TEST-UNEXPECTED-FAIL | | We don't want these libstdc++ symbols to be used:
0000000000000000      DF *UND*  0000000000000000  GLIBCXX_3.4.14 _ZNSt15_List_node_base10_M_reverseEv
make[5]: *** [libxul.so] Error 1
make[5]: *** Deleting file `libxul.so'
make[5]: Leaving directory `/home/wag/mozilla/mozilla2/fx-obj/toolkit/library'
make[4]: *** [toolkit/library/libs] Error 2
make[4]: Leaving directory `/home/wag/mozilla/mozilla2/fx-obj'
make[3]: *** [libs] Error 2
make[3]: Leaving directory `/home/wag/mozilla/mozilla2/fx-obj'
make[2]: *** [default] Error 2
make[2]: Leaving directory `/home/wag/mozilla/mozilla2/fx-obj'
make[1]: *** [realbuild] Error 2
make[1]: Leaving directory `/home/wag/mozilla/mozilla2'
make: *** [build] Error 2

I will add more information when I determine the regressor.
Severity: normal → blocker
Summary: Yet another gcc 4.5 build issue → Yet another gcc 4.5 build issue - We don't want these libstdc++ symbols to be used
It appears this is intentional.  The latest version of Webrtc provided by bug 932112 seems to require GCC 4.6 or later.  It would be nice if this were checked for in configure instead of failing at the final link stage of the build.

I am trying a clobber build with --disable-webrtc to make sure this actually avoids the issue.
Severity: blocker → normal
Blocks: 932112
Summary: Yet another gcc 4.5 build issue - We don't want these libstdc++ symbols to be used → gcc 4.5 - We don't want these libstdc++ symbols to be used - building with webrtc
Building with --disable-webrtc is sufficient to avoid this issue.
Glandium: any easy way to avoid this for 4.5 (variant on the patch you did?)  

Sorry about the 4.5 issue; no easy to to notice that ahead of time.  I'll try to ping you on the next import so you can try the patch ahead of time.
Flags: needinfo?(mh+mozilla)
https://hg.mozilla.org/mozilla-central/rev/03701a9c0f82 should have taken care of this. And if that was really a problem that would fail on tbpl too. What tree have you been using?
Flags: needinfo?(mh+mozilla)
(In reply to Bill Gianopoulos [:WG9s] from comment #2)
> I updated
> https://developer.mozilla.org/en-US/docs/Developer_Guide/Build_Instructions/
> Linux_Prerequisites with that info.

You shouldn't have. Also, the only reason you're hitting this is because you're building with --enable-stdcxx-compat. Which is not the default for local builds.
(In reply to Mike Hommey [:glandium] from comment #6)

> You shouldn't have. Also, the only reason you're hitting this is because
> you're building with --enable-stdcxx-compat. Which is not the default for
> local builds.

I realize that I would not get this particualr error if I did not specify --enable-stdcxx-compat.  However, would the webrtc code that calls these functions actually work correctly on such a configuration?
(In reply to Bill Gianopoulos [:WG9s] from comment #7)
> I realize that I would not get this particualr error if I did not specify
> --enable-stdcxx-compat.  However, would the webrtc code that calls these
> functions actually work correctly on such a configuration?

Yes, the only thing is that if you then copy your build on a system with an older libstdc++, it won't work. That's all.
(In reply to Mike Hommey [:glandium] from comment #8)
> (In reply to Bill Gianopoulos [:WG9s] from comment #7)
> > I realize that I would not get this particualr error if I did not specify
> > --enable-stdcxx-compat.  However, would the webrtc code that calls these
> > functions actually work correctly on such a configuration?
> 
> Yes, the only thing is that if you then copy your build on a system with an
> older libstdc++, it won't work. That's all.

Well, as it turns out, building with webrtc enabled and stdcxx-comat disabled results in this error.

/home/wag/mozilla/mozilla2/media/webrtc/trunk/testing/gtest/include/gtest/gtest.h:1532:136: error: ISO C++ forbids comparison between pointer and integer
make[5]: *** [rlogringbuffer_unittest.o] Error 1
make[5]: Leaving directory `/home/wag/mozilla/mozilla2/fx-obj/media/mtransport/test'
make[4]: *** [media/mtransport/test/compile] Error 2
make[4]: *** Waiting for unfinished jobs....
make[5]: Leaving directory `/home/wag/mozilla/mozilla2/fx-obj/webapprt/gtk2'
make[4]: Leaving directory `/home/wag/mozilla/mozilla2/fx-obj'
make[3]: *** [compile] Error 2
make[3]: Leaving directory `/home/wag/mozilla/mozilla2/fx-obj'
which is unrelated and would need its own bug.
But still would seem an advisory not to use gcc 4.5 to build with webrtc enabled is warranted.
(In reply to Bill Gianopoulos [:WG9s] from comment #11)
> But still would seem an advisory not to use gcc 4.5 to build with webrtc
> enabled is warranted.

No, it would if it stayed that way long enough.
(In reply to Mike Hommey [:glandium] from comment #10)
> which is unrelated and would need its own bug.

I filed Bug 938092.
(In reply to Mike Hommey [:glandium] from comment #6)
> (In reply to Bill Gianopoulos [:WG9s] from comment #2)
> > I updated
> > https://developer.mozilla.org/en-US/docs/Developer_Guide/Build_Instructions/
> > Linux_Prerequisites with that info.
> 
> You shouldn't have. Also, the only reason you're hitting this is because
> you're building with --enable-stdcxx-compat. Which is not the default for
> local builds.

I should note, this is the configuration used by SeaMonkey as well, and this bug is what is causing our aurora to be busted on linux atm.

We will likely disable WebRTC in the meantime, but would be nice if there was a workaround.
Component: General → Build Config
Product: Firefox → Core
Blocks: 952883
I can reproduce this in some way locally with gcc 4.5, so quite likely a version specific problem (cannot reproduce with gcc 4.8.1), my build fails earlier though:
11:54.53 libnptest.so
11:54.60 TEST-UNEXPECTED-FAIL | | We do not want these libstdc++ symbols to be used:
11:54.61 0000000000000000      DF *UND* 0000000000000000  GLIBCXX_3.4.14 _ZNSt15_List_node_base9_M_unhookEv
11:54.61 0000000000000000      DF *UND* 0000000000000000  GLIBCXX_3.4.14 _ZNSt15_List_node_base7_M_hookEPS_
11:54.62 0000000000000000      DF *UND* 0000000000000000  GLIBCXX_3.4.14 _ZNSt15_List_node_base11_M_transferEPS_S0_

(not sure why). Related vars from mozilla/config.status:
    (''' MOZ_LIBSTDCXX_TARGET_VERSION ''', r''' 197651 '''),
    (''' MOZ_LIBSTDCXX_HOST_VERSION ''', r''' 197651 '''),
Maybe I should file a second bug for this though, just tell me.
Maybe the problem is that the _M_* symbols are now inside the detail namespace since gcc and glibc 4.6? "ldd libstdc++compat.a" gives:
000000000000006e T _ZNSt8__detail15_List_node_base10_M_reverseEv
0000000000000062 T _ZNSt8__detail15_List_node_base11_M_transferEPS0_S1_
0000000000000068 T _ZNSt8__detail15_List_node_base4swapERS0_S1_
0000000000000056 T _ZNSt8__detail15_List_node_base7_M_hookEPS0_
000000000000005c T _ZNSt8__detail15_List_node_base9_M_unhookEv

So the stdc++compat.cpp file is doing the wrong thing when the gcc compiler version is older than/does not match the libstdc++.so file used by -lstdc++? I checked: On my system libstdc++.so in the /usr/lib/ gcc 4.5.3 folder just symlinks to /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.18 which is the gcc 4.8 version (installed from official Ubuntu package system). Anyway, I probably cannot fix this, I don't know enough about this :)
So, to get back to the original problem from Comment 0 and Comment 14 (ignore Comment 15 to 17 for now): This Linux build box uses libstdc++ 3.4.14 looks like: "-DMOZ_LIBSTDCXX_VERSION=197646". The _M_reverse deceleration in stdc++compat.cpp is inside the 3.4.15 block though:
#if MOZ_LIBSTDCXX_VERSION >= GLIBCXX_VERSION(3, 4, 15)
[...]
void _M_reverse() throw();
#endif

So the _M_reverse (and also the reverse deceleration?) need to get moved above that ifdef so that it gets included in the 3.4.14 section I think.
Attached patch Patch?Splinter Review
Feel free to redirect the review request to someone else, not sure how busy you are with the existing requests.

So, I think this patch should fix the issue, but I'm not that familiar with this area of code. According to "readelf -Ws  libstdc++.so.6.0.18|awk '{print $8}'" the (relevant) symbols for reverse are:
_ZNSt15_List_node_base7reverseEv@@GLIBCXX_3.4
_ZNSt15_List_node_base10_M_reverseEv@@GLIBCXX_3.4.14
_ZNSt8__detail15_List_node_base10_M_reverseEv@@GLIBCXX_3.4.15

I've tested it on try linux32/64 with mochitest-1 as I was not sure if build-only does a runtime/startup test.

Merry Christmas everyone! :)
Attachment #8351375 - Flags: review?(mh+mozilla)
Summary: gcc 4.5 - We don't want these libstdc++ symbols to be used - building with webrtc → (gcc 4.5) Build error: "We don't want these libstdc++ symbols to be used" when building with --enable-stdcxx-compat and WebRTC
Version: 28 Branch → Trunk
Attachment #8351375 - Flags: review?(mh+mozilla) → review+
Assignee: nobody → bugzilla
Pushed: https://hg.mozilla.org/integration/mozilla-inbound/rev/d706ebf6e5b1
Whiteboard: [leave open]
Target Milestone: --- → mozilla29
Comment on attachment 8351375 [details] [diff] [review]
Patch?

[Approval Request Comment]
Bug caused by (feature/regressing bug #): Bug 932112
User impact if declined: Affects developers only (compile failure with Linux gcc 4.5)
Testing completed (on m-c, etc.): Works fine on mozilla-central
Risk to taking this patch (and alternatives if risky): Almost no risk, this code has already been tested for a while for newer Linux gcc compilers, now this code also gets used for an older version of gcc
String or IDL/UUID changes made by this patch: -
Attachment #8351375 - Flags: approval-mozilla-aurora?
Attachment #8351375 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Pushed: https://hg.mozilla.org/releases/mozilla-aurora/rev/c1a8d1aee8e8
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Whiteboard: [leave open]
Whiteboard: [qa-]
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: