On Tue, Nov 20, 2012 at 10:20 AM, David Miller <da...@davemloft.net> wrote: > From: Konstantin Serebryany <konstantin.s.serebry...@gmail.com> > Date: Tue, 20 Nov 2012 09:34:14 +0400 > >> On Tue, Nov 20, 2012 at 9:26 AM, David Miller <da...@davemloft.net> wrote: >>> From: Konstantin Serebryany <konstantin.s.serebry...@gmail.com> >>> Date: Tue, 20 Nov 2012 09:20:29 +0400 >>> >>>> Please do (the same that was applied upstream). >>> >>> Which one was that? >> http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc?r1=168301&r2=168300&pathrev=168301 > > That change is broken and will not work. > > There is no such CPP define as __sparc64__ > > You have to check "__sparc__ && __arch64__" > > HJ's patch was more concise and actually works for all known > targets supported by both GCC and LLVM combined. > > It is also likely to just work out of the box for new targets as well. > > Whereas your version of the fix is higher maintainence in the long run > since it creates yet another spot where each new 64-bit target has to > place a target specific check.
Ok. Will this work? // Are we using 32-bit or 64-bit syscalls? // x32 (which defines __x86_64__) has __WORDSIZE == 32 // but it still needs to use 64-bit syscalls. #if defined(__x86_64__) || __WORDSIZE == 64 # define SANITIZER_LINUX_USES_64BIT_SYSCALLS 1 #else # define SANITIZER_LINUX_USES_64BIT_SYSCALLS 0 #endif BTW, I've created a SPARC section at http://code.google.com/p/address-sanitizer/wiki/SupportedPlatforms, you are welcome to contribute to the documentation there. (I'll need your google-account-email to grant you write access) --kcc