Changeset e2472dd


Ignore:
Timestamp:
2014-11-24T05:16:05Z (5 years ago)
Author:
dequis <dx@…>
Branches:
master
Children:
b38d399
Parents:
aa6bcd8
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • configure

    raa6bcd8 re2472dd  
    4040strip=1
    4141gcov=0
     42asan=0
    4243plugins=1
    4344otr=0
     
    8990--pie=0/1       Build position independent executable   $pie
    9091--gcov=0/1      Disable/enable test coverage reporting  $gcov
     92--asan=0/1      Disable/enable AddressSanitizer         $asan
    9193--plugins=0/1   Disable/enable plugins support          $plugins
    9294--otr=0/1/auto/plugin
     
    200202fi
    201203
     204if [ "$asan" = "1" ]; then
     205        CFLAGS="$CFLAGS -fsanitize=address"
     206        LDFLAGS="$LDFLAGS -fsanitize=address"
     207        debug=1
     208fi
    202209
    203210if [ "$debug" = "1" ]; then
    204211        echo 'DEBUG=1' >> Makefile.settings
    205         CFLAGS="$CFLAGS -g -DDEBUG"
     212        CFLAGS="$CFLAGS -g3 -DDEBUG -O0"
    206213else
    207214        [ -z "$CFLAGS" ] && CFLAGS="-O2 -fno-strict-aliasing"
     
    827834fi
    828835
     836if [ "$asan" = "1" ]; then
     837        echo '  AddressSanitizer (ASAN) enabled.'
     838else
     839        echo '  AddressSanitizer (ASAN) disabled.'
     840fi
     841
    829842if [ "$pie" = "1" ]; then
    830843        echo '  Building PIE executable'
Note: See TracChangeset for help on using the changeset viewer.