From ebe4db6c971cc7babbc8365d13151171b7b118b5 Mon Sep 17 00:00:00 2001 From: orbea Date: Fri, 21 Apr 2023 10:39:21 -0700 Subject: [PATCH 2/2] libctf: 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. --- libctf/configure.ac | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/libctf/configure.ac b/libctf/configure.ac index 6a5eade1..b84b46f1 100644 --- a/libctf/configure.ac +++ b/libctf/configure.ac @@ -78,17 +78,12 @@ AM_CONDITIONAL(ENABLE_LIBCTF_HASH_DEBUGGING, test "${enable_libctf_hash_debuggin # Similar to 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. -CC="./libtool --quiet --mode=link $OLD_CC" +# Put the old CFLAGS last, in case the user's CFLAGS points somewhere +# with bfd, with -I/foo/lib and -L/foo/lib. We always want out 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" +LIBS="-L../bfd -lbfd -L../libiberty -liberty $intl $LIBS" AC_CACHE_CHECK([for ELF support in BFD], ac_cv_libctf_bfd_elf, [AC_TRY_LINK([#include #include @@ -99,9 +94,7 @@ AC_CACHE_CHECK([for ELF support in BFD], ac_cv_libctf_bfd_elf, [ac_cv_libctf_bfd_elf=yes], [ac_cv_libctf_bfd_elf=no])]) CFLAGS=$OLD_CFLAGS -LDFLAGS=$OLD_LDFLAGS LIBS=$OLD_LIBS -CC=$OLD_CC if test $ac_cv_libctf_bfd_elf = yes; then AC_DEFINE([HAVE_BFD_ELF], 1, -- 2.39.2