From patchwork Thu Feb 16 00:28:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans-Peter Nilsson X-Patchwork-Id: 57771 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp15296wrn; Wed, 15 Feb 2023 16:29:35 -0800 (PST) X-Google-Smtp-Source: AK7set9+fyNY3dfVJQkiftt/BE3gNU4Na+f+JNSLTbICyXVDklu5Qq0U/JcltfLQLSK02KTUIDAZ X-Received: by 2002:a17:906:9884:b0:888:6294:a1fa with SMTP id zc4-20020a170906988400b008886294a1famr4624219ejb.14.1676507375382; Wed, 15 Feb 2023 16:29:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676507375; cv=none; d=google.com; s=arc-20160816; b=rTVA9fcJjXT9ZdK4XdQgzs6EAcgIQ09bmR2laR7EoGINj/oe5WqNAGZW+ixdrM6FAQ MCf3Zqs0MunTX7HpwuTGMjYI+OYKrvgVGQNpcA+8RnCHvfgY0477RyVWlq4jeRBiwjhc fyntzyRyUDalkcDv2GMUzTFBcb8N7kcfBclKRfpxaHskwzcxZggenH7MAGD1/bEdXBPz LNTYuDQQAyGyjaUmR7TD9JbuXm+pOxpyVlPNUaVL6FVHyIlLdPyqMZAIHWjOVV5YveBf n5CX9Q5tlmWhKhXsfIpirH4sQc8dPN8zDPPh8fExoAOJMzp3imxMuSuiLEurYJEjBlYg wdkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:date:message-id :content-transfer-encoding:mime-version:subject:to:dmarc-filter :delivered-to:dkim-signature:dkim-filter; bh=17pA0lKP4ul+MGf2kX94dTLKLzSOZ66YxTFvB09RmdM=; b=yAEB5MHT8kl/6KE+VoEHeeoPb9FY7P0X12UtybWnM7pQea+V3pX+1uMn0nTTW2jQSd sIqlOhlWPG5D5UCIHya6v28WVBFujXuUBKrMqhfzc25bTd7bmT4QnBNz0SBL1Joj7IB6 ihsTd4lP9MJS+wKwwwOBi0fopYJ0hVB4EHBfwSSSuWaQ/rVYRSA7xiMlN73VI7T7VQqC GTOZRrL+Tdh29UA4wDZfb7qhM5Pp1UmDPFyhGHiEZJvwkLHxPITX799F6MOzkDCpB8ht W5Ed0u0y9Y//99iK9/Ub+h11XP9b2eJmxZ/p1l+uj/OMd4Zq4bZoTtP+OlHG4lLfNp/u ALiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=vG76UZZ1; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id mf8-20020a1709071a4800b008b1384001f8si137536ejc.520.2023.02.15.16.29.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Feb 2023 16:29:35 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=vG76UZZ1; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 272A23858D33 for ; Thu, 16 Feb 2023 00:29:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 272A23858D33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1676507374; bh=17pA0lKP4ul+MGf2kX94dTLKLzSOZ66YxTFvB09RmdM=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=vG76UZZ1etl12OITtaMEXL565lDIc7MNtKdie+BHE0G9V3wH2+InyYOMz0wJ2wvjM qP25SSCqxrxmpS1bFWE7dCf/bAHDQAV4+A7DIPgfliQrGPXscqtBBxAFuUUfXmsMlB lih9ACV4vSWSANMiTsTW3rQ8McAa+mlRnLCXaGZw= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp1.axis.com (smtp1.axis.com [195.60.68.17]) by sourceware.org (Postfix) with ESMTPS id 704053858C31 for ; Thu, 16 Feb 2023 00:28:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 704053858C31 To: Subject: [PATCH] objs-gcc.sh: Only bootstrap if source-directory contains gcc MIME-Version: 1.0 Message-ID: <20230216002846.E1B6A20441@pchp3.se.axis.com> Date: Thu, 16 Feb 2023 01:28:46 +0100 X-Spam-Status: No, score=-10.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, 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 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Hans-Peter Nilsson via Gcc-patches From: Hans-Peter Nilsson Reply-To: Hans-Peter Nilsson Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757945397552494565?= X-GMAIL-MSGID: =?utf-8?q?1757945397552494565?= TL;DR: committed as obvious. -- >8 -- I use objs-gcc.sh as a preparatory step before calling btest-gcc.sh in my scripts, for example my cris-elf autotester. I thought, why not use it for native builds too. Except that use, with binutils release-style tarballs and a x86_64-pc-linux-gnu host, was broken. Now that I look at it, the script seems to have aged poorly... Still, there's a need for such a script to install stuff needed for btest-gcc.sh (and to fix up stuff if needed), and this can still be that script. So, I prefer to fix show-stoppers for common uses, while taking care to retain compatibility for use that could possibly still work, with current sources. A long time ago (before 2011, but after this script was created in 2002, and used for a few years), the binutils (and gdb and gcc) toplevel Makefile may have had a bootstrap target that worked with binutils but didn't require gcc sources to be present. Now, you'll get an error (see configure.ac line 1366 and on). Let's just build the default make-target when "bootstrap" is known to fail. An alternative would be to fold this native non-i686-pc-linux-gnu clause into the native i686-pc-linux-gnu clause, as that seems to have been originally intended as *the* single native clause, but that'd require further edits (e.g. to remove install-dejagnu and make gdb build conditional on gdb sources presence, to work with binutils tarballs, and I'd also then prefer to build not just ld, but also gas and binutils). As it's a minimal obvious change required for current native use with release-tarballs and git-checkout use(*), I'm installing this as obvious. *) Native i686-pc-linux-gnu remains broken for other use than specially constructed combined trees where dejagnu is included at the toplevel (i.e. historic Cygnus devo-type). contrib/regression: * objs-gcc.sh: Only bootstrap if source-directory contains gcc. --- contrib/regression/objs-gcc.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/contrib/regression/objs-gcc.sh b/contrib/regression/objs-gcc.sh index ea7820f33fac..d205bab17368 100755 --- a/contrib/regression/objs-gcc.sh +++ b/contrib/regression/objs-gcc.sh @@ -106,7 +106,9 @@ if [ $H_REAL_TARGET = $H_REAL_HOST -a $H_REAL_TARGET = i686-pc-linux-gnu ] make all-gdb all-dejagnu all-ld || exit 1 make install-gdb install-dejagnu install-ld || exit 1 elif [ $H_REAL_TARGET = $H_REAL_HOST ] ; then - make bootstrap || exit 1 + H_MAKE_TARGET= + test -f $SOURCE/gcc/configure && H_MAKE_TARGET=bootstrap + make $H_MAKE_TARGET || exit 1 make install || exit 1 else make || exit 1