From ce6de37172cadc3671c03423cb9dd3bb9d2be840 Mon Sep 17 00:00:00 2001 From: Justin King Date: Tue, 21 Feb 2023 21:15:43 +0000 Subject: [PATCH] 8303010: Add /DEBUG to LDFLAGS for MSVC with ASan Reviewed-by: erikj --- make/autoconf/jdk-options.m4 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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"