Skip to content

Commit efb905e

Browse files
committed
8334618: ubsan: support setting additional ubsan check options
Reviewed-by: stuefe, lucy
1 parent b2ac725 commit efb905e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

make/autoconf/jdk-options.m4

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,9 +496,15 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_LEAK_SANITIZER],
496496
#
497497
AC_DEFUN_ONCE([JDKOPT_SETUP_UNDEFINED_BEHAVIOR_SANITIZER],
498498
[
499+
UTIL_ARG_WITH(NAME: additional-ubsan-checks, TYPE: string,
500+
DEFAULT: [],
501+
DESC: [Customizes the ubsan checks],
502+
OPTIONAL: true)
503+
499504
# GCC reports lots of likely false positives for stringop-truncation and format-overflow.
500505
# Silence them for now.
501-
UBSAN_CHECKS="-fsanitize=undefined -fsanitize=float-divide-by-zero -fno-sanitize=shift-base -fno-sanitize=alignment"
506+
UBSAN_CHECKS="-fsanitize=undefined -fsanitize=float-divide-by-zero -fno-sanitize=shift-base -fno-sanitize=alignment \
507+
$ADDITIONAL_UBSAN_CHECKS"
502508
UBSAN_CFLAGS="$UBSAN_CHECKS -Wno-stringop-truncation -Wno-format-overflow -fno-omit-frame-pointer -DUNDEFINED_BEHAVIOR_SANITIZER"
503509
UBSAN_LDFLAGS="$UBSAN_CHECKS"
504510
UTIL_ARG_ENABLE(NAME: ubsan, DEFAULT: false, RESULT: UBSAN_ENABLED,

0 commit comments

Comments
 (0)