Make AddressSanitizer work with --enable-stdcxx-compat and gcc >= 4.5

RESOLVED FIXED in mozilla15

Status

()

Core
Build Config
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: decoder, Assigned: glandium)

Tracking

Trunk
mozilla15
All
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [sg:want][asan-build-blocker])

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

5 years ago
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.
(Assignee)

Updated

5 years ago
Assignee: nobody → mh+mozilla
(Assignee)

Comment 1

5 years ago
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)
Attachment #618436 - Flags: review?(ted.mielczarek)
(Assignee)

Comment 2

5 years ago
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
Attachment #618637 - Flags: review?(ted.mielczarek)
(Assignee)

Updated

5 years ago
Attachment #618436 - Attachment is obsolete: true
Attachment #618436 - Flags: review?(ted.mielczarek)
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!
Attachment #618637 - Flags: review?(ted.mielczarek) → review+
(Assignee)

Comment 4

5 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/93c2ecbcde04
Target Milestone: --- → mozilla15
(Assignee)

Comment 5

5 years ago
Fixup for Linux PGO bustage:
https://hg.mozilla.org/integration/mozilla-inbound/rev/5b2cef6c4c34
(Reporter)

Updated

5 years ago
Whiteboard: [sg:want][asan-build-blocker]
https://hg.mozilla.org/mozilla-central/rev/93c2ecbcde04
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
https://hg.mozilla.org/mozilla-central/rev/5b2cef6c4c34
You need to log in before you can comment on or make changes to this bug.