Merge branch '3510-disable-stringop-overread' into 'main'

Disable stringop-overread with gcc-11+ Address Sanitizer

Closes #3510

See merge request isc-projects/bind9!6747
This commit is contained in:
Ondřej Surý 2022-09-19 13:51:16 +00:00
commit 28dfa9adcc
2 changed files with 11 additions and 1 deletions

View file

@ -968,7 +968,7 @@ unit:gcc:jammy:amd64:
gcc:asan:
variables:
CC: gcc
CFLAGS: "${CFLAGS_COMMON} -fsanitize=address,undefined -Wno-error=stringop-overread"
CFLAGS: "${CFLAGS_COMMON} -fsanitize=address,undefined"
LDFLAGS: "-fsanitize=address,undefined"
EXTRA_CONFIGURE: "--with-libidn2 --without-jemalloc"
<<: *fedora_35_amd64_image

View file

@ -119,6 +119,16 @@ STD_CFLAGS="-Wall -Wextra -Wwrite-strings -Wpointer-arith -Wno-missing-field-ini
# These should be always errors
STD_CFLAGS="$STD_CFLAGS -Werror=implicit-function-declaration -Werror=missing-prototypes -Werror=format-security -Werror=parentheses -Werror=implicit -Werror=strict-prototypes -Werror=vla"
# Disable false positives generated by GCC 11+ and ASAN
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[]],
[[#if __GNUC__ >= 11 && defined(__SANITIZE_ADDRESS__)
#error Address Sanitizer enabled
#endif
]])],
[],
[STD_CFLAGS="$STD_CFLAGS -Wno-stringop-overread"])
STD_LDFLAGS=""
# ... except in test code