This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [asan] migrate runtime from llvm


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
>
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]