]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libbacktrace: test linker support for DWARF 5
authorIan Lance Taylor <iant@golang.org>
Wed, 8 Jul 2020 03:42:21 +0000 (20:42 -0700)
committerIan Lance Taylor <iant@golang.org>
Wed, 8 Jul 2020 03:46:17 +0000 (20:46 -0700)
On AIX, the compiler supports DWARF 5 but the linker does not.

2020-07-07 Clement Chigot <clement.chigot@atos.net>

* configure.ac: Test linker support for DWARF5
* configure: Regenerate

libbacktrace/configure
libbacktrace/configure.ac

index 676adb89224e23a78bf406e02f32edbce8fc1ebc..28b9593342a98c01730781fe3d33312b7b7d45f3 100755 (executable)
@@ -13292,13 +13292,21 @@ CFLAGS="$CFLAGS -gdwarf-5"
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 int i;
+int
+main ()
+{
+return 0;
+  ;
+  return 0;
+}
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"; then :
   libbacktrace_cv_lib_dwarf5=yes
 else
   libbacktrace_cv_lib_dwarf5=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 CFLAGS=$CFLAGS_hold
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libbacktrace_cv_lib_dwarf5" >&5
index 3730d7c4b06f80d4a1c353fa68112ba6c3a7b1b2..afdd30774d0fd0325f5034b808e1f048cec6f9be 100644 (file)
@@ -420,12 +420,12 @@ AC_SUBST(PTHREAD_CFLAGS)
 
 AM_CONDITIONAL(HAVE_PTHREAD, test "$libgo_cv_lib_pthread" = yes)
 
-dnl Test whether the compiler supports the -gdwarf-5 option.
+dnl Test whether the compiler and the linker support the -gdwarf-5 option.
 AC_CACHE_CHECK([whether -gdwarf-5 is supported],
 [libbacktrace_cv_lib_dwarf5],
 [CFLAGS_hold=$CFLAGS
 CFLAGS="$CFLAGS -gdwarf-5"
-AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
+AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;], [return 0;])],
 [libbacktrace_cv_lib_dwarf5=yes],
 [libbacktrace_cv_lib_dwarf5=no])
 CFLAGS=$CFLAGS_hold])