Projects STRLCPY neomutt Commits b6c591a2
🤬
  • Add support for compiling with undefined behaviour sanitizer

    This adds `--ubsan` as a configure option. Adds compilation flag
    `--fsanitize=undefined`.
  • Loading...
  • Paulo Matos committed with Richard Russon 2 years ago
    b6c591a2
    1 parent d52a6377
Revision indexing in progress... (symbol navigation in revisions will be accurate after indexed)
  • ■ ■ ■ ■ ■
    auto.def
    skipped 114 lines
    115 115   include-path-in-cflags=1 => "Remove include paths from CFLAGS in the output of neomutt -v"
    116 116  # Testing
    117 117   asan=0 => "Enable the Address Sanitizer"
     118 + ubsan=0 => "Enable the Undefined Behaviour Sanitizer"
    118 119   coverage=0 => "Enable Coverage Testing"
    119 120   testing=0 => "Enable Unit Testing"
    120 121   fuzzing => "Enable Fuzz Testing"
    skipped 37 lines
    158 159   everything fmemopen full-doc fuzzing gdbm gnutls gpgme gsasl gss homespool idn
    159 160   idn2 include-path-in-cflags inotify kyotocabinet lmdb locales-fix lua lz4
    160 161   mixmaster nls notmuch pcre2 pgp qdbm rocksdb sasl smime sqlite ssl
    161  - testing tdb tokyocabinet zlib zstd
     162 + testing tdb tokyocabinet ubsan zlib zstd
    162 163   } {
    163 164   define want-$opt [opt-bool $opt]
    164 165   }
    skipped 744 lines
    909 910   define USE_HCACHE
    910 911  }
    911 912   
    912  - 
    913 913  ###############################################################################
    914 914  # Header Cache - GNU dbm
    915 915  if {[get-define want-gdbm]} {
    skipped 204 lines
    1120 1120   define-append CFLAGS -fsanitize=address -O0 -fno-omit-frame-pointer -fno-common
    1121 1121   define-append LDFLAGS -fsanitize=address
    1122 1122   define USE_ASAN
     1123 +}
     1124 + 
     1125 +###############################################################################
     1126 +# Undefined Behaviour Sanitizer
     1127 +if {[get-define want-ubsan]} {
     1128 + msg-checking "Checking for UBSAN..."
     1129 + if {![cctest -link 1 -cflags -fsanitize=undefined]} {
     1130 + user-error "Unable to compile with -fsanitize=undefined"
     1131 + }
     1132 + msg-result "yes"
     1133 + define-append CFLAGS -fsanitize=undefined -O0 -fno-omit-frame-pointer -fno-common
     1134 + define-append LDFLAGS -fsanitize=undefined
     1135 + define USE_UBSAN
    1123 1136  }
    1124 1137   
    1125 1138  ###############################################################################
    skipped 132 lines
  • ■ ■ ■ ■ ■ ■
    version.c
    skipped 316 lines
    317 317  #ifdef QUEUE_MACRO_DEBUG_TRACE
    318 318   { "queue", 2 },
    319 319  #endif
     320 +#ifdef USE_UBSAN
     321 + { "ubsan", 2 },
     322 +#endif
    320 323  #ifdef USE_DEBUG_WINDOW
    321 324   { "window", 2 },
    322 325  #endif
    skipped 266 lines
Please wait...
Page is in error, reload to recover