gdb: LoongArch: Remove nonportable #include
[binutils-gdb.git] / gdb / sanitize.m4
index 76df44da4fe9d6bf374d686a1ec49e3da3e1f4e1..4cd4e3f5305f7284b56d32b66380d08fdc9e6697 100644 (file)
@@ -1,5 +1,5 @@
 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
@@ -20,7 +20,7 @@ AC_DEFUN([AM_GDB_UBSAN],[
 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
@@ -34,7 +34,11 @@ if test "x$enable_ubsan" = xyes; then
   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