diff --git a/make/autoconf/jdk-options.m4 b/make/autoconf/jdk-options.m4 index d8788ca2587..a76fdab5ae5 100644 --- a/make/autoconf/jdk-options.m4 +++ b/make/autoconf/jdk-options.m4 @@ -434,8 +434,9 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_ADDRESS_SANITIZER], elif test "x$TOOLCHAIN_TYPE" = "xmicrosoft"; then # -Oy- is equivalent to -fno-omit-frame-pointer in GCC/Clang. ASAN_CFLAGS="-fsanitize=address -Oy- -DADDRESS_SANITIZER" - # MSVC produces a warning if you pass -fsanitize=address to the linker. - ASAN_LDFLAGS="" + # MSVC produces a warning if you pass -fsanitize=address to the linker. It also complains + $ if -DEBUG is not passed to the linker when building with ASan. + ASAN_LDFLAGS="-debug" fi JVM_CFLAGS="$JVM_CFLAGS $ASAN_CFLAGS" JVM_LDFLAGS="$JVM_LDFLAGS $ASAN_LDFLAGS"