[V3,11/15] libctf: add libsframe to LDFLAGS and LIBS

Message ID 20221030074450.1956074-12-indu.bhagat@oracle.com
State Not Applicable
Headers
Series Definition and support for SFrame unwind format |

Checks

Context Check Description
snail/binutils-gdb-check fail Git am fail log

Commit Message

Indu Bhagat Oct. 30, 2022, 7:44 a.m. UTC
  [No changes in V3, V2]

bfd now depends on libsframe.

ChangeLog:

	* libctf/configure.ac:
	* libctf/configure: Regenerated
---
 libctf/configure    | 4 ++--
 libctf/configure.ac | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
  

Comments

Mike Frysinger Oct. 30, 2022, 1:27 p.m. UTC | #1
On 30 Oct 2022 00:44, Indu Bhagat via Binutils wrote:
> --- a/libctf/configure.ac
> +++ b/libctf/configure.ac
>
> -LDFLAGS="-L../bfd -L../libiberty $ZLIBDIR $LDFLAGS"
> +LDFLAGS="-L../bfd -L../libiberty -L../libsframe/.libs/ $ZLIBDIR $LDFLAGS"

libbfd is using libtool which generates libbfd.la which should contain the
libsframe linking info, so do you really need this manual -L ?  and if you
really do, doesn't -L../libsframe suffice ?

> -LIBS="-lbfd -liberty -lz $ZSTD_LIBS $intl $LIBS"
> +LIBS="-lbfd -liberty -lz -lsframe $ZSTD_LIBS $intl $LIBS"

similarly here, the libbfd->libsframe dependency should be tracked by the
libtool linker script ...
-mike
  
Indu Bhagat Oct. 31, 2022, 8:06 p.m. UTC | #2
On 10/30/22 06:27, Mike Frysinger wrote:
> On 30 Oct 2022 00:44, Indu Bhagat via Binutils wrote:
>> --- a/libctf/configure.ac
>> +++ b/libctf/configure.ac
>>
>> -LDFLAGS="-L../bfd -L../libiberty $ZLIBDIR $LDFLAGS"
>> +LDFLAGS="-L../bfd -L../libiberty -L../libsframe/.libs/ $ZLIBDIR $LDFLAGS"
> 
> libbfd is using libtool which generates libbfd.la which should contain the
> libsframe linking info, so do you really need this manual -L ?  and if you
> really do, doesn't -L../libsframe suffice ?
> 
>> -LIBS="-lbfd -liberty -lz $ZSTD_LIBS $intl $LIBS"
>> +LIBS="-lbfd -liberty -lz -lsframe $ZSTD_LIBS $intl $LIBS"
> 
> similarly here, the libbfd->libsframe dependency should be tracked by the
> libtool linker script ...

For this specific link in libctf/configure.ac for checking ELF support 
in BFD, libtool is not being used.
  
Nick Alcock Nov. 1, 2022, 6:57 p.m. UTC | #3
On 31 Oct 2022, Indu Bhagat spake thusly:

> On 10/30/22 06:27, Mike Frysinger wrote:
>> On 30 Oct 2022 00:44, Indu Bhagat via Binutils wrote:
>>> --- a/libctf/configure.ac
>>> +++ b/libctf/configure.ac
>>>
>>> -LDFLAGS="-L../bfd -L../libiberty $ZLIBDIR $LDFLAGS"
>>> +LDFLAGS="-L../bfd -L../libiberty -L../libsframe/.libs/ $ZLIBDIR $LDFLAGS"
>> libbfd is using libtool which generates libbfd.la which should contain the
>> libsframe linking info, so do you really need this manual -L ?  and if you
>> really do, doesn't -L../libsframe suffice ?
>> 
>>> -LIBS="-lbfd -liberty -lz $ZSTD_LIBS $intl $LIBS"
>>> +LIBS="-lbfd -liberty -lz -lsframe $ZSTD_LIBS $intl $LIBS"
>> similarly here, the libbfd->libsframe dependency should be tracked by the
>> libtool linker script ...
>
> For this specific link in libctf/configure.ac for checking ELF support in BFD, libtool is not being used.

Agreed. I always found this a bit of a drag, but libtool is *generated
by* configure so there's not really much we can do.
  
Andreas Schwab Nov. 1, 2022, 9:42 p.m. UTC | #4
On Nov 01 2022, Nick Alcock via Binutils wrote:

> Agreed. I always found this a bit of a drag, but libtool is *generated
> by* configure so there's not really much we can do.

You can use LT_OUTPUT to generate libtool, and subsequently use it for
further tests.
  
Nick Alcock Nov. 2, 2022, 1:16 p.m. UTC | #5
On 1 Nov 2022, Andreas Schwab outgrape:

> On Nov 01 2022, Nick Alcock via Binutils wrote:
>
>> Agreed. I always found this a bit of a drag, but libtool is *generated
>> by* configure so there's not really much we can do.
>
> You can use LT_OUTPUT to generate libtool, and subsequently use it for
> further tests.

Ooh thank you, I somehow overlooked the existence of that. I might well
adjust libctf configure accordingly in the near future.
  

Patch

diff --git a/libctf/configure b/libctf/configure
index 176b3d6b918..abe4cfe1eff 100755
--- a/libctf/configure
+++ b/libctf/configure
@@ -13218,9 +13218,9 @@  OLD_LIBS=$LIBS
 # always want our bfd.
 CFLAGS="-I${srcdir}/../include -I../bfd -I${srcdir}/../bfd $CFLAGS"
 ZLIBDIR=`echo $zlibdir | sed 's,\$(top_builddir)/,,g'`
-LDFLAGS="-L../bfd -L../libiberty $ZLIBDIR $LDFLAGS"
+LDFLAGS="-L../bfd -L../libiberty -L../libsframe/.libs/ $ZLIBDIR $LDFLAGS"
 intl=`echo $LIBINTL | sed 's,${top_builddir}/,,g'`
-LIBS="-lbfd -liberty -lz $ZSTD_LIBS $intl $LIBS"
+LIBS="-lbfd -liberty -lz -lsframe $ZSTD_LIBS $intl $LIBS"
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ELF support in BFD" >&5
 $as_echo_n "checking for ELF support in BFD... " >&6; }
 if ${ac_cv_libctf_bfd_elf+:} false; then :
diff --git a/libctf/configure.ac b/libctf/configure.ac
index 2e2ccf4b624..72b2ed7ea31 100644
--- a/libctf/configure.ac
+++ b/libctf/configure.ac
@@ -88,9 +88,9 @@  OLD_LIBS=$LIBS
 # always want our bfd.
 CFLAGS="-I${srcdir}/../include -I../bfd -I${srcdir}/../bfd $CFLAGS"
 ZLIBDIR=`echo $zlibdir | sed 's,\$(top_builddir)/,,g'`
-LDFLAGS="-L../bfd -L../libiberty $ZLIBDIR $LDFLAGS"
+LDFLAGS="-L../bfd -L../libiberty -L../libsframe/.libs/ $ZLIBDIR $LDFLAGS"
 intl=`echo $LIBINTL | sed 's,${top_builddir}/,,g'`
-LIBS="-lbfd -liberty -lz $ZSTD_LIBS $intl $LIBS"
+LIBS="-lbfd -liberty -lz -lsframe $ZSTD_LIBS $intl $LIBS"
 AC_CACHE_CHECK([for ELF support in BFD], ac_cv_libctf_bfd_elf,
 [AC_TRY_LINK([#include <stdlib.h>
 	     #include <string.h>