[Bug sanitizer/55599] switch from mach_override to mac interpose function support in libasan broke -static-libasan
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55599 Jack Howarth howarth at nitro dot med.uc.edu changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution||FIXED --- Comment #7 from Jack Howarth howarth at nitro dot med.uc.edu 2012-12-08 19:06:24 UTC --- Fixed' with... r194257 | kcc | 2012-12-06 09:49:44 -0500 (Thu, 06 Dec 2012) | 1 line Fix PR55599/sanitizer by disabling static libasan on darwin
[Bug sanitizer/55599] switch from mach_override to mac interpose function support in libasan broke -static-libasan
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55599 --- Comment #1 from Jack Howarth howarth at nitro dot med.uc.edu 2012-12-05 00:07:04 UTC --- I assume that the mechanism for mac function imposition prohibits the use of a static libasan? If so we should remove the support for -static-libasan from gcc/config/darwin.h.
[Bug sanitizer/55599] switch from mach_override to mac interpose function support in libasan broke -static-libasan
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55599 --- Comment #2 from Alexander Potapenko glider at google dot com 2012-12-05 01:07:36 UTC --- Not that it prohibits the use of static ASan, they just currently can't coexist in a single program with the current setup. It is theoretically possible to have them both, although we definitely do not want to. I'm guessing that the link problems have been caused by the removal of mach_override from the tree.
[Bug sanitizer/55599] switch from mach_override to mac interpose function support in libasan broke -static-libasan
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55599 --- Comment #3 from Jack Howarth howarth at nitro dot med.uc.edu 2012-12-05 03:46:59 UTC --- I suspect that for the FSF gcc build, the static libasan library has identical code to that in the dynamic libasan but compiled as a static library. FSF gcc wouldn't know to do any tricks like building the dynamic libasan with mac function imposition code and static libasan with mach_override code. I am still unclear if the mac function imposition method itself requires a shared library to be used for the libasan code. If that is in fact the case, we likely won't have functional static libasan support on darwin since mach_override will eventually be deprecated, no?
[Bug sanitizer/55599] switch from mach_override to mac interpose function support in libasan broke -static-libasan
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55599 --- Comment #4 from Kostya Serebryany kcc at gcc dot gnu.org 2012-12-05 04:01:41 UTC --- the interpose thing can not be linked statically, afaict. So, let's just drop -static-libasan from darwin.
[Bug sanitizer/55599] switch from mach_override to mac interpose function support in libasan broke -static-libasan
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55599 --- Comment #5 from Alexander Potapenko glider at google dot com 2012-12-05 04:50:43 UTC --- The dynamic interposition library is based on the __DATA,__interpose dyld feature (see http://toves.freeshell.org/interpose/ or Amit Singh's Mac OS X Internals book), which strictly requires the interposing functions to be in a shared library that must be preloaded using DYLD_INSERT_LIBRARIES (ASan does that automatically in __asan_init) The dynamic library doesn't require the mach_override code (we don't link it in LLVM), but the static one does. Since you have removed the mach_override code, it's time to drop the static library support (note that in LLVM the static runtime library is still the default one, because it's now the one that simply works)
[Bug sanitizer/55599] switch from mach_override to mac interpose function support in libasan broke -static-libasan
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55599 --- Comment #6 from Kostya Serebryany kcc at gcc dot gnu.org 2012-12-05 06:10:31 UTC --- note that in LLVM the static runtime library is still the default one, because it's now the one that simply works But once we switch to interpose (soon, hopefully) mach_override will be gone from LLVM too.