From f9927ebcc896c6acdad7457fa6c11ef723a1c992 Mon Sep 17 00:00:00 2001 From: orbea Date: Fri, 21 Apr 2023 10:34:16 -0700 Subject: [PATCH 1/2] gdb: Don't use libtool during configure When using alternative libtool implementations such as slibtool the configure process will fail to check for ELF support in BFD because it uses the hard coded libtool from configure.ac rather than slibtool which was used to build BFD. This can be solved by not using libtool here where the linker paths are changed to explicitly precede the appropriate linker flag to ensure the newly built BFD is used. --- gdb/acinclude.m4 | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/gdb/acinclude.m4 b/gdb/acinclude.m4 index 173e40b4..46b2b43f 100644 --- a/gdb/acinclude.m4 +++ b/gdb/acinclude.m4 @@ -227,17 +227,12 @@ dnl A link test is run. dnl HEADER is the name of an extra BFD header to include. AC_DEFUN([GDB_AC_CHECK_BFD], [ OLD_CFLAGS=$CFLAGS - OLD_LDFLAGS=$LDFLAGS OLD_LIBS=$LIBS - OLD_CC=$CC - # Put the old CFLAGS/LDFLAGS last, in case the user's (C|LD)FLAGS - # points somewhere with bfd, with -I/foo/lib and -L/foo/lib. We - # always want our bfd. + # Put the old CFLAGS last, in case the user's CFLAGS points somewhere + # bfd, with -I/foo/lib and -L/foo/lib. We always want our bfd. CFLAGS="-I${srcdir}/../include -I../bfd -I${srcdir}/../bfd $CFLAGS" - LDFLAGS="-L../bfd -L../libiberty $LDFLAGS" intl=`echo $LIBINTL | sed 's,${top_builddir}/,,g'` - LIBS="-lbfd -liberty $intl $LIBS" - CC="./libtool --quiet --mode=link $CC" + LIBS="-L../bfd -lbfd -L../libiberty -liberty $intl $LIBS" AC_CACHE_CHECK( [$1], [$2], @@ -253,9 +248,7 @@ AC_DEFUN([GDB_AC_CHECK_BFD], [ [[$2]=no] )] ) - CC=$OLD_CC CFLAGS=$OLD_CFLAGS - LDFLAGS=$OLD_LDFLAGS LIBS=$OLD_LIBS]) dnl GDB_GUILE_PROGRAM_NAMES([PKG-CONFIG], [VERSION]) -- 2.39.2