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


David Miller <davem@davemloft.net> writes:

> From: Diego Novillo <dnovillo@google.com>
> Date: Tue, 13 Nov 2012 11:21:59 -0500
>
>> On Tue, Nov 13, 2012 at 12:07 AM, David Miller <davem@davemloft.net> wrote:
>>>
>>> This has broken the build on every Linux target that hasn't added
>>> the necessary cpu specific code to asan_linux.cc
>> 
>> This should be fixed by Dodji's recent patch.  ASAN is not currently
>> ported to any target other than x86/linux, so it should just be
>> completely disabled until the other ports start showing up.
>> 
>> Dodji is your patch committed?
>
> So I wasted my time by writing the sparc bits necessary to fix
> the build?

I don't think you wasted your time.  The work you did is certainly
necessary.


However, it is probably not sufficient because besides the runtime
libsanitizer library, asan needs the target hook asan_shadow_offset() to
be defined for your target.  To date, that hook is only defined for x86
in config/i386/i386.c to ix86_asan_shadow_offset.  This is the 'offset'
used to compute the address of the shadow memory region for a given
address like in:

    shadow = address >> 3 + offset

That amounts to saying that for x86, the shadow memory is placed at the
bottom of the virtual memory space, as explained at
http://code.google.com/p/address-sanitizer/wiki/AddressSanitizerAlgorithm#Mapping.

I don't know if that mapping would work for sparc, though.

> Please leave enabled the platforms that do actually build.

I guess we could do that.  That would build libsanitizer, but asan will
still not be available on sparc if the asan_shadow_offset() target hook
is not provided.  Is that OK to you?

If it is, then I guess the patch below should do the trick?

diff --git a/libsanitizer/configure.tgt b/libsanitizer/configure.tgt
index ca7ac1f..988312e 100644
--- a/libsanitizer/configure.tgt
+++ b/libsanitizer/configure.tgt
@@ -20,7 +20,7 @@
 
 # Filter out unsupported systems.
 case "${target}" in
-  x86_64-*-linux* | i?86-*-linux*)
+  x86_64-*-linux* | i?86-*-linux* | sparc*-*-linux*)
 	;;
   *)
 	UNSUPPORTED=1

Cheers.

-- 
		Dodji


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