diff options
author | Rob Landley <rob@landley.net> | 2019-08-27 12:45:25 -0500 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2019-08-27 12:45:25 -0500 |
commit | ac84e8507983f9dee1df75bdd961a7dfd4f44b09 (patch) | |
tree | 9bca76daab48c023535bef968f3238fdebfe1884 /configure | |
parent | 0ec6b113985f4470e021f84b216c1b98e1e194ad (diff) | |
download | toybox-ac84e8507983f9dee1df75bdd961a7dfd4f44b09.tar.gz |
Add ASAN=1 to the build, in a slightly different way than Elliott suggested.
I put it in configure, with the other environment variables, instead of
in scripts/make.sh. Here's Elliott's original commit comment:
==========
Just use `ASAN=1 make test_grep` or whatever.
You'll probably want to set $ASAN_SYMBOLIZER_PATH to point to
llvm-symbolizer, but Debian makes that annoying by calling the
symbolizer /usr/bin/llvm-symbolizer-4.0 or whatever, and ASan refuses to
use it:
==43370==ERROR: External symbolizer path is set to
'/usr/bin/llvm-symbolizer-4.0' which isn't a known symbolizer. Please
set the path to the llvm-symbolizer binary or other known tool.
My usual workaround for this is to drop an llvm-symbolizer symlink in
the current directory, and I'm happy to automate that in the script to
make it require no knowledge of any of this nonsense, but haven't done
so in this initial patch.
I tested that this is actually working by reverting the grep fix and
running `ASAN=1 make test_grep`.
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -20,6 +20,8 @@ fi # Required for our expected ABI. we're 8-bit clean thus "char" must be unsigned. CFLAGS="$CFLAGS -funsigned-char" [ -z "$OPTIMIZE" ] && OPTIMIZE="-Os -ffunction-sections -fdata-sections -fno-asynchronous-unwind-tables -fno-strict-aliasing" +# set ASAN=1 to enable "address sanitizer" and debuggable backtraces +[ -z "$ASAN" ] || CFLAGS="$CFLAGS -O1 -g -fno-omit-frame-pointer -fno-optimize-sibling-calls -fsanitize=address" # We accept LDFLAGS, but by default don't have anything in it if [ "$(uname)" != "Darwin" ] |