[compiler-rt] r181697 - [sanitizer] Fix StopTheWorld build on non-Android ARM.

Kostya Serebryany kcc at google.com
Wed May 15 03:21:05 PDT 2013


On Tue, May 14, 2013 at 10:39 PM, Abdoulaye Walsimou Gaye <
awg at embtoolkit.org> wrote:

> Hi Sergey,
> release-3.3 also needs this fix.
>

For the 3.3 branch we can simply disable this code (sanitizer_
stoptheworld_linux.cc) entirely (it is not fully functional anyway).



>
> Thanks,
> AWG
>
>
> On 05/13/2013 12:35 PM, Sergey Matveev wrote:
>
>> Author: smatveev
>> Date: Mon May 13 05:35:20 2013
>> New Revision: 181697
>>
>> URL: http://llvm.org/viewvc/llvm-**project?rev=181697&view=rev<http://llvm.org/viewvc/llvm-project?rev=181697&view=rev>
>> Log:
>> [sanitizer] Fix StopTheWorld build on non-Android ARM.
>>
>> Original patch by Abdoulaye Walsimou Gaye.
>>
>> Modified:
>>      compiler-rt/trunk/lib/**sanitizer_common/sanitizer_**
>> stoptheworld_linux.cc
>>
>> Modified: compiler-rt/trunk/lib/**sanitizer_common/sanitizer_**
>> stoptheworld_linux.cc
>> URL: http://llvm.org/viewvc/llvm-**project/compiler-rt/trunk/lib/**
>> sanitizer_common/sanitizer_**stoptheworld_linux.cc?rev=**
>> 181697&r1=181696&r2=181697&**view=diff<http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_stoptheworld_linux.cc?rev=181697&r1=181696&r2=181697&view=diff>
>> ==============================**==============================**
>> ==================
>> --- compiler-rt/trunk/lib/**sanitizer_common/sanitizer_**stoptheworld_linux.cc
>> (original)
>> +++ compiler-rt/trunk/lib/**sanitizer_common/sanitizer_**stoptheworld_linux.cc
>> Mon May 13 05:35:20 2013
>> @@ -24,7 +24,7 @@
>>   #include <sys/prctl.h> // for PR_* definitions
>>   #include <sys/ptrace.h> // for PTRACE_* definitions
>>   #include <sys/types.h> // for pid_t
>> -#if defined(SANITIZER_ANDROID) && defined(__arm__)
>> +#if SANITIZER_ANDROID && defined(__arm__)
>>   # include <linux/user.h>  // for pt_regs
>>   #else
>>   # include <sys/user.h>  // for user_regs_struct
>> @@ -353,12 +353,26 @@ void StopTheWorld(**StopTheWorldCallback c
>>   }
>>     // Platform-specific methods from SuspendedThreadsList.
>> -#if defined(__arm__)
>> +#if SANITIZER_ANDROID && defined(__arm__)
>>   typedef pt_regs regs_struct;
>> -#else
>> +#define REG_SP ARM_sp
>> +
>> +#elif SANITIZER_LINUX && defined(__arm__)
>> +typedef user_regs regs_struct;
>> +#define REG_SP uregs[13]
>> +
>> +#elif defined(__i386__) || defined(__x86_64__)
>>   typedef user_regs_struct regs_struct;
>> +#if defined(__i386__)
>> +#define REG_SP esp
>> +#else
>> +#define REG_SP rsp
>>   #endif
>>   +#else
>> +#error "Unsupported architecture"
>> +#endif // SANITIZER_ANDROID && defined(__arm__)
>> +
>>   int SuspendedThreadsList::**GetRegistersAndSP(uptr index,
>>                                               uptr *buffer,
>>                                               uptr *sp) const {
>> @@ -371,15 +385,8 @@ int SuspendedThreadsList::**GetRegistersAn
>>              tid, pterrno);
>>       return -1;
>>     }
>> -#if defined(__arm__)
>> -  *sp = regs.ARM_sp;
>> -#elif defined(__i386__)
>> -  *sp = regs.esp;
>> -#elif defined(__x86_64__)
>> -  *sp = regs.rsp;
>> -#else
>> -  UNIMPLEMENTED("Unknown architecture");
>> -#endif
>> +
>> +  *sp = regs.REG_SP;
>>     internal_memcpy(buffer, &regs, sizeof(regs));
>>     return 0;
>>   }
>>
>>
>> ______________________________**_________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/**mailman/listinfo/llvm-commits<http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits>
>>
>
> ______________________________**_________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/**mailman/listinfo/llvm-commits<http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130515/1c31c65b/attachment.html>


More information about the llvm-commits mailing list