diff options
author | Ian Lance Taylor <iant@golang.org> | 2020-07-07 20:42:21 -0700 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2020-07-07 20:45:10 -0700 |
commit | fccb41b909cb207174d3270ce69e6729e2db28fa (patch) | |
tree | 0983e8f415b515bffdf36e763cde219b25b462a0 | |
parent | f60ee68de3d80459d319cc0418a1a860f48f0bc8 (diff) | |
download | gcc-fccb41b909cb207174d3270ce69e6729e2db28fa.zip gcc-fccb41b909cb207174d3270ce69e6729e2db28fa.tar.gz gcc-fccb41b909cb207174d3270ce69e6729e2db28fa.tar.bz2 |
libbacktrace: test linker support for DWARF 5
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
-rwxr-xr-x | libbacktrace/configure | 12 | ||||
-rw-r--r-- | libbacktrace/configure.ac | 4 |
2 files changed, 12 insertions, 4 deletions
diff --git a/libbacktrace/configure b/libbacktrace/configure index b453bae..37c38e7 100755 --- a/libbacktrace/configure +++ b/libbacktrace/configure @@ -13578,13 +13578,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 diff --git a/libbacktrace/configure.ac b/libbacktrace/configure.ac index bd16f20..c4b19c4 100644 --- a/libbacktrace/configure.ac +++ b/libbacktrace/configure.ac @@ -465,12 +465,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]) |