[asan] migrate runtime from llvm

Xinliang David Li davidxl@google.com
Thu Oct 18 18:22:00 GMT 2012


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



More information about the Gcc-patches mailing list