From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-oln040092075036.outbound.protection.outlook.com [40.92.75.36]) by sourceware.org (Postfix) with ESMTPS id 6B32F3844046 for ; Tue, 15 Dec 2020 15:10:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 6B32F3844046 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=hotmail.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=bernd.edlinger@hotmail.de ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hwk/MwRoCZx9cYnHMMpjz9neL3NV5eHCQvWDTl5cIOwX5NcPiavbh6Jz3nYw/PNLpBsQ6v0XCRtJmggbPleVS4JCHis3mdhIsVA/KCkUNHYOwOmCkS4XY6dkOk6hw5H8CjMTehcf5X40EzsEqPSxOqC6/F4EVAzkQRGtVv9y9mJ8JSzJ9nHg4A6CSlpPzUh7LDDsFKi8V4ampPO9+dPaoNFJ0u+g/ECOPgk39G+bp9B9C4Aep/2PwE0nRNhdc4fh8itqT+zFnjY5zvlDey5x9YTxnzsfamI4A6S8CBXtTPriX8mMi/Nq4yZRCugNU84+fXR0rNr/PhwyajSIjtok6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BPxxWEAfO4cOqm5JPv+bVB3vZBqWCscoQe2EGw+XJ08=; b=D77MKT4d+Z8Qli17rNLjPJ6/WCIEpv+88bTriFgWsowCBEs3oUVmgosC1/0ZYiMTY+BrD7v1cDwNq4AdImaRBw01j035gbYYr7r2/+Y7dygklGPPefhKl7NbAmD4lA7QGrgOuBM0B+SLGmqYT5rMbISTDWhmNhfzH1ytQuNsXuKVNnuvNbT19Hfgzwmn4kI6wXYxSkFt93iDu2q0KZwWJupOSnI3UjhPmmoFVel//BFVGBDKp9LWgwXW+IUIFRbvUrhaOCyHahnck9WzPJyYqHgZTJXJO1bAOZQYO9KUF4PEkSoGIE5eqlqXABVNezy5b/7yUu7E3ierSPElkItX+w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Received: from HE1EUR04FT018.eop-eur04.prod.protection.outlook.com (2a01:111:e400:7e0d::45) by HE1EUR04HT107.eop-eur04.prod.protection.outlook.com (2a01:111:e400:7e0d::182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3654.18; Tue, 15 Dec 2020 15:10:32 +0000 Received: from AM6PR03MB5170.eurprd03.prod.outlook.com (2a01:111:e400:7e0d::45) by HE1EUR04FT018.mail.protection.outlook.com (2a01:111:e400:7e0d::89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3654.12 via Frontend Transport; Tue, 15 Dec 2020 15:10:32 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:26C762E53359ADB89D7DE4D3BC7949E90E7AF68FF58839E7C7C63047C973091F; UpperCasedChecksum:8F45AA1004E16C51CEA23B98B281005263413A0A1E3BB60263484F30F5305664; SizeAsReceived:8898; Count:47 Received: from AM6PR03MB5170.eurprd03.prod.outlook.com ([fe80::184e:5e8c:db8f:a596]) by AM6PR03MB5170.eurprd03.prod.outlook.com ([fe80::184e:5e8c:db8f:a596%5]) with mapi id 15.20.3654.025; Tue, 15 Dec 2020 15:10:32 +0000 Subject: Re: [PATCH v2] Enable GDB build with in-tree GMP and MPFR To: Simon Marchi , Joel Brobecker , Pedro Alves , Eli Zaretskii , Andrew Burgess , "gdb-patches@sourceware.org" References: <1604817017-25807-1-git-send-email-brobecker@adacore.com> <1605429345-78384-2-git-send-email-brobecker@adacore.com> <20201116034518.GA609903@adacore.com> <20201118034455.GE617116@adacore.com> <71f5437f-c4f5-b58d-06f7-67a4d0b31007@simark.ca> <214e9564-5dfd-65a2-c2d8-6e8398ebc913@simark.ca> From: Bernd Edlinger Message-ID: Date: Tue, 15 Dec 2020 16:10:30 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 In-Reply-To: <214e9564-5dfd-65a2-c2d8-6e8398ebc913@simark.ca> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 7bit X-TMN: [IXRTGWOLfFr5EP5FsxwDMSJ3BsKHbDqT] X-ClientProxiedBy: AM3PR07CA0080.eurprd07.prod.outlook.com (2603:10a6:207:6::14) To AM6PR03MB5170.eurprd03.prod.outlook.com (2603:10a6:20b:ca::23) X-Microsoft-Original-Message-ID: <7a05d67f-3261-c002-0051-184534fea162@hotmail.de> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [192.168.1.101] (88.68.3.2) by AM3PR07CA0080.eurprd07.prod.outlook.com (2603:10a6:207:6::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3676.9 via Frontend Transport; Tue, 15 Dec 2020 15:10:31 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 47 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: e56058c2-adf9-4cf5-740d-08d8a10b9128 X-MS-TrafficTypeDiagnostic: HE1EUR04HT107: X-MS-Exchange-MinimumUrlDomainAge: gmplib.org#5039 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /rnNSZHmOmT6FuMOl6a/Li8QdWwOANYrB5vcF4wXn7050M7VyMu5chdmxYiOU5XRSNGeQR8h1NHqSmdOFB9vTCqMcSTWVjwJzBMMWbYusBVFdQWsdZB0VWW0OxW0e4I2UmFqege3+RcL11AMZ45gdBCJhdg65ojinahd9UJKfeQFTQN+7/S/oTC8S1dAfcCFVrAnW9EKhJVacaN5THL0DT6xEbyCO9DKULFs//5dil2aVXPe1ECTmXeySsTiMRyR X-MS-Exchange-AntiSpam-MessageData: aKtVmMyeJ/MUJ09OO4Xe2cj82vFZB/ppUKQuTgnTyjsvaDMY+NzNfwcx8+NDbEPZ1SPn7F7TcHn2lZVYqOqym+GEFSCgNID09aXT4jOlAnTSrxkHg1LfqBRvHFhHBlnD4bl5Y9N3u2iRsckJV8CKXw== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Dec 2020 15:10:32.3915 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-Network-Message-Id: e56058c2-adf9-4cf5-740d-08d8a10b9128 X-MS-Exchange-CrossTenant-AuthSource: HE1EUR04FT018.eop-eur04.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1EUR04HT107 X-Spam-Status: No, score=-8.8 required=5.0 tests=BAYES_00, FORGED_MUA_MOZILLA, FREEMAIL_FROM, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_MANYTO, MSGID_FROM_MTA_HEADER, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Dec 2020 15:10:37 -0000 On 12/14/20 7:47 PM, Simon Marchi wrote: > I'll give a shot at reviewing this, to make it progress. > > Joel, there's a question for you below. > > On 2020-12-14 12:40 p.m., Bernd Edlinger wrote: >> Well, >> >> I thought, I should add a few words in the README >> about this feature: >> >> diff --git a/gdb/README b/gdb/README >> index e65c5ea..db0a774 100644 >> --- a/gdb/README >> +++ b/gdb/README >> @@ -488,6 +488,9 @@ more obscure GDB `configure' options are not listed here. >> Build GDB using the GMP library installed at the directory DIR. >> If your host does not have GMP installed, you can get the latest >> version at `https://gmplib.org/'. >> + You can also build GMP in-tree when you use the script >> + ./contrib/download_prerequisites. Note however, that this >> + does only work with a separate build directory. >> >> `--with-mpfr' >> Build GDB with GNU MPFR, a library for multiple-precision >> @@ -499,6 +502,9 @@ more obscure GDB `configure' options are not listed here. >> available, GDB will fall back to using host floating-point >> arithmetic. If your host does not have GNU MPFR installed, you >> can get the latest version from `https://www.mpfr.org/'. >> + You can also build MPFR in-tree when you use the script >> + ./contrib/download_prerequisites. Note however, that this >> + does only work with a separate build directory. >> >> `--with-python[=PYTHON]' >> Build GDB with Python scripting support. (Done by default if >> >> >> Tested on x86_64-pc-linux-gnu. >> Is it OK for trunk? >> >> >> Thanks >> Bernd. >> > > There is already --with-libgmp-prefix / --without-libgmp-prefix, > provided (I think by): > > # Verify that we have a usable GMP library. > AC_LIB_HAVE_LINKFLAGS([gmp], [], [#include ], > [mpz_t n; > mpz_init (n);]) > > So with this patch, we now have: > > --with-gmp-include=DIR GMP include directory > --with-gmp-lib=DIR GMP lib directory > --with-gmp=DIR GMP install directory > --with-libgmp-prefix[=DIR] search for libgmp in DIR/include and DIR/lib > --without-libgmp-prefix don't search for libgmp in includedir and libdir > > I think that's getting a bit confusing. That's too many ways to set gmp > paths, with -with-libgmp-prefix and --with-gmp doing the same thing. > > If the rest of the binutils/gcc ecosystem already uses --with-gmp, > --with-gmp-include and --with-gmp-lib, I think we should align with > those. Fortunately, we haven't yet shipped a GDB with > --with-libgmp-prefix, so I think it's safe to remove it. It might mean > that we have to stop using AC_LIB_HAVE_LINKFLAGS though, or customize > it. Joel, do you agree? > > In this line, in top-level Makefile.def, do you need to also add > something about gmp, and why pass flags about mpc_mpfr (I sincerely > don't know what it is/does)? > > host_modules= { module= gdb; > extra_configure_flags='@extra_mpfr_configure_flags@ @extra_mpc_mpfr_configure_flags@';}; > Yes, the names for those macros are a bit funny :-) I just used existing macros to make the delta smaller in the top level config. extra_mpfr_configure_flags, are in fact the --with-gmp-include/lib parameters, that are passed to in-tree mpfr, and extra_mpc_mpfr_configure_flags, are the --with-mpfr-include/lib parameters, that are passed to in-tree mpc. I would like to rename those after merging this change and probably other changes to the gcc repository, and finally merge the gcc changes again to the binutils-gdb repository. The binutils toplevel configure files are 2 years behind gcc. But I think it is straight forward to make gdb/binutils/gcc build from the same source tree. I just tried this the other day, and just had a problem with --disable-source-highlight, but > In the README, you say: > > You can also build GMP in-tree when you use the script > ./contrib/download_prerequisites. Note however, that this > does only work with a separate build directory. > > That leaves me with some questions: > > - do I need to run this script myself before configure? > - if I do, does that mean the build will use the downloaded version, > even if there is a working version on my system? > > It would be good to answer those questions in the README text. > Yes. It is intended as a convenience, when you do not like to install the libraries on your system, or when you build for a cross-target, You should do that manually before configure when you would otherwise run into a build error. I will clarify that README text. Bernd. > An alternative to downloading the pre-requisites would be to check them > in the repo. We do it for readline already: there is a copy in the > repo, which is used by default, but you can specify > --with-system-readline if you want to use the system's readline. We > could do the same with gmp and mpfr. The downside is that we deviate a > bit from how gcc does, the the upside is that it's simpler, IMO. > > Note that any change to the files outside GDB will have to be approved > by the binutils folks too. And changes to the top-level Makefile will > have to be replicated to the gcc repo. > > Simon >