<br><br><div class="gmail_quote">On Thu, Jun 16, 2011 at 11:10 PM, Renato Golin <span dir="ltr"><<a href="mailto:rengolin@systemcall.org">rengolin@systemcall.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On 16 June 2011 09:27, Kostya Serebryany <<a href="mailto:kcc@google.com">kcc@google.com</a>> wrote:<br>
> Question to the LLVM developers: would you consider adding<br>
> the AddressSanitizer code to the LLVM trunk?<br>
<br>
</div>Do you have an idea how hard would it be to port to non-x86 platforms?<br>
I saw some Intel ASM in the C++ file...<br></blockquote><div>Not hard at all. </div><div>At some point the file had no asm at all, but using the custom asm allows to make the generated code more compact. </div><div>Now, the code that actually reports the error is 5-6 bytes, we could decrease it to 1 byte (at least on x86/x86_64) with some more work. </div>
<div><meta http-equiv="content-type" content="text/html; charset=utf-8"><a href="http://code.google.com/p/address-sanitizer/wiki/AddressSanitizerAlgorithm#Report_Error">http://code.google.com/p/address-sanitizer/wiki/AddressSanitizerAlgorithm#Report_Error</a></div>
<div>My first attempt that used no asm required ~15 bytes of code. </div><div>Note, this code is executed only once, so it affects the performance very slightly (through icache size).</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<br>
The run-time library being 1.5k loc is not encouraging, but it didn't<br>
look particularly platform specific...<br></blockquote><div><br></div><div>Alas. It will grow even more when we add MacOS support. </div><div>(currently, only tiny tests work on Mac). </div><div><br></div><div>--kcc </div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
cheers,<br>
<font color="#888888">--renato<br>
</font></blockquote></div><br>