From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by sourceware.org (Postfix) with ESMTP id 22B773858D39 for ; Wed, 4 Jan 2023 14:50:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 22B773858D39 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=foss.arm.com Authentication-Results: sourceware.org; spf=none smtp.mailfrom=foss.arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 76C991063; Wed, 4 Jan 2023 06:50:50 -0800 (PST) Received: from [10.57.45.58] (unknown [10.57.45.58]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 09EB63F587; Wed, 4 Jan 2023 06:50:07 -0800 (PST) Message-ID: <55bc5097-8f31-655d-032d-3a90f1fd0b55@foss.arm.com> Date: Wed, 4 Jan 2023 14:50:06 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH] configure: remove dependencies on gmp and mpfr when gdb is disabled To: =?UTF-8?Q?Cl=c3=a9ment_Chigot?= , Andrew Pinski Cc: binutils@sourceware.org, nickc@redhat.com References: <20230103135330.1225218-1-chigot@adacore.com> Content-Language: en-GB From: Richard Earnshaw In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3496.6 required=5.0 tests=BAYES_00,GIT_PATCH_0,KAM_DMARC_STATUS,KAM_LAZY_DOMAIN_SECURITY,NICE_REPLY_A,SPF_HELO_NONE,SPF_NONE,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 04/01/2023 07:51, Clément Chigot via Binutils wrote: > Hi Andrew, > > On Tue, Jan 3, 2023 at 6:41 PM Andrew Pinski wrote: >> >> On Tue, Jan 3, 2023 at 5:53 AM Clément Chigot wrote: >>> >>> Since 991180627851801f1999d1ebbc0e569a17e47c74, the configure checks >>> about GMP and MPFR for gdb builds have been moved to the toplevel >>> configure. >>> However, it doesn't take into account the --disable-gdb option. Meaning >>> that a build without gdb will require these libraries even if not >>> needed. >> >> I see the conversion of enable_gdb to noconfigdirs is not done until >> later or I would have suggested the patch below. >> Though I wonder if we should rearrange configure.ac but maybe that is >> post GCC 13 branching off. > > That might be a good idea. But for now, I would rather fix the build > of binutils rapidly, if you don't mind. > > For my personal knowledge, why are the GCC directories being > "configurable" with the binutils configure ? I find it weird to have > --enable-libgo in binutils configure. The top-level configure framework supports a 'unified' build tree containing sources for all the GNU toolchain components. I for one still use that. R. > > Clément > >> Thanks, >> Andrew Pinski >> >> diff --git a/configure.ac b/configure.ac >> index 3a1eb0357e5..cbfc21eb2e9 100644 >> --- a/configure.ac >> +++ b/configure.ac >> @@ -1585,7 +1585,9 @@ if test -d ${srcdir}/gcc ; then >> require_mpc=yes >> fi >> if test -d ${srcdir}/gdb ; then >> - require_gmp=yes >> + case "${noconfigdirs}" in >> + *gdb*) require_gmp=yes ;; >> + esac >> fi >> >> gmplibs="-lmpfr -lgmp" >> >>> >>> ChangeLog: >>> >>> * configure.ac: Skip GMP and MPFR errors when --disable-gdb is >>> provided. >>> * configure: Regenerate. >>> --- >>> configure | 4 +++- >>> configure.ac | 4 +++- >>> 2 files changed, 6 insertions(+), 2 deletions(-) >>> >>> diff --git a/configure b/configure >>> index 417fc5a970c..0fb8279cb8f 100755 >>> --- a/configure >>> +++ b/configure >>> @@ -8426,11 +8426,13 @@ you obtained GMP, MPFR and/or MPC from a vendor distribution package, >>> make sure that you have installed both the libraries and the header >>> files. They may be located in separate packages." "$LINENO" 5 >>> else >>> - as_fn_error $? "Building GDB requires GMP 4.2+, and MPFR 3.1.0+. >>> + if test "x$enable_gdb" != xno; then >>> + as_fn_error $? "Building GDB requires GMP 4.2+, and MPFR 3.1.0+. >>> Try the --with-gmp and/or --with-mpfr options to specify >>> their locations. If you obtained GMP and/or MPFR from a vendor >>> distribution package, make sure that you have installed both the libraries >>> and the header files. They may be located in separate packages." "$LINENO" 5 >>> + fi >>> fi >>> fi >>> fi >>> diff --git a/configure.ac b/configure.ac >>> index 3a1eb0357e5..0ec2fffcb56 100644 >>> --- a/configure.ac >>> +++ b/configure.ac >>> @@ -1814,11 +1814,13 @@ you obtained GMP, MPFR and/or MPC from a vendor distribution package, >>> make sure that you have installed both the libraries and the header >>> files. They may be located in separate packages.]) >>> else >>> - AC_MSG_ERROR([Building GDB requires GMP 4.2+, and MPFR 3.1.0+. >>> + if test "x$enable_gdb" != xno; then >>> + AC_MSG_ERROR([Building GDB requires GMP 4.2+, and MPFR 3.1.0+. >>> Try the --with-gmp and/or --with-mpfr options to specify >>> their locations. If you obtained GMP and/or MPFR from a vendor >>> distribution package, make sure that you have installed both the libraries >>> and the header files. They may be located in separate packages.]) >>> + fi >>> fi >>> fi >>> fi >>> -- >>> 2.25.1 >>>