diff mbox

Fix PR55599/sanitizer by disabling static libasan on darwin

Message ID 20121205184312.GA20405@bromo.med.uc.edu
State New
Headers show

Commit Message

Jack Howarth Dec. 5, 2012, 6:43 p.m. UTC
The transition of libasan on darwin from using mach_override to the replacement mac function
imposition code results in a non-functional static libasan (PR55599). The method now used needs a
dynamic shared library and retaining a static libasan would require restoring the deprecated 
and unsupported mach_override code. The attached patch sets enable_static=no for darwin
in libsanitizer/configure.ac and removes the static libasan support in gcc/config/darwin.h.
Bootstrap and regression tested with asan.exp on x86_64-apple-darwin12. Okay for gcc
trunk?
        Jack
gcc/

2012-12-05  Jack Howarth <howarth@bromo.med.uc.edu>

	PR 55599/sanitizer
        * config/darwin.h (LINK_COMMAND_SPEC_A): Remove static libasan support.

libsanitizer/

2012-12-05  Jack Howarth <howarth@bromo.med.uc.edu>

	PR 55599/sanitizer
        * configure.ac: Set enable_static=no on darwin.
        * configure: Regenerated.

Comments

Mike Stump Dec. 5, 2012, 9:23 p.m. UTC | #1
On Dec 5, 2012, at 10:43 AM, Jack Howarth <howarth@bromo.med.uc.edu> wrote:
>   The transition of libasan on darwin from using mach_override to the replacement mac function
> imposition code results in a non-functional static libasan (PR55599).

Ok unless the asan people have a better idea...
Alexander Potapenko Dec. 6, 2012, 6:38 a.m. UTC | #2
In fact nothing prevents GCC from having a linkable static ASan runtime.
The reason for the static library being unusable is not in the dynamic
runtime itself, but in mach_override not working well with other GCC
libraries (it is unable to parse some function prologues). Because
ASan is transitioning to the dynamic runtime in LLVM, it's unlikely
we'll put any effort into fixing mach_override.

On Thu, Dec 6, 2012 at 1:23 AM, Mike Stump <mikestump@comcast.net> wrote:
> On Dec 5, 2012, at 10:43 AM, Jack Howarth <howarth@bromo.med.uc.edu> wrote:
>>   The transition of libasan on darwin from using mach_override to the replacement mac function
>> imposition code results in a non-functional static libasan (PR55599).
>
> Ok unless the asan people have a better idea...
Konstantin Serebryany Dec. 6, 2012, 8:04 a.m. UTC | #3
On Thu, Dec 6, 2012 at 10:38 AM, Alexander Potapenko <glider@google.com> wrote:
> In fact nothing prevents GCC from having a linkable static ASan runtime.

Except (as Alex mentions) we are not going to support it.
I'll apply this patch later (~today).

--kcc

> The reason for the static library being unusable is not in the dynamic
> runtime itself, but in mach_override not working well with other GCC
> libraries (it is unable to parse some function prologues). Because
> ASan is transitioning to the dynamic runtime in LLVM, it's unlikely
> we'll put any effort into fixing mach_override.
>
> On Thu, Dec 6, 2012 at 1:23 AM, Mike Stump <mikestump@comcast.net> wrote:
>> On Dec 5, 2012, at 10:43 AM, Jack Howarth <howarth@bromo.med.uc.edu> wrote:
>>>   The transition of libasan on darwin from using mach_override to the replacement mac function
>>> imposition code results in a non-functional static libasan (PR55599).
>>
>> Ok unless the asan people have a better idea...
>
>
>
> --
> Alexander Potapenko
> Software Engineer
> Google Moscow
Konstantin Serebryany Dec. 6, 2012, 2:50 p.m. UTC | #4
Done, r194257.

On Thu, Dec 6, 2012 at 12:04 PM, Konstantin Serebryany
<konstantin.s.serebryany@gmail.com> wrote:
> On Thu, Dec 6, 2012 at 10:38 AM, Alexander Potapenko <glider@google.com> wrote:
>> In fact nothing prevents GCC from having a linkable static ASan runtime.
>
> Except (as Alex mentions) we are not going to support it.
> I'll apply this patch later (~today).
>
> --kcc
>
>> The reason for the static library being unusable is not in the dynamic
>> runtime itself, but in mach_override not working well with other GCC
>> libraries (it is unable to parse some function prologues). Because
>> ASan is transitioning to the dynamic runtime in LLVM, it's unlikely
>> we'll put any effort into fixing mach_override.
>>
>> On Thu, Dec 6, 2012 at 1:23 AM, Mike Stump <mikestump@comcast.net> wrote:
>>> On Dec 5, 2012, at 10:43 AM, Jack Howarth <howarth@bromo.med.uc.edu> wrote:
>>>>   The transition of libasan on darwin from using mach_override to the replacement mac function
>>>> imposition code results in a non-functional static libasan (PR55599).
>>>
>>> Ok unless the asan people have a better idea...
>>
>>
>>
>> --
>> Alexander Potapenko
>> Software Engineer
>> Google Moscow
diff mbox

Patch

Index: libsanitizer/configure.ac
===================================================================
--- libsanitizer/configure.ac	(revision 194225)
+++ libsanitizer/configure.ac	(working copy)
@@ -81,7 +81,7 @@  unset TSAN_SUPPORTED
 AM_CONDITIONAL(TSAN_SUPPORTED, [test "x$TSAN_SUPPORTED" = "xyes"])
 
 case "$host" in
-  *-*-darwin*) MAC_INTERPOSE=true ;;
+  *-*-darwin*) MAC_INTERPOSE=true ; enable_static=no ;;
   *) MAC_INTERPOSE=false ;;
 esac
 AM_CONDITIONAL(USING_MAC_INTERPOSE, $MAC_INTERPOSE)
Index: gcc/config/darwin.h
===================================================================
--- gcc/config/darwin.h	(revision 194224)
+++ gcc/config/darwin.h	(working copy)
@@ -180,9 +180,7 @@  extern GTY(()) int darwin_ms_struct;
     %{L*} %(link_libgcc) %o %{fprofile-arcs|fprofile-generate*|coverage:-lgcov} \
     %{fopenmp|ftree-parallelize-loops=*: \
       %{static|static-libgcc|static-libstdc++|static-libgfortran: libgomp.a%s; : -lgomp } } \
-    %{fsanitize=address: \
-      %{static|static-libasan|static-libgcc|static-libgfortran: -framework CoreFoundation -lstdc++ libasan.a%s; \
-      static-libstdc++: -framework CoreFoundation libstdc++.a%s libasan.a%s; : -framework CoreFoundation -lasan } } \
+    %{fsanitize=address: -framework CoreFoundation -lasan } \
     %{fgnu-tm: \
       %{static|static-libgcc|static-libstdc++|static-libgfortran: libitm.a%s; : -litm } } \
     %{!nostdlib:%{!nodefaultlibs:\