From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 5eEJJ/GW7mSE4g0AWB0awg (envelope-from ) for ; Tue, 29 Aug 2023 21:10:09 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=tgt6ScRI; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 94E741E0C2; Tue, 29 Aug 2023 21:10:09 -0400 (EDT) Received: from server2.sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 82D1C1E028 for ; Tue, 29 Aug 2023 21:10:07 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E2A3D3858291 for ; Wed, 30 Aug 2023 01:10:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E2A3D3858291 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1693357806; bh=oY+p6Z1VDFG1eJMfZbE/ANxBWKagZhP7iSc7TIY09lY=; h=Date:To:Cc:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=tgt6ScRI3rMIpRj7dBHVfB5nt8IM0G0Op36s+TW+TT5Cuw/7sIiFKOWrxpitoE/+X pJkcD9rRnPfU2/OI+PtBbmGf++9oB+k3HmVEkBNNqz+0VZPjGdjYnd5T1yQ4VfaBxq vLlRnsGa8okkOGc/9HOZ6feRH+FJXLCKqRLqzrE8= Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) by sourceware.org (Postfix) with ESMTPS id 6C57C3858C53 for ; Wed, 30 Aug 2023 01:09:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6C57C3858C53 Received: by mail-pf1-x430.google.com with SMTP id d2e1a72fcca58-68a41035828so3597398b3a.1 for ; Tue, 29 Aug 2023 18:09:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693357777; x=1693962577; h=mime-version:subject:references:in-reply-to:message-id:cc:to:from :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=dPYAD+k2cj5MCN1HXFmU2QrflZyAB/XXxDfUtCOftIU=; b=b37IdpyaYFlHNm8bdlocIGFapQTDQygpIm2BdHIJS5qvkj0FHQqzYyK15WfP0/NSIn Uhs03G9Z3JIpk0KknlgwS8LvWhlV0Cu0F+Ri9QpzWIzo25xwfoKRc1P2iLuqvuwIeOCo /7p0PtCeCUhoKvGmhLDXxTIdxmzGnhcA9Qo2n7ghoXWiHrE62CNwy7aRaPiTK3k76YaZ mtIVZdZdNAwUEVBs64Eg0jM9BRiMGPSbT/4vjndKYVSZQg93ETVqX1tQ+Vtsccua5dsh SQnpzrkiAXGkD/LLF51ZCURWX3UUXeDPZvntIHAGqh5Ke1weZCk2ASCdSGFsZyvgh8FP P0zw== X-Gm-Message-State: AOJu0Yy4UMoXQACodcMWSxGuPxaq/a7zetDPijfzzJmRlHGBfgwQt7db 6osU+F1gvsgs6oIKWNvPd0fjgA== X-Google-Smtp-Source: AGHT+IG498ooi20OBJ4Qa7CIdr6UkrxR3WenT+n01U4MlmZlKTtFfWnLszxyJthxtQt45tLJov5DNg== X-Received: by 2002:a05:6a20:3d93:b0:13e:7a0a:36d8 with SMTP id s19-20020a056a203d9300b0013e7a0a36d8mr946687pzi.9.1693357777426; Tue, 29 Aug 2023 18:09:37 -0700 (PDT) Received: from [127.0.0.1] (111-249-65-35.dynamic-ip.hinet.net. [111.249.65.35]) by smtp.gmail.com with ESMTPSA id 9-20020a170902c14900b001bdb8c0b578sm9965380plj.192.2023.08.29.18.09.36 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 Aug 2023 18:09:36 -0700 (PDT) Date: Wed, 30 Aug 2023 09:09:29 +0800 To: Andrew Pinski Cc: binutils@sourceware.org, GDB Patches Message-ID: In-Reply-To: References: <20230829054210.80928-2-jerry.zhangjian@sifive.com> Subject: Re: [PATCH] download_prerequisites: New script port from GCC X-Readdle-Message-ID: e3b507b3-2f8f-4137-9d2a-3ea76a760e91@Spark MIME-Version: 1.0 X-Spam-Status: No, score=-10.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, HTML_FONT_LOW_CONTRAST, HTML_MESSAGE, KAM_LOTSOFHASH, KAM_SHORT, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.30 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Jerry ZJ via Gdb-patches Reply-To: Jerry ZJ Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" Hi, Andrew Thanks for the feedback. To my knowledge, gcc and binutils share the same= configure.ac and configure script. Is it possible for us to adopt the sa= me approach=3F Thanks, Jerry On Aug 29, 2023 at 13:52 +0800, Andrew Pinski , wrot= e: > On Mon, Aug 28, 2023 at 10:48=E2=80=AFPM Jerry Zhang Jian via Binutils > wrote: > > > > download=5Fprerequisites: add this script from GCC contrib/ folder to= help > > setting up the build dependencies for binutils > > GMP/M=46PR is not needed for building binutils but rather gdb. So I > added gdb-patches=40 . > Releases of binutils will not include the gdb directory either. > I think this is a good idea though it would be good to have a script > which checks to make sure the 2 versions (in gcc git and gdb-binutils > git) are kept the same. > > Thanks, > Andrew Pinski > > > > > Signed-off-by: Jerry Zhang Jian > > --- > > contrib/download=5Fprerequisites =7C 279 ++++++++++++++++++++++++++++= +++++ > > contrib/prerequisites.md5 =7C 4 + > > contrib/prerequisites.sha512 =7C 4 + > > 3 files changed, 287 insertions(+) > > create mode 100755 contrib/download=5Fprerequisites > > create mode 100644 contrib/prerequisites.md5 > > create mode 100644 contrib/prerequisites.sha512 > > > > diff --git a/contrib/download=5Fprerequisites b/contrib/download=5Fpr= erequisites > > new file mode 100755 > > index 00000000000..ed6c647fcfe > > --- /dev/null > > +++ b/contrib/download=5Fprerequisites > > =40=40 -0,0 +1,279 =40=40 > > +=23=21 /bin/sh > > +=23=21 -*- coding:utf-8; mode:shell-script; -*- > > + > > +=23 Download some prerequisites needed by GCC. > > +=23 Run this from the top level of the GCC source tree and the GCC b= uild will do > > +=23 the right thing. Run it with the =60--help=60 option for more in= formation. > > +=23 > > +=23 (C) 2010-2021 =46ree Software =46oundation > > +=23 > > +=23 This program is free software: you can redistribute it and/or mo= dify > > +=23 it under the terms of the GNU General Public License as publishe= d by > > +=23 the =46ree Software =46oundation, either version 3 of the Licens= e, or > > +=23 (at your option) any later version. > > +=23 > > +=23 This program is distributed in the hope that it will be useful, = but > > +=23 WITHOUT ANY WARRANTY; without even the implied warranty of > > +=23 MERCHANTABILITY or =46ITNESS =46OR A PARTICULAR PURPOSE. See the= GNU > > +=23 General Public License for more details. > > +=23 > > +=23 You should have received a copy of the GNU General Public Licens= e > > +=23 along with this program. If not, see http://www.gnu.org/licenses= /. > > + > > +program=3D'download=5Fprerequisites' > > +version=3D'(unversioned)' > > + > > +=23 MAINTAINERS: If you update the package versions below, please > > +=23 remember to also update the files =60contrib/prerequisites.sha51= 2=60 and > > +=23 =60contrib/prerequisites.md5=60 with the new checksums. > > + > > +gmp=3D'gmp-6.2.1.tar.bz2' > > +mpfr=3D'mpfr-4.1.0.tar.bz2' > > +mpc=3D'mpc-1.2.1.tar.gz' > > +isl=3D'isl-0.24.tar.bz2' > > + > > +base=5Furl=3D'http://gcc.gnu.org/pub/gcc/infrastructure/' > > + > > +echo=5Farchives() =7B > > + echo =22=24=7Bgmp=7D=22 > > + echo =22=24=7Bmpfr=7D=22 > > + echo =22=24=7Bmpc=7D=22 > > + if =5B =24=7Bgraphite=7D -gt 0 =5D; then echo =22=24=7Bisl=7D=22; f= i > > +=7D > > + > > +graphite=3D1 > > +verify=3D1 > > +force=3D0 > > +OS=3D=24(uname) > > + > > +if type wget > /dev/null ; then > > + fetch=3D'wget' > > +else > > + fetch=3D'curl -LO' > > +fi > > +chksum=5Fextension=3D'sha512' > > +directory=3D'.' > > + > > +helptext=3D=22usage: =24=7Bprogram=7D =5BOPTION...=5D > > + > > +Downloads some prerequisites needed by GCC. Run this from the top le= vel of the > > +GCC source tree and the GCC build will do the right thing. > > + > > +The following options are available: > > + > > + --directory=3DDIR download and unpack packages into DIR instead of = '.' > > + --force download again overwriting existing packages > > + --no-force do not download existing packages again (default) > > + --isl download ISL, needed for Graphite loop optimizations (default= ) > > + --graphite same as --isl > > + --no-isl don't download ISL > > + --no-graphite same as --no-isl > > + --verify verify package integrity after download (default) > > + --no-verify don't verify package integrity > > + --sha512 use SHA512 checksum to verify package integrity (default) > > + --md5 use MD5 checksum to verify package integrity > > + --help show this text and exit > > + --version show version information and exit > > +=22 > > + > > +versiontext=3D=22=24=7Bprogram=7D =24=7Bversion=7D > > +Copyright (C) 2016-2023 =46ree Software =46oundation, Inc. > > +This is free software; see the source for copying conditions. There = is NO > > +warranty; not even for MERCHANTABILITY or =46ITNESS =46OR A PARTICUL= AR PURPOSE.=22 > > + > > +die() =7B > > + echo =22error: =24=40=22 >&2 > > + exit 1 > > +=7D > > + > > +for arg in =22=24=40=22 > > +do > > + case =22=24=7Barg=7D=22 in > > + --help) > > + echo =22=24=7Bhelptext=7D=22 > > + exit > > + ;; > > + --version) > > + echo =22=24=7Bversiontext=7D=22 > > + exit > > + ;; > > + esac > > +done > > +unset arg > > + > > +=23 Emulate Linux's 'md5sum --check' on macOS > > +md5=5Fcheck() =7B > > + =23 Store the standard input: a line from contrib/prerequisites.md5= : > > + md5=5Fchecksum=5Fline=3D=24(cat -) > > + =23 Grab the text before the first space > > + md5=5Fchecksum=5Fexpected=3D=22=24=7Bmd5=5Fchecksum=5Fline%% *=7D=22= > > + =23 Grab the text after the first space > > + file=5Fto=5Fcheck=3D=22=24=7Bmd5=5Fchecksum=5Fline=23=23* =7D=22 > > + =23 Calculate the md5 checksum for the downloaded file > > + md5=5Fchecksum=5Foutput=3D=24(md5 -r =22=24=7Bfile=5Fto=5Fcheck=7D=22= ) > > + =23 Grab the text before the first space > > + md5=5Fchecksum=5Fdetected=3D=22=24=7Bmd5=5Fchecksum=5Foutput%% *=7D= =22 > > + =5B =22=24=7Bmd5=5Fchecksum=5Fexpected=7D=22 =3D =22=24=7Bmd5=5Fche= cksum=5Fdetected=7D=22 =5D =5C > > + =7C=7C die =22Cannot verify integrity of possibly corrupted file =24= =7Bfile=5Fto=5Fcheck=7D=22 > > + echo =22=24=7Bfile=5Fto=5Fcheck=7D: OK=22 > > +=7D > > + > > + > > +argnext=3D > > +for arg in =22=24=40=22 > > +do > > + if =5B =22x=24=7Bargnext=7D=22 =3D x =5D > > + then > > + case =22=24=7Barg=7D=22 in > > + --directory) > > + argnext=3D'directory' > > + ;; > > + --directory=3D*) > > + directory=3D=22=24=7Barg=23--directory=3D=7D=22 > > + ;; > > + --force) > > + force=3D1 > > + ;; > > + --no-force) > > + force=3D0 > > + ;; > > + --isl=7C--graphite) > > + graphite=3D1 > > + ;; > > + --no-isl=7C--no-graphite) > > + graphite=3D0 > > + ;; > > + --verify) > > + verify=3D1 > > + ;; > > + --no-verify) > > + verify=3D0 > > + ;; > > + --sha512) > > + chksum=5Fextension=3D'sha512' > > + verify=3D1 > > + ;; > > + --md5) > > + chksum=5Fextension=3D'md5' > > + verify=3D1 > > + ;; > > + -*) > > + die =22unknown option: =24=7Barg=7D=22 > > + ;; > > + *) > > + die =22too many arguments=22 > > + ;; > > + esac > > + else > > + case =22=24=7Barg=7D=22 in > > + -*) > > + die =22Missing argument for option --=24=7Bargnext=7D=22 > > + ;; > > + esac > > + case =22=24=7Bargnext=7D=22 in > > + directory) > > + directory=3D=22=24=7Barg=7D=22 > > + ;; > > + *) > > + die =22The impossible has happened=22 > > + ;; > > + esac > > + argnext=3D > > + fi > > +done > > +=5B =22x=24=7Bargnext=7D=22 =3D x =5D =7C=7C die =22Missing argument= for option --=24=7Bargnext=7D=22 > > +unset arg argnext > > + > > +case =24chksum=5Fextension in > > + sha512) > > + case =24OS in > > + =22Darwin=22=7C=22=46reeBSD=22=7C=22Dragon=46ly=22=7C=22AIX=22) > > + chksum=3D'shasum -a 512 --check' > > + ;; > > + =22OpenBSD=22) > > + chksum=3D'sha512 -c' > > + ;; > > + *) > > + chksum=3D'sha512sum -c' > > + ;; > > + esac > > + ;; > > + md5) > > + case =24OS in > > + =22Darwin=22) > > + chksum=3D'md5=5Fcheck' > > + ;; > > + *) > > + chksum=3D'md5sum -c' > > + ;; > > + esac > > + ;; > > + *) > > + die =22Unkown checksum =24chksum=5Fextension=22 > > + ;; > > +esac > > + > > +=5B -e ./binutils =5D =5C > > + =7C=7C die =22You must run this script in the top-level Binutils so= urce directory=22 > > + > > +=5B -d =22=24=7Bdirectory=7D=22 =5D =5C > > + =7C=7C die =22No such directory: =24=7Bdirectory=7D=22 > > + > > +for ar in =24(echo=5Farchives) > > +do > > + if =5B =24=7Bforce=7D -gt 0 =5D; then rm -f =22=24=7Bdirectory=7D/=24= =7Bar=7D=22; fi > > + =5B -e =22=24=7Bdirectory=7D/=24=7Bar=7D=22 =5D =5C > > + =7C=7C ( cd =22=24=7Bdirectory=7D=22 && =24=7Bfetch=7D --no-verbose= =22=24=7Bbase=5Furl=7D=24=7Bar=7D=22 ) =5C > > + =7C=7C die =22Cannot download =24=7Bar=7D from =24=7Bbase=5Furl=7D=22= > > +done > > +unset ar > > + > > +if =5B =24=7Bverify=7D -gt 0 =5D > > +then > > + chksumfile=3D=22contrib/prerequisites.=24=7Bchksum=5Fextension=7D=22= > > + =5B -r =22=24=7Bchksumfile=7D=22 =5D =7C=7C die =22No checksums ava= ilable=22 > > + for ar in =24(echo=5Farchives) > > + do > > + grep =22=24=7Bar=7D=22 =22=24=7Bchksumfile=7D=22 =5C > > + =7C ( cd =22=24=7Bdirectory=7D=22 && =24=7Bchksum=7D ) =5C > > + =7C=7C die =22Cannot verify integrity of possibly corrupted file =24= =7Bar=7D=22 > > + done > > + unset chksumfile > > +fi > > +unset ar > > + > > +for ar in =24(echo=5Farchives) > > +do > > + package=3D=22=24=7Bar%.tar*=7D=22 > > + if =5B =24=7Bforce=7D -gt 0 =5D; then rm -rf =22=24=7Bdirectory=7D/= =24=7Bpackage=7D=22; fi > > + case =24ar in > > + *.gz) > > + uncompress=3D'gzip -d' > > + ;; > > + *.bz2) > > + uncompress=3D'bzip2 -d' > > + ;; > > + *) > > + uncompress=3D'cat' > > + ;; > > + esac > > + =5B -e =22=24=7Bdirectory=7D/=24=7Bpackage=7D=22 =5D =5C > > + =7C=7C ( cd =22=24=7Bdirectory=7D=22 && =24uncompress <=22=24=7Bar=7D= =22 =7C tar -xf - ) =5C > > + =7C=7C die =22Cannot extract package from =24=7Bar=7D=22 > > + unset package > > +done > > +unset ar > > + > > +for ar in =24(echo=5Farchives) > > +do > > + target=3D=22=24=7Bdirectory=7D/=24=7Bar%.tar*=7D/=22 > > + linkname=3D=22=24=7Bar%-*=7D=22 > > + if =5B =24=7Bforce=7D -gt 0 =5D; then rm -f =22=24=7Blinkname=7D=22= ; fi > > + =5B -e =22=24=7Blinkname=7D=22 =5D =5C > > + =7C=7C ln -s =22=24=7Btarget=7D=22 =22=24=7Blinkname=7D=22 =5C > > + =7C=7C die =22Cannot create symbolic link =24=7Blinkname=7D --> =24= =7Btarget=7D=22 > > + unset target linkname > > +done > > +unset ar > > + > > +echo =22All prerequisites downloaded successfully.=22 > > diff --git a/contrib/prerequisites.md5 b/contrib/prerequisites.md5 > > new file mode 100644 > > index 00000000000..a20f986c2e0 > > --- /dev/null > > +++ b/contrib/prerequisites.md5 > > =40=40 -0,0 +1,4 =40=40 > > +28971fc21cf028042d4897f02fd355ea gmp-6.2.1.tar.bz2 > > +44b892bc5a45bafb4294d134e13aad1d mpfr-4.1.0.tar.bz2 > > +9f16c976c25bb0f76b50be749cd7a3a8 mpc-1.2.1.tar.gz > > +dd2f7b78e118c25bd96134a52aae7f4d isl-0.24.tar.bz2 > > diff --git a/contrib/prerequisites.sha512 b/contrib/prerequisites.sha= 512 > > new file mode 100644 > > index 00000000000..89541b9ad4d > > --- /dev/null > > +++ b/contrib/prerequisites.sha512 > > =40=40 -0,0 +1,4 =40=40 > > +8904334a3bcc5c896ececabc75cda9dec642e401fb5397c4992c4fabea5e962c9ce8= bd44e8e4233c34e55c8010cc28db0545f5f750cbdbb5f00af538dc763be9 gmp-6.2.1.ta= r.bz2 > > +410208ee0d48474c1c10d3d4a59decd2dfa187064183b09358ec4c4666e34d743831= 28436b404123b831e585d81a9176b24c7ced9d913967c5fce35d4040a0b4 mpfr-4.1.0.t= ar.bz2 > > +3279f813ab37f47fdcc800e4ac5f306417d07f539593ca715876e43e04896e1d5bce= ccfb288ef2908a3f24b760747d0dbd0392a24b9b341bc3e12082e5c836ee mpc-1.2.1.ta= r.gz > > +aab3bddbda96b801d0f56d2869f943157aad52a6f6e6a61745edd740234c635c3823= 1af20bc3f1a08d416a5e973a90e18249078ed8e4ae2f1d5de57658738e95 isl-0.24.tar= .bz2 > > -- > > 2.41.0 > >