Skip to content

Commit e4d27d0

Browse files
committed
8334618: ubsan: support setting additional ubsan check options
Backport-of: efb905e57ab7a5299952419fa9961316541056c2
1 parent 953846d commit e4d27d0

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
@@ -500,9 +500,15 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_LEAK_SANITIZER],
500500
#
501501
AC_DEFUN_ONCE([JDKOPT_SETUP_UNDEFINED_BEHAVIOR_SANITIZER],
502502
[
503+
UTIL_ARG_WITH(NAME: additional-ubsan-checks, TYPE: string,
504+
DEFAULT: [],
505+
DESC: [Customizes the ubsan checks],
506+
OPTIONAL: true)
507+
503508
# GCC reports lots of likely false positives for stringop-truncation and format-overflow.
504509
# Silence them for now.
505-
UBSAN_CHECKS="-fsanitize=undefined -fsanitize=float-divide-by-zero -fno-sanitize=shift-base -fno-sanitize=alignment"
510+
UBSAN_CHECKS="-fsanitize=undefined -fsanitize=float-divide-by-zero -fno-sanitize=shift-base -fno-sanitize=alignment \
511+
$ADDITIONAL_UBSAN_CHECKS"
506512
UBSAN_CFLAGS="$UBSAN_CHECKS -Wno-stringop-truncation -Wno-format-overflow -fno-omit-frame-pointer -DUNDEFINED_BEHAVIOR_SANITIZER"
507513
UBSAN_LDFLAGS="$UBSAN_CHECKS"
508514
UTIL_ARG_ENABLE(NAME: ubsan, DEFAULT: false, RESULT: UBSAN_ENABLED,

0 commit comments

Comments
 (0)