From: "Jose E. Marchesi" <jose.marchesi@oracle.com>
To: Simon Marchi <simark@simark.ca>
Cc: gdb-patches@sourceware.org, indu.bhagat@oracle.com,
elena.zannoni@oracle.com
Subject: Re: [PATCH] gdb: use libtool in GDB_AC_CHECK_BFD
Date: Thu, 10 Nov 2022 15:55:29 +0100 [thread overview]
Message-ID: <87bkpeuae6.fsf@oracle.com> (raw)
In-Reply-To: <5e940b15-cd5c-83b2-0bdd-9afa27b5f197@simark.ca> (Simon Marchi's message of "Thu, 10 Nov 2022 08:50:40 -0500")
> On 11/7/22 14:46, Jose E. Marchesi via Gdb-patches wrote:
>> The GDB_AC_CHECK_BFD macro defined in gdb/acinclude.m4 uses the
>> AC_LINK_IFELSE autoconf macro in order to link a simple program to
>> check features of libbfd.
>>
>> If libbfd's link dependencies change, it was necessary to reflect them
>> either in the definition of the macro, or as a consequence of checking
>> for them with an autoconf macro resulting in an addition to LIBS.
>>
>> This patch modifies the definition of the GDB_CHECK_BFD macro in order
>> to use libtool to perform the test link. This makes it possible to
>> not have to list dependencies of libbfd (which are indirect to GDB) at
>> all.
>>
>> After this patch:
>>
>> configure:28555: checking for ELF support in BFD
>> configure:28575: ./libtool --quiet --mode=link gcc -o conftest \
>> -I../../gdb/../include -I../bfd -I../../gdb/../bfd
>> -g -O2 -L../bfd -L../libiberty -L../zlib
>> conftest.c \
>> -lbfd -liberty -lz -lncursesw -lm -ldl >&5
>> configure:28575: $? = 0
>> configure:28585: result: yes
>> ---
>> gdb/acinclude.m4 | 3 +
>> gdb/configure | 1640 ++++++++++++++++++++++++++++++++++++++++++++++
>> gdb/configure.ac | 3 +
>> 3 files changed, 1646 insertions(+)
>>
>> diff --git a/gdb/acinclude.m4 b/gdb/acinclude.m4
>> index 62fa66c7af3..bbe86f51f4d 100644
>> --- a/gdb/acinclude.m4
>> +++ b/gdb/acinclude.m4
>> @@ -229,6 +229,7 @@ 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.
>> @@ -237,6 +238,7 @@ AC_DEFUN([GDB_AC_CHECK_BFD], [
>> LDFLAGS="-L../bfd -L../libiberty $ZLIBDIR $LDFLAGS"
>> intl=`echo $LIBINTL | sed 's,${top_builddir}/,,g'`
>> LIBS="-lbfd -liberty -lz $ZSTD_LIBS $intl $LIBS"
>
> So, can we remove $ZSTD_LIBS ands -lz here? I think GDB only needs them
> through BFD. And actually, can we remove them from gdb/Makefile.in too?
In the context of this macro, yes, we can remove -lz and $ZSTD_LIBS from
there. Will do, test, an send a new version.
About gdb/Makefile.in... dunno, $(ZLIB) is included in CLIBS. This
makes me think GDB uses zlib directly?
If it doesn't, I think you can remove:
1) The calls to AM_ZLIB and AC_ZSTD from gdb/configure.ac.
2) The definition of ZLIB and ZLIBINC from gdb/Makefile.in
3) ../config/zlib.m4 from aclocal_m4_deps in gdb/Makefile.in
next prev parent reply other threads:[~2022-11-10 14:59 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-07 19:46 Jose E. Marchesi
2022-11-10 10:02 ` Jose E. Marchesi
2022-11-10 13:50 ` Simon Marchi
2022-11-10 14:55 ` Jose E. Marchesi [this message]
2022-11-10 16:06 ` Tom Tromey
2022-11-10 16:35 ` Jose E. Marchesi
2022-11-10 17:11 ` Nick Alcock
2022-11-10 17:46 ` Simon Marchi
2022-11-11 13:17 ` Nix
2022-11-11 13:51 ` Simon Marchi
2022-11-14 13:56 ` Nick Alcock
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87bkpeuae6.fsf@oracle.com \
--to=jose.marchesi@oracle.com \
--cc=elena.zannoni@oracle.com \
--cc=gdb-patches@sourceware.org \
--cc=indu.bhagat@oracle.com \
--cc=simark@simark.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).