diff --git a/make/autoconf/jdk-options.m4 b/make/autoconf/jdk-options.m4 index b5c679d2a8e..0dca5d13313 100644 --- a/make/autoconf/jdk-options.m4 +++ b/make/autoconf/jdk-options.m4 @@ -496,9 +496,15 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_LEAK_SANITIZER], # AC_DEFUN_ONCE([JDKOPT_SETUP_UNDEFINED_BEHAVIOR_SANITIZER], [ + UTIL_ARG_WITH(NAME: additional-ubsan-checks, TYPE: string, + DEFAULT: [], + DESC: [Customizes the ubsan checks], + OPTIONAL: true) + # GCC reports lots of likely false positives for stringop-truncation and format-overflow. # Silence them for now. - UBSAN_CHECKS="-fsanitize=undefined -fsanitize=float-divide-by-zero -fno-sanitize=shift-base -fno-sanitize=alignment" + UBSAN_CHECKS="-fsanitize=undefined -fsanitize=float-divide-by-zero -fno-sanitize=shift-base -fno-sanitize=alignment \ + $ADDITIONAL_UBSAN_CHECKS" UBSAN_CFLAGS="$UBSAN_CHECKS -Wno-stringop-truncation -Wno-format-overflow -fno-omit-frame-pointer -DUNDEFINED_BEHAVIOR_SANITIZER" UBSAN_LDFLAGS="$UBSAN_CHECKS" UTIL_ARG_ENABLE(NAME: ubsan, DEFAULT: false, RESULT: UBSAN_ENABLED,