[cfe-commits] r145651 - in /cfe/trunk: lib/Driver/ToolChains.cpp runtime/compiler-rt/Makefile

Kostya Serebryany kcc at google.com
Fri Dec 2 15:08:56 PST 2011


On Fri, Dec 2, 2011 at 3:05 PM, Nico Weber <thakis at chromium.org> wrote:

> Very cool!
>
> When I use clang++ with -faddress-sanitizer, I get a "ld: warning:
> duplicate dylib /usr/lib/libstdc++.6.dylib" however.
>

I get this too. Maybe we need to ensure we call AddCXXStdlibLibArgs just
once?
--kcc


>
> Nico
>
> On Thu, Dec 1, 2011 at 3:40 PM, Daniel Dunbar <daniel at zuster.org> wrote:
> > Author: ddunbar
> > Date: Thu Dec  1 17:40:18 2011
> > New Revision: 145651
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=145651&view=rev
> > Log:
> > Driver/Darwin: Add ASAN runtime library link support.
> >
> > Modified:
> >    cfe/trunk/lib/Driver/ToolChains.cpp
> >    cfe/trunk/runtime/compiler-rt/Makefile
> >
> > Modified: cfe/trunk/lib/Driver/ToolChains.cpp
> > URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.cpp?rev=145651&r1=145650&r2=145651&view=diff
> >
> ==============================================================================
> > --- cfe/trunk/lib/Driver/ToolChains.cpp (original)
> > +++ cfe/trunk/lib/Driver/ToolChains.cpp Thu Dec  1 17:40:18 2011
> > @@ -467,6 +467,22 @@
> >     }
> >   }
> >
> > +  // Add ASAN runtime library, if required.
> > +  if (Args.hasFlag(options::OPT_faddress_sanitizer,
> > +                   options::OPT_fno_address_sanitizer, false)) {
> > +    if (isTargetIPhoneOS()) {
> > +      getDriver().Diag(diag::err_drv_clang_unsupported_per_platform)
> > +        << "-faddress-sanitizer";
> > +    } else {
> > +      AddLinkRuntimeLib(Args, CmdArgs, "libclang_rt.asan_osx.a");
> > +
> > +      // The ASAN runtime library requires C++ and CoreFoundation.
> > +      AddCXXStdlibLibArgs(Args, CmdArgs);
> > +      CmdArgs.push_back("-framework");
> > +      CmdArgs.push_back("CoreFoundation");
> > +    }
> > +  }
> > +
> >   // Otherwise link libSystem, then the dynamic runtime library, and
> finally any
> >   // target specific static runtime library.
> >   CmdArgs.push_back("-lSystem");
> >
> > Modified: cfe/trunk/runtime/compiler-rt/Makefile
> > URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/runtime/compiler-rt/Makefile?rev=145651&r1=145650&r2=145651&view=diff
> >
> ==============================================================================
> > --- cfe/trunk/runtime/compiler-rt/Makefile (original)
> > +++ cfe/trunk/runtime/compiler-rt/Makefile Thu Dec  1 17:40:18 2011
> > @@ -78,7 +78,7 @@
> >  RuntimeDirs += darwin
> >  RuntimeLibrary.darwin.Configs := \
> >        eprintf 10.4 osx ios cc_kext \
> > -       profile_osx profile_ios
> > +       asan_osx profile_osx profile_ios
> >
> >  # On Darwin, fake Clang into using the iOS assembler (since compiler-rt
> wants to
> >  # build ARM bits).
> >
> >
> > _______________________________________________
> > cfe-commits mailing list
> > cfe-commits at cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20111202/567c5b5c/attachment.html>


More information about the cfe-commits mailing list