From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id CFDA13858408 for ; Thu, 10 Nov 2022 13:50:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CFDA13858408 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark.ca Received: from [10.0.0.11] (unknown [217.28.27.60]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id E12531E0D3; Thu, 10 Nov 2022 08:50:40 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1668088241; bh=gym3KtpuZD2IWVudr2PRMh7OZzakof598TVff9JN9Yc=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=LQ9BdYOiAf5oAZdbtgaK5pWiBxNj9S/4yoBRmxsEW3xVuUe6aPPwaxB2EHbCHb4bu 6tPMvcS/DnRrwBfFis/yAuHY7iOJc7tEzV5dKZN+RuIxOBKDhOBkksGwKfg6SyAeSA QiJcMNcM/zdPM3ZGXc+1P1N4JSMAoaA2J0vD+dI8= Message-ID: <5e940b15-cd5c-83b2-0bdd-9afa27b5f197@simark.ca> Date: Thu, 10 Nov 2022 08:50:40 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.1 Subject: Re: [PATCH] gdb: use libtool in GDB_AC_CHECK_BFD Content-Language: en-US To: "Jose E. Marchesi" , gdb-patches@sourceware.org Cc: indu.bhagat@oracle.com, elena.zannoni@oracle.com References: <20221107194634.1313150-1-jose.marchesi@oracle.com> From: Simon Marchi In-Reply-To: <20221107194634.1313150-1-jose.marchesi@oracle.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-11.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,NICE_REPLY_A,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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? Simon