Last Comment Bug 748739 - Make AddressSanitizer work with --enable-stdcxx-compat and gcc >= 4.5
: Make AddressSanitizer work with --enable-stdcxx-compat and gcc >= 4.5
Status: RESOLVED FIXED
[sg:want][asan-build-blocker]
:
Product: Core
Classification: Components
Component: Build Config (show other bugs)
: Trunk
: All Linux
: -- normal (vote)
: mozilla15
Assigned To: Mike Hommey [:glandium]
:
Mentors:
Depends on:
Blocks: 664901
  Show dependency treegraph
 
Reported: 2012-04-25 06:05 PDT by Christian Holler (:decoder)
Modified: 2012-04-30 08:12 PDT (History)
9 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Link stdc++compat as a static library, and always link it when STDCXX_COMPAT is enabled (11.62 KB, patch)
2012-04-25 14:21 PDT, Mike Hommey [:glandium]
no flags Details | Diff | Splinter Review
Link stdc++compat as a static library, and always link it when STDCXX_COMPAT is enabled (11.64 KB, patch)
2012-04-26 06:35 PDT, Mike Hommey [:glandium]
ted: review+
Details | Diff | Splinter Review

Description Christian Holler (:decoder) 2012-04-25 06:05:50 PDT
When building with --enable-stdcxx-compat (required on the linux slaves with Clang it seems), I get the following error when building with AddressSanitizer support:


TEST-UNEXPECTED-FAIL | | We don't want these libstdc++ symbols to be used:
0000000000000000      DF *UND*	0000000000000000  GLIBCXX_3.4.14 _ZNSsC1EOSs
0000000000000000      DF *UND*	0000000000000000  GLIBCXX_3.4.14 _ZNSsaSEOSs
make[6]: *** [ssltunnel] Error 1
make[6]: *** Deleting file `ssltunnel'
make[5]: *** [libs] Error 2
make[6]: Leaving directory `/builds/slave/try-lnx64-dbg/build/obj-firefox/testing/mochitest/ssltunnel'


Glandium explained me that this is due to stdc++compat.cpp being opt-in. However, the AddressSanitizer runtime library itself is written in C++ and seems to pull in dependencies that make it a requirement to have stdc++compat.cpp everywhere.
Comment 1 Mike Hommey [:glandium] 2012-04-25 14:21:56 PDT
Created attachment 618436 [details] [diff] [review]
Link stdc++compat as a static library, and always link it when STDCXX_COMPAT is enabled

Try build:
https://tbpl.mozilla.org/?tree=Try&rev=735716659700

(STDCXX_COMPAT is only enabled on linux and mac)

This ensures we don't have any more surprise with random binaries requiring
stdc++compat to be linked to it. And linking as a static library ensures that
it's actually not included unless it's used (since the linker discards unused
object files from static libraries)
Comment 2 Mike Hommey [:glandium] 2012-04-26 06:35:59 PDT
Created attachment 618637 [details] [diff] [review]
Link stdc++compat as a static library, and always link it when STDCXX_COMPAT is enabled

Missing an ifdef in build/unix/Makefile.in
Comment 3 Ted Mielczarek [:ted.mielczarek] 2012-04-27 05:47:54 PDT
Comment on attachment 618637 [details] [diff] [review]
Link stdc++compat as a static library, and always link it when STDCXX_COMPAT is enabled

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

::: toolkit/crashreporter/google-breakpad/src/tools/linux/dump_syms/Makefile.in
@@ -62,5 @@
>  CPP_PROG_LINK = 1
>  
> -#XXX: bug 554854 causes us to be unable to run binaries on the build slaves
> -# due to them having an older libstdc++
> -HOST_LDFLAGS += -static

Nice, I was just thinking we could remove this before I got to this diff hunk!
Comment 5 Mike Hommey [:glandium] 2012-04-30 01:21:32 PDT
Fixup for Linux PGO bustage:
https://hg.mozilla.org/integration/mozilla-inbound/rev/5b2cef6c4c34

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