<br><br><div class="gmail_quote">On Mon, Dec 5, 2011 at 9:41 AM, Alexander Potapenko <span dir="ltr"><<a href="mailto:glider@google.com">glider@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
The problem here is that now asan_rtl is linked to every binary built<br>
with ASan, even with a dynamic lib.<br>
I'll send a patch to fix this.<br></blockquote><div>Another way to fix it is to get rid of libstd++ dependency completely. I am very close to it. </div><div><br></div><div>--kcc  </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div class="HOEnZb"><div class="h5"><br>
On Fri, Dec 2, 2011 at 8:49 PM, Kostya Serebryany <<a href="mailto:kcc@google.com">kcc@google.com</a>> wrote:<br>
><br>
><br>
> On Thu, Dec 1, 2011 at 11:52 PM, Alexander Potapenko <<a href="mailto:glider@google.com">glider@google.com</a>><br>
> wrote:<br>
>><br>
>> On Fri, Dec 2, 2011 at 3:40 AM, Daniel Dunbar <<a href="mailto:daniel@zuster.org">daniel@zuster.org</a>> wrote:<br>
>> > Author: ddunbar<br>
>> > Date: Thu Dec  1 17:40:18 2011<br>
>> > New Revision: 145651<br>
>> ><br>
>> > URL: <a href="http://llvm.org/viewvc/llvm-project?rev=145651&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=145651&view=rev</a><br>
>> > Log:<br>
>> > Driver/Darwin: Add ASAN runtime library link support.<br>
>> ><br>
>> > Modified:<br>
>> >    cfe/trunk/lib/Driver/ToolChains.cpp<br>
>> >    cfe/trunk/runtime/compiler-rt/Makefile<br>
>> ><br>
>> > Modified: cfe/trunk/lib/Driver/ToolChains.cpp<br>
>> > URL:<br>
>> > <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.cpp?rev=145651&r1=145650&r2=145651&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.cpp?rev=145651&r1=145650&r2=145651&view=diff</a><br>

>> ><br>
>> > ==============================================================================<br>
>> > --- cfe/trunk/lib/Driver/ToolChains.cpp (original)<br>
>> > +++ cfe/trunk/lib/Driver/ToolChains.cpp Thu Dec  1 17:40:18 2011<br>
>> > @@ -467,6 +467,22 @@<br>
>> >     }<br>
>> >   }<br>
>> ><br>
>> > +  // Add ASAN runtime library, if required.<br>
>> > +  if (Args.hasFlag(options::OPT_faddress_sanitizer,<br>
>> > +                   options::OPT_fno_address_sanitizer, false)) {<br>
>> > +    if (isTargetIPhoneOS()) {<br>
>> > +      getDriver().Diag(diag::err_drv_clang_unsupported_per_platform)<br>
>> > +        << "-faddress-sanitizer";<br>
>> > +    } else {<br>
>> > +      AddLinkRuntimeLib(Args, CmdArgs, "libclang_rt.asan_osx.a");<br>
>> > +<br>
>> > +      // The ASAN runtime library requires C++ and CoreFoundation.<br>
>> > +      AddCXXStdlibLibArgs(Args, CmdArgs);<br>
>> > +      CmdArgs.push_back("-framework");<br>
>> > +      CmdArgs.push_back("CoreFoundation");<br>
>> > +    }<br>
>> > +  }<br>
>> > +<br>
>> >   // Otherwise link libSystem, then the dynamic runtime library, and<br>
>> > finally any<br>
>> >   // target specific static runtime library.<br>
>> >   CmdArgs.push_back("-lSystem");<br>
>> ><br>
>> > Modified: cfe/trunk/runtime/compiler-rt/Makefile<br>
>> > URL:<br>
>> > <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/runtime/compiler-rt/Makefile?rev=145651&r1=145650&r2=145651&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/runtime/compiler-rt/Makefile?rev=145651&r1=145650&r2=145651&view=diff</a><br>

>> ><br>
>> > ==============================================================================<br>
>> > --- cfe/trunk/runtime/compiler-rt/Makefile (original)<br>
>> > +++ cfe/trunk/runtime/compiler-rt/Makefile Thu Dec  1 17:40:18 2011<br>
>> > @@ -78,7 +78,7 @@<br>
>> >  RuntimeDirs += darwin<br>
>> >  RuntimeLibrary.darwin.Configs := \<br>
>> >        eprintf 10.4 osx ios cc_kext \<br>
>> > -       profile_osx profile_ios<br>
>> > +       asan_osx profile_osx profile_ios<br>
>> ><br>
>> >  # On Darwin, fake Clang into using the iOS assembler (since compiler-rt<br>
>> > wants to<br>
>> >  # build ARM bits).<br>
>> ><br>
>> ><br>
>> How does this play with my patch for Tools.cpp being reviewed now?<br>
>> Will I need to remove the "exe" part of it?<br>
><br>
><br>
> It seems to me that Daniel's patch does [almost] everything that yours<br>
> does.<br>
> Note sure about shared libs though.<br>
><br>
> --kcc<br>
><br>
><br>
>><br>
>><br>
>> _______________________________________________<br>
>> cfe-commits mailing list<br>
>> <a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
>> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
><br>
><br>
<br>
<br>
<br>
</div></div><span class="HOEnZb"><font color="#888888">--<br>
Alexander Potapenko<br>
Software Engineer<br>
Google Moscow<br>
</font></span></blockquote></div><br>