On Thu, Jun 16, 2011 at 11:10 PM, Renato Golin <rengolin at systemcall.org>wrote:> On 16 June 2011 09:27, Kostya Serebryany <kcc at google.com> wrote: > > Question to the LLVM developers: would you consider adding > > the AddressSanitizer code to the LLVM trunk? > > Do you have an idea how hard would it be to port to non-x86 platforms? > I saw some Intel ASM in the C++ file... >Not hard at all. At some point the file had no asm at all, but using the custom asm allows to make the generated code more compact. 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. http://code.google.com/p/address-sanitizer/wiki/AddressSanitizerAlgorithm#Report_Error My first attempt that used no asm required ~15 bytes of code. Note, this code is executed only once, so it affects the performance very slightly (through icache size).> > The run-time library being 1.5k loc is not encouraging, but it didn't > look particularly platform specific... >Alas. It will grow even more when we add MacOS support. (currently, only tiny tests work on Mac). --kcc> > cheers, > --renato >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110616/10aa2757/attachment.html>
On 16 June 2011 20:20, Kostya Serebryany <kcc at google.com> wrote:> Not hard at all. > At some point the file had no asm at all, but using the custom asm allows to > make the generated code more compact.That should also be simple for other platforms...> My first attempt that used no asm required ~15 bytes of code. > Note, this code is executed only once, so it affects the performance very > slightly (through icache size).I see, maybe you could leave your C implementation as a fall back.> Alas. It will grow even more when we add MacOS support. > (currently, only tiny tests work on Mac).I saw a few APPLE macros. I think that's the part that needs most care, since multi-platform (os/arch/etc) could bloat that considerably. cheers, --renato
On Thu, Jun 16, 2011 at 11:30 PM, Renato Golin <rengolin at systemcall.org>wrote:> On 16 June 2011 20:20, Kostya Serebryany <kcc at google.com> wrote: > > Not hard at all. > > At some point the file had no asm at all, but using the custom asm allows > to > > make the generated code more compact. > > That should also be simple for other platforms... >Sure.> > > > My first attempt that used no asm required ~15 bytes of code. > > Note, this code is executed only once, so it affects the performance very > > slightly (through icache size). > > I see, maybe you could leave your C implementation as a fall back. >Not easy, because it will require a fallback code in the run time library. But yes, possible.> > > > Alas. It will grow even more when we add MacOS support. > > (currently, only tiny tests work on Mac). > > I saw a few APPLE macros.Yea...> I think that's the part that needs most > care, since multi-platform (os/arch/etc) could bloat that > considerably. >Agree. We've been adding APPLE code just recently. Time to split. I afraid we'll have to keep a single .cc file and add .h files for os/arch specific code to keep inlining under manual control (I don't want to reply on the compiler doing cross-cc-file inlining for me). --kcc> > cheers, > --renato >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110616/f9890ba1/attachment.html>