Patchwork [asan] migrate runtime from llvm

login
register
mail settings
Submitter Wei Mi
Date Oct. 16, 2012, 6:39 a.m.
Message ID <CA+4CFy5S1cyAc+GzvoceBy_aR-ZGqqrtikhx89RiO3_ygwi=1w@mail.gmail.com>
Download mbox | patch
Permalink /patch/191728/
State New
Headers show

Comments

Wei Mi - Oct. 16, 2012, 6:39 a.m.
>
> This is a good start.  Can you send a patch out without including
> libasan so at least the toplevel parts can be reviewed easier?
> Also the changelog entry for gcc.c go under the gcc/ChangeLog rather
> than the toplevel one.
>
> Thanks,
> Andrew Pinski

Sure, I attach it. Thanks for pointing out the changelog error.

Thanks,
Wei.
Andrew Pinski - Oct. 16, 2012, 6:53 a.m.
On Mon, Oct 15, 2012 at 11:39 PM, Wei Mi <wmi@google.com> wrote:
>>
>> This is a good start.  Can you send a patch out without including
>> libasan so at least the toplevel parts can be reviewed easier?
>> Also the changelog entry for gcc.c go under the gcc/ChangeLog rather
>> than the toplevel one.
>>
>> Thanks,
>> Andrew Pinski
>
> Sure, I attach it. Thanks for pointing out the changelog error.

+    %{fasan|coverage:-lasan -lpthread -ldl -lstdc++}\

Just curious, does asan runtime really require linking against pthread
and the standard C++ library?
Also I think the above will not work if shared libraries are disabled
as -lsupc++ is also needed when linking against the stdc++.

Also if libasan really depends on the C++ library, then most likely
you should a dependency in the toplevel makefile itself and maybe even
have the shared version of libasan link against libstdc++.

Thanks,
Andrew Pinski

>
> Thanks,
> Wei.
Jakub Jelinek - Oct. 16, 2012, 7:27 a.m.
On Mon, Oct 15, 2012 at 11:39:52PM -0700, Wei Mi wrote:
> --- gcc/gcc.c	(revision 192487)
> +++ gcc/gcc.c	(working copy)
> @@ -679,6 +679,7 @@ proper position among the other output f
>      %{fgnu-tm:%:include(libitm.spec)%(link_itm)}\
>      %(mflib) " STACK_SPLIT_SPEC "\
>      %{fprofile-arcs|fprofile-generate*|coverage:-lgcov}\
> +    %{fasan|coverage:-lasan -lpthread -ldl -lstdc++}\
>      %{!nostdlib:%{!nodefaultlibs:%(link_ssp) %(link_gcc_c_sequence)}}\
>      %{!nostdlib:%{!nostartfiles:%E}} %{T*} }}}}}}"

Why the |coverage there?  It isn't related to asan in any way.
Also, why -lstdc++ in there?  I could understand %{static:-lstdc++}, but
given that libasan doesn't support static linking, I find it hardly useful.

> --- Makefile.def	(revision 192487)
> +++ Makefile.def	(working copy)
> @@ -119,6 +119,7 @@ target_modules = { module= libstdc++-v3;
>  		   lib_path=src/.libs;
>  		   raw_cxx=true; };
>  target_modules = { module= libmudflap; lib_path=.libs; };
> +target_modules = { module= libasan; lib_path=.libs; };
>  target_modules = { module= libssp; lib_path=.libs; };
>  target_modules = { module= newlib; };
>  target_modules = { module= libgcc; bootstrap=true; no_check=true; };

Shouldn't libasan, given it is a C++ shared library, depend on libstdc++-v3?

	Jakub
Xinliang David Li - Oct. 18, 2012, 6:15 p.m.
On Tue, Oct 16, 2012 at 12:27 AM, Jakub Jelinek <jakub@redhat.com> wrote:
> On Mon, Oct 15, 2012 at 11:39:52PM -0700, Wei Mi wrote:
>> --- gcc/gcc.c (revision 192487)
>> +++ gcc/gcc.c (working copy)
>> @@ -679,6 +679,7 @@ proper position among the other output f
>>      %{fgnu-tm:%:include(libitm.spec)%(link_itm)}\
>>      %(mflib) " STACK_SPLIT_SPEC "\
>>      %{fprofile-arcs|fprofile-generate*|coverage:-lgcov}\
>> +    %{fasan|coverage:-lasan -lpthread -ldl -lstdc++}\
>>      %{!nostdlib:%{!nodefaultlibs:%(link_ssp) %(link_gcc_c_sequence)}}\
>>      %{!nostdlib:%{!nostartfiles:%E}} %{T*} }}}}}}"
>
> Why the |coverage there?  It isn't related to asan in any way.
> Also, why -lstdc++ in there?  I could understand %{static:-lstdc++}, but
> given that libasan doesn't support static linking, I find it hardly useful.
>
>> --- Makefile.def      (revision 192487)
>> +++ Makefile.def      (working copy)
>> @@ -119,6 +119,7 @@ target_modules = { module= libstdc++-v3;
>>                  lib_path=src/.libs;
>>                  raw_cxx=true; };
>>  target_modules = { module= libmudflap; lib_path=.libs; };
>> +target_modules = { module= libasan; lib_path=.libs; };
>>  target_modules = { module= libssp; lib_path=.libs; };
>>  target_modules = { module= newlib; };
>>  target_modules = { module= libgcc; bootstrap=true; no_check=true; };
>
> Shouldn't libasan, given it is a C++ shared library, depend on libstdc++-v3?
>

I don't think it should depend on any C++ libraries.  libasan is
written in C++, but I don't see any C++ features that require C++
runtime support (libstdc++, libcsup++) are used -- otherwise the
archive libasan can not be used with C program.


David


>         Jakub
Jakub Jelinek - Oct. 18, 2012, 6:22 p.m.
On Thu, Oct 18, 2012 at 11:15:33AM -0700, Xinliang David Li wrote:
> >> --- Makefile.def      (revision 192487)
> >> +++ Makefile.def      (working copy)
> >> @@ -119,6 +119,7 @@ target_modules = { module= libstdc++-v3;
> >>                  lib_path=src/.libs;
> >>                  raw_cxx=true; };
> >>  target_modules = { module= libmudflap; lib_path=.libs; };
> >> +target_modules = { module= libasan; lib_path=.libs; };
> >>  target_modules = { module= libssp; lib_path=.libs; };
> >>  target_modules = { module= newlib; };
> >>  target_modules = { module= libgcc; bootstrap=true; no_check=true; };
> >
> > Shouldn't libasan, given it is a C++ shared library, depend on libstdc++-v3?
> >
> 
> I don't think it should depend on any C++ libraries.  libasan is
> written in C++, but I don't see any C++ features that require C++
> runtime support (libstdc++, libcsup++) are used -- otherwise the
> archive libasan can not be used with C program.

Is it compiled with -fno-exceptions -fno-rtti?  Without it it would
require either libstdc++ or libsupc++.  I see it uses at least
#include <new>, so even if it doesn't link against libstdc++, it needs
its headers being setup and thus need to depend at the toplevel
on libstdc++ being built (and likely needs to use
`$(...)/libstdc++-v3/scripts/testsuite_flags --build-includes`
) when compiling.

	Jakub
Xinliang David Li - Oct. 18, 2012, 7:26 p.m.
On Thu, Oct 18, 2012 at 11:22 AM, Jakub Jelinek <jakub@redhat.com> wrote:
> On Thu, Oct 18, 2012 at 11:15:33AM -0700, Xinliang David Li wrote:
>> >> --- Makefile.def      (revision 192487)
>> >> +++ Makefile.def      (working copy)
>> >> @@ -119,6 +119,7 @@ target_modules = { module= libstdc++-v3;
>> >>                  lib_path=src/.libs;
>> >>                  raw_cxx=true; };
>> >>  target_modules = { module= libmudflap; lib_path=.libs; };
>> >> +target_modules = { module= libasan; lib_path=.libs; };
>> >>  target_modules = { module= libssp; lib_path=.libs; };
>> >>  target_modules = { module= newlib; };
>> >>  target_modules = { module= libgcc; bootstrap=true; no_check=true; };
>> >
>> > Shouldn't libasan, given it is a C++ shared library, depend on libstdc++-v3?
>> >
>>
>> I don't think it should depend on any C++ libraries.  libasan is
>> written in C++, but I don't see any C++ features that require C++
>> runtime support (libstdc++, libcsup++) are used -- otherwise the
>> archive libasan can not be used with C program.
>
> Is it compiled with -fno-exceptions -fno-rtti?  Without it it would
> require either libstdc++ or libsupc++.  I see it uses at least
> #include <new>, so even if it doesn't link against libstdc++, it needs
> its headers being setup and thus need to depend at the toplevel
> on libstdc++ being built (and likely needs to use
> `$(...)/libstdc++-v3/scripts/testsuite_flags --build-includes`
> ) when compiling.

I looked at the library built with LLVM -- it does not reference any
exception handling routines, nor operator new, rtti related routines.

I am not sure if the inclusion of <new> is needed -- it is used in
asan_new_delete.cc which defines replacement for global new and
delete, I think.

David

>
>         Jakub
Xinliang David Li - Oct. 18, 2012, 7:29 p.m.
+ kcc the author of the libasan library.

Koystya, does libasan build (need to ) depend on C++ library ?

thanks,

David

On Thu, Oct 18, 2012 at 12:26 PM, Xinliang David Li <davidxl@google.com> wrote:
> On Thu, Oct 18, 2012 at 11:22 AM, Jakub Jelinek <jakub@redhat.com> wrote:
>> On Thu, Oct 18, 2012 at 11:15:33AM -0700, Xinliang David Li wrote:
>>> >> --- Makefile.def      (revision 192487)
>>> >> +++ Makefile.def      (working copy)
>>> >> @@ -119,6 +119,7 @@ target_modules = { module= libstdc++-v3;
>>> >>                  lib_path=src/.libs;
>>> >>                  raw_cxx=true; };
>>> >>  target_modules = { module= libmudflap; lib_path=.libs; };
>>> >> +target_modules = { module= libasan; lib_path=.libs; };
>>> >>  target_modules = { module= libssp; lib_path=.libs; };
>>> >>  target_modules = { module= newlib; };
>>> >>  target_modules = { module= libgcc; bootstrap=true; no_check=true; };
>>> >
>>> > Shouldn't libasan, given it is a C++ shared library, depend on libstdc++-v3?
>>> >
>>>
>>> I don't think it should depend on any C++ libraries.  libasan is
>>> written in C++, but I don't see any C++ features that require C++
>>> runtime support (libstdc++, libcsup++) are used -- otherwise the
>>> archive libasan can not be used with C program.
>>
>> Is it compiled with -fno-exceptions -fno-rtti?  Without it it would
>> require either libstdc++ or libsupc++.  I see it uses at least
>> #include <new>, so even if it doesn't link against libstdc++, it needs
>> its headers being setup and thus need to depend at the toplevel
>> on libstdc++ being built (and likely needs to use
>> `$(...)/libstdc++-v3/scripts/testsuite_flags --build-includes`
>> ) when compiling.
>
> I looked at the library built with LLVM -- it does not reference any
> exception handling routines, nor operator new, rtti related routines.
>
> I am not sure if the inclusion of <new> is needed -- it is used in
> asan_new_delete.cc which defines replacement for global new and
> delete, I think.
>
> David
>
>>
>>         Jakub
Xinliang David Li - Oct. 19, 2012, 4:53 a.m.
thanks.  If libasan is statically linked in (which is the case for
clang), removing the dependency on libstdc++ is a must.

David

On Thu, Oct 18, 2012 at 9:05 PM, Kostya Serebryany <kcc@google.com> wrote:
> +few more folks
>
> libasan does not (and should not) depend on libstdc++-v3.
> In llvm build system it is built with
>   -fPIC
>   -fno-builtin
>   -fno-exceptions
>   -fomit-frame-pointer
>   -funwind-tables
>   -O3
> (I guess we can add -fno-rtti too, but we did not need it).
>
> the file asan_new_delete.cc indeed depends on <new>, but I think we can
> eliminate this include completely
> (we've just discussed this yesterday).
>
>
> --kcc
>
> On Thu, Oct 18, 2012 at 11:29 PM, Xinliang David Li <davidxl@google.com>
> wrote:
>>
>> + kcc the author of the libasan library.
>>
>> Koystya, does libasan build (need to ) depend on C++ library ?
>>
>> thanks,
>>
>> David
>>
>> On Thu, Oct 18, 2012 at 12:26 PM, Xinliang David Li <davidxl@google.com>
>> wrote:
>> > On Thu, Oct 18, 2012 at 11:22 AM, Jakub Jelinek <jakub@redhat.com>
>> > wrote:
>> >> On Thu, Oct 18, 2012 at 11:15:33AM -0700, Xinliang David Li wrote:
>> >>> >> --- Makefile.def      (revision 192487)
>> >>> >> +++ Makefile.def      (working copy)
>> >>> >> @@ -119,6 +119,7 @@ target_modules = { module= libstdc++-v3;
>> >>> >>                  lib_path=src/.libs;
>> >>> >>                  raw_cxx=true; };
>> >>> >>  target_modules = { module= libmudflap; lib_path=.libs; };
>> >>> >> +target_modules = { module= libasan; lib_path=.libs; };
>> >>> >>  target_modules = { module= libssp; lib_path=.libs; };
>> >>> >>  target_modules = { module= newlib; };
>> >>> >>  target_modules = { module= libgcc; bootstrap=true; no_check=true;
>> >>> >> };
>> >>> >
>> >>> > Shouldn't libasan, given it is a C++ shared library, depend on
>> >>> > libstdc++-v3?
>> >>> >
>> >>>
>> >>> I don't think it should depend on any C++ libraries.  libasan is
>> >>> written in C++, but I don't see any C++ features that require C++
>> >>> runtime support (libstdc++, libcsup++) are used -- otherwise the
>> >>> archive libasan can not be used with C program.
>> >>
>> >> Is it compiled with -fno-exceptions -fno-rtti?  Without it it would
>> >> require either libstdc++ or libsupc++.  I see it uses at least
>> >> #include <new>, so even if it doesn't link against libstdc++, it needs
>> >> its headers being setup and thus need to depend at the toplevel
>> >> on libstdc++ being built (and likely needs to use
>> >> `$(...)/libstdc++-v3/scripts/testsuite_flags --build-includes`
>> >> ) when compiling.
>> >
>> > I looked at the library built with LLVM -- it does not reference any
>> > exception handling routines, nor operator new, rtti related routines.
>> >
>> > I am not sure if the inclusion of <new> is needed -- it is used in
>> > asan_new_delete.cc which defines replacement for global new and
>> > delete, I think.
>> >
>> > David
>> >
>> >>
>> >>         Jakub
>
>

Patch

Index: Makefile.in
===================================================================
--- Makefile.in	(revision 192487)
+++ Makefile.in	(working copy)
@@ -575,7 +575,7 @@  all:
 
 # This is the list of directories that may be needed in RPATH_ENVVAR
 # so that programs built for the target machine work.
-TARGET_LIB_PATH = $(TARGET_LIB_PATH_libstdc++-v3)$(TARGET_LIB_PATH_libmudflap)$(TARGET_LIB_PATH_libssp)$(TARGET_LIB_PATH_libgomp)$(TARGET_LIB_PATH_libitm)$(TARGET_LIB_PATH_libatomic)$(HOST_LIB_PATH_gcc)
+TARGET_LIB_PATH = $(TARGET_LIB_PATH_libstdc++-v3)$(TARGET_LIB_PATH_libmudflap)$(TARGET_LIB_PATH_libasan)$(TARGET_LIB_PATH_libssp)$(TARGET_LIB_PATH_libgomp)$(TARGET_LIB_PATH_libitm)$(TARGET_LIB_PATH_libatomic)$(HOST_LIB_PATH_gcc)
 
 @if target-libstdc++-v3
 TARGET_LIB_PATH_libstdc++-v3 = $$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs:
@@ -585,6 +585,10 @@  TARGET_LIB_PATH_libstdc++-v3 = $$r/$(TAR
 TARGET_LIB_PATH_libmudflap = $$r/$(TARGET_SUBDIR)/libmudflap/.libs:
 @endif target-libmudflap
 
+@if target-libasan
+TARGET_LIB_PATH_libasan = $$r/$(TARGET_SUBDIR)/libasan/.libs:
+@endif target-libasan
+
 @if target-libssp
 TARGET_LIB_PATH_libssp = $$r/$(TARGET_SUBDIR)/libssp/.libs:
 @endif target-libssp
@@ -914,6 +918,7 @@  configure-host:  \
 configure-target:  \
     maybe-configure-target-libstdc++-v3 \
     maybe-configure-target-libmudflap \
+    maybe-configure-target-libasan \
     maybe-configure-target-libssp \
     maybe-configure-target-newlib \
     maybe-configure-target-libgcc \
@@ -1062,6 +1067,7 @@  all-host: maybe-all-lto-plugin
 all-target: maybe-all-target-libstdc++-v3
 @endif target-libstdc++-v3-no-bootstrap
 all-target: maybe-all-target-libmudflap
+all-target: maybe-all-target-libasan
 all-target: maybe-all-target-libssp
 all-target: maybe-all-target-newlib
 @if target-libgcc-no-bootstrap
@@ -1152,6 +1158,7 @@  info-host: maybe-info-lto-plugin
 
 info-target: maybe-info-target-libstdc++-v3
 info-target: maybe-info-target-libmudflap
+info-target: maybe-info-target-libasan
 info-target: maybe-info-target-libssp
 info-target: maybe-info-target-newlib
 info-target: maybe-info-target-libgcc
@@ -1233,6 +1240,7 @@  dvi-host: maybe-dvi-lto-plugin
 
 dvi-target: maybe-dvi-target-libstdc++-v3
 dvi-target: maybe-dvi-target-libmudflap
+dvi-target: maybe-dvi-target-libasan
 dvi-target: maybe-dvi-target-libssp
 dvi-target: maybe-dvi-target-newlib
 dvi-target: maybe-dvi-target-libgcc
@@ -1314,6 +1322,7 @@  pdf-host: maybe-pdf-lto-plugin
 
 pdf-target: maybe-pdf-target-libstdc++-v3
 pdf-target: maybe-pdf-target-libmudflap
+pdf-target: maybe-pdf-target-libasan
 pdf-target: maybe-pdf-target-libssp
 pdf-target: maybe-pdf-target-newlib
 pdf-target: maybe-pdf-target-libgcc
@@ -1395,6 +1404,7 @@  html-host: maybe-html-lto-plugin
 
 html-target: maybe-html-target-libstdc++-v3
 html-target: maybe-html-target-libmudflap
+html-target: maybe-html-target-libasan
 html-target: maybe-html-target-libssp
 html-target: maybe-html-target-newlib
 html-target: maybe-html-target-libgcc
@@ -1476,6 +1486,7 @@  TAGS-host: maybe-TAGS-lto-plugin
 
 TAGS-target: maybe-TAGS-target-libstdc++-v3
 TAGS-target: maybe-TAGS-target-libmudflap
+TAGS-target: maybe-TAGS-target-libasan
 TAGS-target: maybe-TAGS-target-libssp
 TAGS-target: maybe-TAGS-target-newlib
 TAGS-target: maybe-TAGS-target-libgcc
@@ -1557,6 +1568,7 @@  install-info-host: maybe-install-info-lt
 
 install-info-target: maybe-install-info-target-libstdc++-v3
 install-info-target: maybe-install-info-target-libmudflap
+install-info-target: maybe-install-info-target-libasan
 install-info-target: maybe-install-info-target-libssp
 install-info-target: maybe-install-info-target-newlib
 install-info-target: maybe-install-info-target-libgcc
@@ -1638,6 +1650,7 @@  install-pdf-host: maybe-install-pdf-lto-
 
 install-pdf-target: maybe-install-pdf-target-libstdc++-v3
 install-pdf-target: maybe-install-pdf-target-libmudflap
+install-pdf-target: maybe-install-pdf-target-libasan
 install-pdf-target: maybe-install-pdf-target-libssp
 install-pdf-target: maybe-install-pdf-target-newlib
 install-pdf-target: maybe-install-pdf-target-libgcc
@@ -1719,6 +1732,7 @@  install-html-host: maybe-install-html-lt
 
 install-html-target: maybe-install-html-target-libstdc++-v3
 install-html-target: maybe-install-html-target-libmudflap
+install-html-target: maybe-install-html-target-libasan
 install-html-target: maybe-install-html-target-libssp
 install-html-target: maybe-install-html-target-newlib
 install-html-target: maybe-install-html-target-libgcc
@@ -1800,6 +1814,7 @@  installcheck-host: maybe-installcheck-lt
 
 installcheck-target: maybe-installcheck-target-libstdc++-v3
 installcheck-target: maybe-installcheck-target-libmudflap
+installcheck-target: maybe-installcheck-target-libasan
 installcheck-target: maybe-installcheck-target-libssp
 installcheck-target: maybe-installcheck-target-newlib
 installcheck-target: maybe-installcheck-target-libgcc
@@ -1881,6 +1896,7 @@  mostlyclean-host: maybe-mostlyclean-lto-
 
 mostlyclean-target: maybe-mostlyclean-target-libstdc++-v3
 mostlyclean-target: maybe-mostlyclean-target-libmudflap
+mostlyclean-target: maybe-mostlyclean-target-libasan
 mostlyclean-target: maybe-mostlyclean-target-libssp
 mostlyclean-target: maybe-mostlyclean-target-newlib
 mostlyclean-target: maybe-mostlyclean-target-libgcc
@@ -1962,6 +1978,7 @@  clean-host: maybe-clean-lto-plugin
 
 clean-target: maybe-clean-target-libstdc++-v3
 clean-target: maybe-clean-target-libmudflap
+clean-target: maybe-clean-target-libasan
 clean-target: maybe-clean-target-libssp
 clean-target: maybe-clean-target-newlib
 clean-target: maybe-clean-target-libgcc
@@ -2043,6 +2060,7 @@  distclean-host: maybe-distclean-lto-plug
 
 distclean-target: maybe-distclean-target-libstdc++-v3
 distclean-target: maybe-distclean-target-libmudflap
+distclean-target: maybe-distclean-target-libasan
 distclean-target: maybe-distclean-target-libssp
 distclean-target: maybe-distclean-target-newlib
 distclean-target: maybe-distclean-target-libgcc
@@ -2124,6 +2142,7 @@  maintainer-clean-host: maybe-maintainer-
 
 maintainer-clean-target: maybe-maintainer-clean-target-libstdc++-v3
 maintainer-clean-target: maybe-maintainer-clean-target-libmudflap
+maintainer-clean-target: maybe-maintainer-clean-target-libasan
 maintainer-clean-target: maybe-maintainer-clean-target-libssp
 maintainer-clean-target: maybe-maintainer-clean-target-newlib
 maintainer-clean-target: maybe-maintainer-clean-target-libgcc
@@ -2260,6 +2279,7 @@  check-host:  \
 check-target:  \
     maybe-check-target-libstdc++-v3 \
     maybe-check-target-libmudflap \
+    maybe-check-target-libasan \
     maybe-check-target-libssp \
     maybe-check-target-newlib \
     maybe-check-target-libgcc \
@@ -2414,6 +2434,7 @@  install-host:  \
 install-target:  \
     maybe-install-target-libstdc++-v3 \
     maybe-install-target-libmudflap \
+    maybe-install-target-libasan \
     maybe-install-target-libssp \
     maybe-install-target-newlib \
     maybe-install-target-libgcc \
@@ -2515,6 +2536,7 @@  install-strip-host:  \
 install-strip-target:  \
     maybe-install-strip-target-libstdc++-v3 \
     maybe-install-strip-target-libmudflap \
+    maybe-install-strip-target-libasan \
     maybe-install-strip-target-libssp \
     maybe-install-strip-target-newlib \
     maybe-install-strip-target-libgcc \
@@ -32337,6 +32359,463 @@  maintainer-clean-target-libmudflap:
 
 
 
+.PHONY: configure-target-libasan maybe-configure-target-libasan
+maybe-configure-target-libasan:
+@if gcc-bootstrap
+configure-target-libasan: stage_current
+@endif gcc-bootstrap
+@if target-libasan
+maybe-configure-target-libasan: configure-target-libasan
+configure-target-libasan: 
+	@: $(MAKE); $(unstage)
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	echo "Checking multilib configuration for libasan..."; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libasan ; \
+	$(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/libasan/multilib.tmp 2> /dev/null ; \
+	if test -r $(TARGET_SUBDIR)/libasan/multilib.out; then \
+	  if cmp -s $(TARGET_SUBDIR)/libasan/multilib.tmp $(TARGET_SUBDIR)/libasan/multilib.out; then \
+	    rm -f $(TARGET_SUBDIR)/libasan/multilib.tmp; \
+	  else \
+	    rm -f $(TARGET_SUBDIR)/libasan/Makefile; \
+	    mv $(TARGET_SUBDIR)/libasan/multilib.tmp $(TARGET_SUBDIR)/libasan/multilib.out; \
+	  fi; \
+	else \
+	  mv $(TARGET_SUBDIR)/libasan/multilib.tmp $(TARGET_SUBDIR)/libasan/multilib.out; \
+	fi; \
+	test ! -f $(TARGET_SUBDIR)/libasan/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libasan ; \
+	$(NORMAL_TARGET_EXPORTS)  \
+	echo Configuring in $(TARGET_SUBDIR)/libasan; \
+	cd "$(TARGET_SUBDIR)/libasan" || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(TARGET_SUBDIR)/libasan/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	srcdiroption="--srcdir=$${topdir}/libasan"; \
+	libsrcdir="$$s/libasan"; \
+	rm -f no-such-file || : ; \
+	CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
+	  $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \
+	  --target=${target_alias} $${srcdiroption}  \
+	  || exit 1
+@endif target-libasan
+
+
+
+
+
+.PHONY: all-target-libasan maybe-all-target-libasan
+maybe-all-target-libasan:
+@if gcc-bootstrap
+all-target-libasan: stage_current
+@endif gcc-bootstrap
+@if target-libasan
+TARGET-target-libasan=all
+maybe-all-target-libasan: all-target-libasan
+all-target-libasan: configure-target-libasan
+	@: $(MAKE); $(unstage)
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(NORMAL_TARGET_EXPORTS)  \
+	(cd $(TARGET_SUBDIR)/libasan && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS)  \
+		$(TARGET-target-libasan))
+@endif target-libasan
+
+
+
+
+
+.PHONY: check-target-libasan maybe-check-target-libasan
+maybe-check-target-libasan:
+@if target-libasan
+maybe-check-target-libasan: check-target-libasan
+
+check-target-libasan:
+	@: $(MAKE); $(unstage)
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(NORMAL_TARGET_EXPORTS) \
+	(cd $(TARGET_SUBDIR)/libasan && \
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS)   check)
+
+@endif target-libasan
+
+.PHONY: install-target-libasan maybe-install-target-libasan
+maybe-install-target-libasan:
+@if target-libasan
+maybe-install-target-libasan: install-target-libasan
+
+install-target-libasan: installdirs
+	@: $(MAKE); $(unstage)
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(NORMAL_TARGET_EXPORTS) \
+	(cd $(TARGET_SUBDIR)/libasan && \
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  install)
+
+@endif target-libasan
+
+.PHONY: install-strip-target-libasan maybe-install-strip-target-libasan
+maybe-install-strip-target-libasan:
+@if target-libasan
+maybe-install-strip-target-libasan: install-strip-target-libasan
+
+install-strip-target-libasan: installdirs
+	@: $(MAKE); $(unstage)
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(NORMAL_TARGET_EXPORTS) \
+	(cd $(TARGET_SUBDIR)/libasan && \
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  install-strip)
+
+@endif target-libasan
+
+# Other targets (info, dvi, pdf, etc.)
+
+.PHONY: maybe-info-target-libasan info-target-libasan
+maybe-info-target-libasan:
+@if target-libasan
+maybe-info-target-libasan: info-target-libasan
+
+info-target-libasan: \
+    configure-target-libasan 
+	@: $(MAKE); $(unstage)
+	@[ -f $(TARGET_SUBDIR)/libasan/Makefile ] || exit 0 ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(NORMAL_TARGET_EXPORTS) \
+	echo "Doing info in $(TARGET_SUBDIR)/libasan" ; \
+	for flag in $(EXTRA_TARGET_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	(cd $(TARGET_SUBDIR)/libasan && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	           info) \
+	  || exit 1
+
+@endif target-libasan
+
+.PHONY: maybe-dvi-target-libasan dvi-target-libasan
+maybe-dvi-target-libasan:
+@if target-libasan
+maybe-dvi-target-libasan: dvi-target-libasan
+
+dvi-target-libasan: \
+    configure-target-libasan 
+	@: $(MAKE); $(unstage)
+	@[ -f $(TARGET_SUBDIR)/libasan/Makefile ] || exit 0 ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(NORMAL_TARGET_EXPORTS) \
+	echo "Doing dvi in $(TARGET_SUBDIR)/libasan" ; \
+	for flag in $(EXTRA_TARGET_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	(cd $(TARGET_SUBDIR)/libasan && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	           dvi) \
+	  || exit 1
+
+@endif target-libasan
+
+.PHONY: maybe-pdf-target-libasan pdf-target-libasan
+maybe-pdf-target-libasan:
+@if target-libasan
+maybe-pdf-target-libasan: pdf-target-libasan
+
+pdf-target-libasan: \
+    configure-target-libasan 
+	@: $(MAKE); $(unstage)
+	@[ -f $(TARGET_SUBDIR)/libasan/Makefile ] || exit 0 ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(NORMAL_TARGET_EXPORTS) \
+	echo "Doing pdf in $(TARGET_SUBDIR)/libasan" ; \
+	for flag in $(EXTRA_TARGET_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	(cd $(TARGET_SUBDIR)/libasan && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	           pdf) \
+	  || exit 1
+
+@endif target-libasan
+
+.PHONY: maybe-html-target-libasan html-target-libasan
+maybe-html-target-libasan:
+@if target-libasan
+maybe-html-target-libasan: html-target-libasan
+
+html-target-libasan: \
+    configure-target-libasan 
+	@: $(MAKE); $(unstage)
+	@[ -f $(TARGET_SUBDIR)/libasan/Makefile ] || exit 0 ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(NORMAL_TARGET_EXPORTS) \
+	echo "Doing html in $(TARGET_SUBDIR)/libasan" ; \
+	for flag in $(EXTRA_TARGET_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	(cd $(TARGET_SUBDIR)/libasan && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	           html) \
+	  || exit 1
+
+@endif target-libasan
+
+.PHONY: maybe-TAGS-target-libasan TAGS-target-libasan
+maybe-TAGS-target-libasan:
+@if target-libasan
+maybe-TAGS-target-libasan: TAGS-target-libasan
+
+TAGS-target-libasan: \
+    configure-target-libasan 
+	@: $(MAKE); $(unstage)
+	@[ -f $(TARGET_SUBDIR)/libasan/Makefile ] || exit 0 ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(NORMAL_TARGET_EXPORTS) \
+	echo "Doing TAGS in $(TARGET_SUBDIR)/libasan" ; \
+	for flag in $(EXTRA_TARGET_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	(cd $(TARGET_SUBDIR)/libasan && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	           TAGS) \
+	  || exit 1
+
+@endif target-libasan
+
+.PHONY: maybe-install-info-target-libasan install-info-target-libasan
+maybe-install-info-target-libasan:
+@if target-libasan
+maybe-install-info-target-libasan: install-info-target-libasan
+
+install-info-target-libasan: \
+    configure-target-libasan \
+    info-target-libasan 
+	@: $(MAKE); $(unstage)
+	@[ -f $(TARGET_SUBDIR)/libasan/Makefile ] || exit 0 ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(NORMAL_TARGET_EXPORTS) \
+	echo "Doing install-info in $(TARGET_SUBDIR)/libasan" ; \
+	for flag in $(EXTRA_TARGET_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	(cd $(TARGET_SUBDIR)/libasan && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	           install-info) \
+	  || exit 1
+
+@endif target-libasan
+
+.PHONY: maybe-install-pdf-target-libasan install-pdf-target-libasan
+maybe-install-pdf-target-libasan:
+@if target-libasan
+maybe-install-pdf-target-libasan: install-pdf-target-libasan
+
+install-pdf-target-libasan: \
+    configure-target-libasan \
+    pdf-target-libasan 
+	@: $(MAKE); $(unstage)
+	@[ -f $(TARGET_SUBDIR)/libasan/Makefile ] || exit 0 ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(NORMAL_TARGET_EXPORTS) \
+	echo "Doing install-pdf in $(TARGET_SUBDIR)/libasan" ; \
+	for flag in $(EXTRA_TARGET_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	(cd $(TARGET_SUBDIR)/libasan && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	           install-pdf) \
+	  || exit 1
+
+@endif target-libasan
+
+.PHONY: maybe-install-html-target-libasan install-html-target-libasan
+maybe-install-html-target-libasan:
+@if target-libasan
+maybe-install-html-target-libasan: install-html-target-libasan
+
+install-html-target-libasan: \
+    configure-target-libasan \
+    html-target-libasan 
+	@: $(MAKE); $(unstage)
+	@[ -f $(TARGET_SUBDIR)/libasan/Makefile ] || exit 0 ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(NORMAL_TARGET_EXPORTS) \
+	echo "Doing install-html in $(TARGET_SUBDIR)/libasan" ; \
+	for flag in $(EXTRA_TARGET_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	(cd $(TARGET_SUBDIR)/libasan && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	           install-html) \
+	  || exit 1
+
+@endif target-libasan
+
+.PHONY: maybe-installcheck-target-libasan installcheck-target-libasan
+maybe-installcheck-target-libasan:
+@if target-libasan
+maybe-installcheck-target-libasan: installcheck-target-libasan
+
+installcheck-target-libasan: \
+    configure-target-libasan 
+	@: $(MAKE); $(unstage)
+	@[ -f $(TARGET_SUBDIR)/libasan/Makefile ] || exit 0 ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(NORMAL_TARGET_EXPORTS) \
+	echo "Doing installcheck in $(TARGET_SUBDIR)/libasan" ; \
+	for flag in $(EXTRA_TARGET_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	(cd $(TARGET_SUBDIR)/libasan && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	           installcheck) \
+	  || exit 1
+
+@endif target-libasan
+
+.PHONY: maybe-mostlyclean-target-libasan mostlyclean-target-libasan
+maybe-mostlyclean-target-libasan:
+@if target-libasan
+maybe-mostlyclean-target-libasan: mostlyclean-target-libasan
+
+mostlyclean-target-libasan: 
+	@: $(MAKE); $(unstage)
+	@[ -f $(TARGET_SUBDIR)/libasan/Makefile ] || exit 0 ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(NORMAL_TARGET_EXPORTS) \
+	echo "Doing mostlyclean in $(TARGET_SUBDIR)/libasan" ; \
+	for flag in $(EXTRA_TARGET_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	(cd $(TARGET_SUBDIR)/libasan && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	           mostlyclean) \
+	  || exit 1
+
+@endif target-libasan
+
+.PHONY: maybe-clean-target-libasan clean-target-libasan
+maybe-clean-target-libasan:
+@if target-libasan
+maybe-clean-target-libasan: clean-target-libasan
+
+clean-target-libasan: 
+	@: $(MAKE); $(unstage)
+	@[ -f $(TARGET_SUBDIR)/libasan/Makefile ] || exit 0 ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(NORMAL_TARGET_EXPORTS) \
+	echo "Doing clean in $(TARGET_SUBDIR)/libasan" ; \
+	for flag in $(EXTRA_TARGET_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	(cd $(TARGET_SUBDIR)/libasan && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	           clean) \
+	  || exit 1
+
+@endif target-libasan
+
+.PHONY: maybe-distclean-target-libasan distclean-target-libasan
+maybe-distclean-target-libasan:
+@if target-libasan
+maybe-distclean-target-libasan: distclean-target-libasan
+
+distclean-target-libasan: 
+	@: $(MAKE); $(unstage)
+	@[ -f $(TARGET_SUBDIR)/libasan/Makefile ] || exit 0 ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(NORMAL_TARGET_EXPORTS) \
+	echo "Doing distclean in $(TARGET_SUBDIR)/libasan" ; \
+	for flag in $(EXTRA_TARGET_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	(cd $(TARGET_SUBDIR)/libasan && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	           distclean) \
+	  || exit 1
+
+@endif target-libasan
+
+.PHONY: maybe-maintainer-clean-target-libasan maintainer-clean-target-libasan
+maybe-maintainer-clean-target-libasan:
+@if target-libasan
+maybe-maintainer-clean-target-libasan: maintainer-clean-target-libasan
+
+maintainer-clean-target-libasan: 
+	@: $(MAKE); $(unstage)
+	@[ -f $(TARGET_SUBDIR)/libasan/Makefile ] || exit 0 ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(NORMAL_TARGET_EXPORTS) \
+	echo "Doing maintainer-clean in $(TARGET_SUBDIR)/libasan" ; \
+	for flag in $(EXTRA_TARGET_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	(cd $(TARGET_SUBDIR)/libasan && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
+	           maintainer-clean) \
+	  || exit 1
+
+@endif target-libasan
+
+
+
+
+
 .PHONY: configure-target-libssp maybe-configure-target-libssp
 maybe-configure-target-libssp:
 @if gcc-bootstrap
@@ -44591,6 +45070,7 @@  configure-stage4-target-libstdc++-v3: ma
 configure-stageprofile-target-libstdc++-v3: maybe-all-stageprofile-gcc
 configure-stagefeedback-target-libstdc++-v3: maybe-all-stagefeedback-gcc
 configure-target-libmudflap: stage_last
+configure-target-libasan: stage_last
 configure-target-libssp: stage_last
 configure-target-newlib: stage_last
 configure-stage1-target-libgcc: maybe-all-stage1-gcc
@@ -44626,6 +45106,7 @@  configure-target-libatomic: stage_last
 @if gcc-no-bootstrap
 configure-target-libstdc++-v3: maybe-all-gcc
 configure-target-libmudflap: maybe-all-gcc
+configure-target-libasan: maybe-all-gcc
 configure-target-libssp: maybe-all-gcc
 configure-target-newlib: maybe-all-gcc
 configure-target-libgcc: maybe-all-gcc
@@ -45405,6 +45886,7 @@  configure-stagefeedback-target-libgomp:
 @if gcc-no-bootstrap
 configure-target-libstdc++-v3: maybe-all-target-libgcc
 configure-target-libmudflap: maybe-all-target-libgcc
+configure-target-libasan: maybe-all-target-libgcc
 configure-target-libssp: maybe-all-target-libgcc
 configure-target-newlib: maybe-all-target-libgcc
 configure-target-libbacktrace: maybe-all-target-libgcc
@@ -45431,6 +45913,8 @@  configure-target-libstdc++-v3: maybe-all
 
 configure-target-libmudflap: maybe-all-target-newlib maybe-all-target-libgloss
 
+configure-target-libasan: maybe-all-target-newlib maybe-all-target-libgloss
+
 configure-target-libssp: maybe-all-target-newlib maybe-all-target-libgloss
 
 
Index: configure.ac
===================================================================
--- configure.ac	(revision 192487)
+++ configure.ac	(working copy)
@@ -160,6 +160,7 @@  target_libraries="target-libgcc \
 		target-libitm \
 		target-libstdc++-v3 \
 		target-libmudflap \
+		target-libasan \
 		target-libssp \
 		target-libquadmath \
 		target-libgfortran \
Index: configure
===================================================================
--- configure	(revision 192487)
+++ configure	(working copy)
@@ -2725,6 +2725,7 @@  target_libraries="target-libgcc \
 		target-libitm \
 		target-libstdc++-v3 \
 		target-libmudflap \
+		target-libasan \
 		target-libssp \
 		target-libquadmath \
 		target-libgfortran \
Index: gcc/gcc.c
===================================================================
--- gcc/gcc.c	(revision 192487)
+++ gcc/gcc.c	(working copy)
@@ -679,6 +679,7 @@  proper position among the other output f
     %{fgnu-tm:%:include(libitm.spec)%(link_itm)}\
     %(mflib) " STACK_SPLIT_SPEC "\
     %{fprofile-arcs|fprofile-generate*|coverage:-lgcov}\
+    %{fasan|coverage:-lasan -lpthread -ldl -lstdc++}\
     %{!nostdlib:%{!nodefaultlibs:%(link_ssp) %(link_gcc_c_sequence)}}\
     %{!nostdlib:%{!nostartfiles:%E}} %{T*} }}}}}}"
 #endif
Index: Makefile.def
===================================================================
--- Makefile.def	(revision 192487)
+++ Makefile.def	(working copy)
@@ -119,6 +119,7 @@  target_modules = { module= libstdc++-v3;
 		   lib_path=src/.libs;
 		   raw_cxx=true; };
 target_modules = { module= libmudflap; lib_path=.libs; };
+target_modules = { module= libasan; lib_path=.libs; };
 target_modules = { module= libssp; lib_path=.libs; };
 target_modules = { module= newlib; };
 target_modules = { module= libgcc; bootstrap=true; no_check=true; };