Closed Bug 748739 Opened 12 years ago Closed 12 years ago

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

Categories

(Firefox Build System :: General, defect)

All
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla15

People

(Reporter: decoder, Assigned: glandium)

References

(Blocks 1 open bug)

Details

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

Attachments

(1 file, 1 obsolete file)

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: nobody → mh+mozilla
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)
Missing an ifdef in build/unix/Makefile.in
Attachment #618637 - Flags: review?(ted.mielczarek)
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+
Whiteboard: [sg:want][asan-build-blocker]
https://hg.mozilla.org/mozilla-central/rev/93c2ecbcde04
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.