dnl Sanitization-related configure macro for GDB
-dnl Copyright (C) 2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2018-2022 Free Software Foundation, Inc.
dnl
dnl This file is part of GDB.
dnl
AC_ARG_ENABLE(ubsan,
AS_HELP_STRING([--enable-ubsan],
[enable undefined behavior sanitizer (auto/yes/no)]),
- [],enable_ubsan=auto)
+ [],enable_ubsan=no)
if test "x$enable_ubsan" = xauto; then
if $development; then
enable_ubsan=yes
dnl A link check is required because it is possible to install gcc
dnl without libubsan, leading to link failures when compiling with
dnl -fsanitize=undefined.
- AC_TRY_LINK([],[],enable_ubsan=yes,enable_ubsan=no)
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM([], [])],
+ [enable_ubsan=yes],
+ [enable_ubsan=no]
+ )
CXXFLAGS="$saved_CXXFLAGS"
AC_MSG_RESULT($enable_ubsan)
if test "x$enable_ubsan" = xyes; then