[1/2] libctf: remove unnecessary zlib constructs

Message ID 20221209202118.4106688-2-indu.bhagat@oracle.com
State Accepted
Headers
Series Small improvements to libctf configure.ac |

Checks

Context Check Description
snail/binutils-gdb-check success Github commit url

Commit Message

Indu Bhagat Dec. 9, 2022, 8:21 p.m. UTC
  This dependency is managed via libtool.  So explicit addition to LDFLAGS
and LIBS is not necessary anymore.

ChangeLog:

	* libctf/configure: Regenerated.
	* libctf/configure.ac: remove zlib from LDFLAGS and LIBS.
---
 libctf/configure    | 5 ++---
 libctf/configure.ac | 5 ++---
 2 files changed, 4 insertions(+), 6 deletions(-)
  

Comments

Mike Frysinger Dec. 10, 2022, 1:07 a.m. UTC | #1
On 09 Dec 2022 12:21, Indu Bhagat via Binutils wrote:
> -ZLIBDIR=`echo $zlibdir | sed 's,\$(top_builddir)/,,g'`
> -LDFLAGS="-L../bfd -L../libiberty $ZLIBDIR $LDFLAGS"
> +LDFLAGS="-L../bfd -L../libiberty $LDFLAGS"

$ZLIBDIR is zlib related ...

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

... but $ZSTD_LIBS is zstd related, not zlib.

commit message only says zlib.

also, you're still calling AM_ZLIB & AC_ZSTD which should be removed.
-mike
  
Indu Bhagat Dec. 10, 2022, 6:55 a.m. UTC | #2
On 12/9/22 17:07, Mike Frysinger wrote:
> On 09 Dec 2022 12:21, Indu Bhagat via Binutils wrote:
>> -ZLIBDIR=`echo $zlibdir | sed 's,\$(top_builddir)/,,g'`
>> -LDFLAGS="-L../bfd -L../libiberty $ZLIBDIR $LDFLAGS"
>> +LDFLAGS="-L../bfd -L../libiberty $LDFLAGS"
> 
> $ZLIBDIR is zlib related ...
> 
>> -LIBS="-lbfd -liberty -lz $ZSTD_LIBS $intl $LIBS"
>> +LIBS="-lbfd -liberty $intl $LIBS"
> 
> ... but $ZSTD_LIBS is zstd related, not zlib.
> 
> commit message only says zlib.
> 

Oops, yes, the removal of $ZSTD_LIBS was unintentional.

> also, you're still calling AM_ZLIB & AC_ZSTD which should be removed.
> -mike

AM_ZLIB cannot be removed at this time from libctf/configure.ac. There 
was a discussion earlier on this matter in context of using libtool and 
GDB: https://sourceware.org/pipermail/gdb-patches/2022-November/193771.html

Regarding removal of AC_ZSTD, perhaps, yes. I will run some tests and 
send a separate patch.

Thanks!
  

Patch

diff --git a/libctf/configure b/libctf/configure
index d3d63407cf0..acd0298b24f 100755
--- a/libctf/configure
+++ b/libctf/configure
@@ -14579,10 +14579,9 @@  OLD_CC=$CC
 # always want our bfd.
 CC="./libtool --quiet --mode=link $OLD_CC"
 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 $LDFLAGS"
 intl=`echo $LIBINTL | sed 's,${top_builddir}/,,g'`
-LIBS="-lbfd -liberty -lz $ZSTD_LIBS $intl $LIBS"
+LIBS="-lbfd -liberty $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 ba4a144ce37..387826b82e1 100644
--- a/libctf/configure.ac
+++ b/libctf/configure.ac
@@ -90,10 +90,9 @@  OLD_CC=$CC
 # always want our bfd.
 CC="./libtool --quiet --mode=link $OLD_CC"
 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 $LDFLAGS"
 intl=`echo $LIBINTL | sed 's,${top_builddir}/,,g'`
-LIBS="-lbfd -liberty -lz $ZSTD_LIBS $intl $LIBS"
+LIBS="-lbfd -liberty $intl $LIBS"
 AC_CACHE_CHECK([for ELF support in BFD], ac_cv_libctf_bfd_elf,
 [AC_TRY_LINK([#include <stdlib.h>
 	     #include <string.h>