[PATCH] [compiler-rt] Turn abort_on_error=1 by default on OS X (part 1/2)

Kuba Brecka kuba.brecka at gmail.com
Tue Jan 27 14:51:11 PST 2015

In http://reviews.llvm.org/D7203#114142, @kcc wrote:

> When possible, we should avoid differences in behavior between platforms and ifdefs in the code. 
>  Can this be solved in some other way?
>  E.g. in the Xcode glue, etc?

I think this needs to be the standard behavior for command-line usage of `clang -fsanitize=address`. Otherwise, we could just instruct everyone to add ASAN_OPTIONS=abort_on_error=1 whenever running an ASanified program, but that's really just an annoyance and another reason why abort_on_error=1 should be the default.

Especially on OS X, setting the extra environment variable might be complicated, e.g. when running GUI apps by clicking the icon in Finder. In the same scenario, exit()-ing instead of abort()-ing is really something that is unexpected, because the app will just disappear. Developers are used to diagnostic tools abort()-ing (or crashing the process in some other way).

I understand that platform differences should be minimal, but this is still something that users of ASan on OS X would benefit from. Would implementing this in a different way than an `#if` be more acceptable (e.g. in CMake configuration)?

> > `ASAN_OPTIONS=$ASAN_OPTIONS:verbosity=1...`

>  This makes the tests non-hermetic (or at least, less hermetic)

How about using a lit substitution instead, for example %env, or adding that to the existing %run substitution (that we currently only use for QEMU testing)?



More information about the llvm-commits mailing list