diff options
author | dequis <dx@dxzone.com.ar> | 2014-11-24 02:16:05 -0300 |
---|---|---|
committer | dequis <dx@dxzone.com.ar> | 2014-11-24 02:16:05 -0300 |
commit | e2472ddb562e9118ed607b5938c7797af6a79e0c (patch) | |
tree | 08fcc9f41beb81ba579511eebc680389d5d16419 | |
parent | aa6bcd8adcf640ee4c910150d6a3034531fd087d (diff) |
configure: --asan=1 parameter for AddressSanitizer
Requires gcc >=4.8 or clang >=3.1
AddressSanitizer (ASan) is a fast memory error detector. See also:
https://code.google.com/p/address-sanitizer/wiki/AddressSanitizer
-rwxr-xr-x | configure | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -39,6 +39,7 @@ purple=0 debug=0 strip=1 gcov=0 +asan=0 plugins=1 otr=0 skype=0 @@ -88,6 +89,7 @@ Option Description Default --strip=0/1 Disable/enable binary stripping $strip --pie=0/1 Build position independent executable $pie --gcov=0/1 Disable/enable test coverage reporting $gcov +--asan=0/1 Disable/enable AddressSanitizer $asan --plugins=0/1 Disable/enable plugins support $plugins --otr=0/1/auto/plugin Disable/enable OTR encryption support $otr @@ -199,10 +201,15 @@ if [ -n "$target" ]; then systemlibdirs="/usr/$target/lib" fi +if [ "$asan" = "1" ]; then + CFLAGS="$CFLAGS -fsanitize=address" + LDFLAGS="$LDFLAGS -fsanitize=address" + debug=1 +fi if [ "$debug" = "1" ]; then echo 'DEBUG=1' >> Makefile.settings - CFLAGS="$CFLAGS -g -DDEBUG" + CFLAGS="$CFLAGS -g3 -DDEBUG -O0" else [ -z "$CFLAGS" ] && CFLAGS="-O2 -fno-strict-aliasing" fi @@ -826,6 +833,12 @@ else echo ' Debugging disabled.' fi +if [ "$asan" = "1" ]; then + echo ' AddressSanitizer (ASAN) enabled.' +else + echo ' AddressSanitizer (ASAN) disabled.' +fi + if [ "$pie" = "1" ]; then echo ' Building PIE executable' else |