Skip to content

Commit aaa51b6

Browse files
libbacktrace: test linker support for DWARF 5
On AIX, the compiler supports DWARF 5 but the linker does not. 2020-07-07 Clement Chigot <[email protected]> * configure.ac: Test linker support for DWARF5 * configure: Regenerate
1 parent 9b7f216 commit aaa51b6

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

configure

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12678,13 +12678,21 @@ CFLAGS="$CFLAGS -gdwarf-5"
1267812678
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1267912679
/* end confdefs.h. */
1268012680
int i;
12681+
int
12682+
main ()
12683+
{
12684+
return 0;
12685+
;
12686+
return 0;
12687+
}
1268112688
_ACEOF
12682-
if ac_fn_c_try_compile "$LINENO"; then :
12689+
if ac_fn_c_try_link "$LINENO"; then :
1268312690
libbacktrace_cv_lib_dwarf5=yes
1268412691
else
1268512692
libbacktrace_cv_lib_dwarf5=no
1268612693
fi
12687-
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12694+
rm -f core conftest.err conftest.$ac_objext \
12695+
conftest$ac_exeext conftest.$ac_ext
1268812696
CFLAGS=$CFLAGS_hold
1268912697
fi
1269012698
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libbacktrace_cv_lib_dwarf5" >&5

configure.ac

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -461,12 +461,12 @@ AC_SUBST(PTHREAD_CFLAGS)
461461

462462
AM_CONDITIONAL(HAVE_PTHREAD, test "$libgo_cv_lib_pthread" = yes)
463463

464-
dnl Test whether the compiler supports the -gdwarf-5 option.
464+
dnl Test whether the compiler and the linker support the -gdwarf-5 option.
465465
AC_CACHE_CHECK([whether -gdwarf-5 is supported],
466466
[libbacktrace_cv_lib_dwarf5],
467467
[CFLAGS_hold=$CFLAGS
468468
CFLAGS="$CFLAGS -gdwarf-5"
469-
AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
469+
AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;], [return 0;])],
470470
[libbacktrace_cv_lib_dwarf5=yes],
471471
[libbacktrace_cv_lib_dwarf5=no])
472472
CFLAGS=$CFLAGS_hold])

0 commit comments

Comments
 (0)