On Wed, Feb 20, 2013 at 7:52 PM, John McCall <span dir="ltr"><<a href="mailto:rjmccall@apple.com" target="_blank">rjmccall@apple.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">On Feb 20, 2013, at 7:49 PM, Peter Collingbourne <<a href="mailto:peter@pcc.me.uk">peter@pcc.me.uk</a>> wrote:<br>
> On Wed, Feb 20, 2013 at 06:30:53PM -0800, John McCall wrote:<br>
>> On Feb 20, 2013, at 6:24 PM, Richard Smith <<a href="mailto:richard@metafoo.co.uk">richard@metafoo.co.uk</a>> wrote:<br>
>>> On Wed, Feb 20, 2013 at 6:18 PM, John McCall <<a href="mailto:rjmccall@apple.com">rjmccall@apple.com</a>> wrote:<br>
>>> On Feb 20, 2013, at 6:13 PM, Peter Collingbourne <<a href="mailto:peter@pcc.me.uk">peter@pcc.me.uk</a>> wrote:<br>
>>>> <a href="http://llvm-reviews.chandlerc.com/D443" target="_blank">http://llvm-reviews.chandlerc.com/D443</a><br>
>>><br>
>>> Are you sure we actually *want* to expose this to users?<br>
>>><br>
>>> I would like to mark the UBSan runtime handler functions as __attribute__((coldcc)), and I think that would make sense for other sanitizers too.<br>
>><br>
>> Are we now willing to commit to a fixed ABI for coldcc?  I thought we hadn't been.<br>
><br>
> Implementing __attribute__((coldcc)) does not necessarily imply fixing<br>
> the ABI, provided that we document the attribute as such.  It should<br>
> be safe to use in compiler_rt once we modify its build system to use the<br>
> just-built clang.<br>
<br>
</div></div>I agree that we could certainly expose a calling convention with zero<br>
binary-compatibility guarantees.  I don't know if that would work for what<br>
Richard wants, though.  Notably, you can't stick that sort of thing in a<br>
library that you haven't rev-locked to the compiler.</blockquote><div><br></div><div>The ubsan runtime is essentially rev-locked to the compiler right now, and certainly does not guarantee a stable ABI. But Chandler has suggested a seemingly better solution anyway: emit noinline linkonce_odr coldcc forwarding thunks for all ubsan runtime functions called in a TU, and call them instead.</div>
</div>