From patchwork Thu Sep 7 09:29:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 137627 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ab0a:0:b0:3f2:4152:657d with SMTP id m10csp2839413vqo; Thu, 7 Sep 2023 02:30:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFZJlIiEpfgADAk3A122j1vA3FAYL8Zlfk/5q53mU8G+bAcKstRu8HUrVaRFM0OjxSOjQqD X-Received: by 2002:a17:906:23e9:b0:9a2:276d:d84c with SMTP id j9-20020a17090623e900b009a2276dd84cmr4110181ejg.12.1694079010898; Thu, 07 Sep 2023 02:30:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694079010; cv=none; d=google.com; s=arc-20160816; b=aGfWYxjbqtyuSGb0e+bBxXNExRdoD8EX5DxYhfqOvEGGajqpA2P/qEIdz1gGrkuY2b SraAVewQ5oEECu88+vhgh7AR3ISNZKQW8P2SH6uAlMcthQdy2vdioXlkOv5JqJf1Hs84 jEWHPoFRx4EPG3zCGqCsTfHglBQqwfP+V/fTp6/Ir6hjLTgTl/TDBXWit2RgXqHukXJv UTj9qkO0HHSPpIUAsb6RlKcLxX2UpR++ybLrsybjw+dBJOT1PsD108vqfs9A1/paFQsI 2YA5yFSQZoUyzrfhGujaOHMeU9Z9cvn+R4xplW7Tg+uCHSYWsAu2rXZkGPLNfS7U7rKG pORw== 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:mime-version :user-agent:message-id:date:subject:mail-followup-to:to:dmarc-filter :delivered-to:dkim-signature:dkim-filter; bh=krdrJHARBA8EJW4EB66WdvOfMwj0jmi0iudEVGU92QE=; fh=hPrbWPhweUx4V0GV9uXJqbyAzg2ABmTz7kczrAQqMmM=; b=A+CbcpGswxAKZIg/ECRIWbzBDY3qL42zKgwOc6nxOe7aOV9U+aHeBPhvwqJXoZggJQ kOAdO1EiUy00XNqF04MlWPQ5x8j0Qi57wGc7kPJq5QbWoF2v+I2PaUs5TvOVIr2LtxDB Wzn0cNpbzIc0AE1fER+90FFl8e2+Vu/u82o0kxwxLU0ec2lAoApwccwM5Ly0/No8l34Y ikwf6fgh5DrsMMDNkWvT86G0ShK1RiLOkuJoD2uDvVeiRGSZXSnuyFE4RpPzVnUfvSEG RgiEoYsPUIkwE9iHTVkn66TSZTiOYR280F1zlDlc4nctqZmHmpngoM3wgboSB6rtrXMR 9RaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=yAWHAQDK; 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 (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id q22-20020a1709060e5600b0099cbfe8a383si11387338eji.779.2023.09.07.02.30.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Sep 2023 02:30:10 -0700 (PDT) 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=yAWHAQDK; 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 8D8A03858D35 for ; Thu, 7 Sep 2023 09:30:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8D8A03858D35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1694079009; bh=krdrJHARBA8EJW4EB66WdvOfMwj0jmi0iudEVGU92QE=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=yAWHAQDKEb2lg6jxylhat1yEOGL+5AGrfR4eHza1CiH+ohy4J7RgLgb8nluzqOxEy f87qV4YbONA/nXSnFqw7yBZ/z9kAd41KIfKdvZeTCnSmNPC9vuKAFS3rC0K2zN+wCh 8cxq7AVRbhAu76vLZSL8nwQWHUi3+E7oDO9txmv0= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by sourceware.org (Postfix) with ESMTP id 4E18B3858D1E for ; Thu, 7 Sep 2023 09:29:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4E18B3858D1E 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 D8D51153B for ; Thu, 7 Sep 2023 02:30:02 -0700 (PDT) Received: from localhost (e121540-lin.manchester.arm.com [10.32.110.72]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 8FC193F64C for ; Thu, 7 Sep 2023 02:29:24 -0700 (PDT) To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@arm.com Subject: [PATCH] Tweak language choice in config-list.mk Date: Thu, 07 Sep 2023 10:29:23 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 X-Spam-Status: No, score=-25.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_NONE, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, KAM_SHORT, 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 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Richard Sandiford via Gcc-patches From: Richard Sandiford Reply-To: Richard Sandiford Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776370592976962749 X-GMAIL-MSGID: 1776370592976962749 When I tried to use config-list.mk, the build for every triple except the build machine's failed for m2. This is because, unlike other languages, m2 builds target objects during all-gcc. The build will therefore fail unless you have access to an appropriate binutils (or an equivalent). That's quite a big ask for over 100 targets. :) This patch therefore makes m2 an optional inclusion. Doing that wasn't entirely straightforward though. The current configure line includes "--enable-languages=all,...", which means that the "..." can only force languages to be added that otherwise wouldn't have been. (I.e. the only effect of the "..." is to override configure autodetection.) The choice of all,ada and: # Make sure you have a recent enough gcc (with ada support) in your path so # that --enable-werror-always will work. make it clear that lack of GNAT should be a build failure rather than silently ignored. This predates the D frontend, which requires GDC in the same way that Ada requires GNAT. I don't know of a reason why D should be treated differently. The patch therefore expands the "all" into a specific list of languages. That in turn meant that Fortran had to be handled specially, since bpf and mmix don't support Fortran. Perhaps there's an argument that m2 shouldn't build target objects during all-gcc, but (a) it works for practical usage and (b) the patch is an easy workaround. I'd be happy for the patch to be reverted if the build system changes. OK to install? Richard gcc/ * contrib/config-list.mk (OPT_IN_LANGUAGES): New variable. ($(LIST)): Replace --enable-languages=all with a specifc list. Disable fortran on bpf and mmix. Enable the languages in OPT_IN_LANGUAGES. --- contrib/config-list.mk | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/contrib/config-list.mk b/contrib/config-list.mk index e570b13c71b..50ecb014bc0 100644 --- a/contrib/config-list.mk +++ b/contrib/config-list.mk @@ -12,6 +12,11 @@ TEST=all-gcc # supply an absolute path. GCC_SRC_DIR=../../gcc +# Define this to ,m2 if you want to build Modula-2. Modula-2 builds target +# objects during all-gcc, so it can only be included if you've installed +# binutils (or an equivalent) for each target. +OPT_IN_LANGUAGES= + # Use -j / -l make arguments and nice to assure a smooth resource-efficient # load on the build machine, e.g. for 24 cores: # svn co svn://gcc.gnu.org/svn/gcc/branches/foo-branch gcc @@ -126,17 +131,23 @@ $(LIST): make-log-dir TGT=`echo $@ | awk 'BEGIN { FS = "OPT" }; { print $$1 }'` && \ TGT=`$(GCC_SRC_DIR)/config.sub $$TGT` && \ case $$TGT in \ - *-*-darwin* | *-*-cygwin* | *-*-mingw* | *-*-aix* | bpf-*-*) \ + bpf-*-*) \ ADDITIONAL_LANGUAGES=""; \ ;; \ - *) \ + *-*-darwin* | *-*-cygwin* | *-*-mingw* | *-*-aix* | bpf-*-*) \ + ADDITIONAL_LANGUAGES=",fortran"; \ + ;; \ + mmix-*-*) \ ADDITIONAL_LANGUAGES=",go"; \ ;; \ + *) \ + ADDITIONAL_LANGUAGES=",fortran,go"; \ + ;; \ esac && \ $(GCC_SRC_DIR)/configure \ --target=$(subst SCRIPTS,`pwd`/../scripts/,$(subst OPT,$(empty) -,$@)) \ --enable-werror-always ${host_options} \ - --enable-languages=all,ada$$ADDITIONAL_LANGUAGES; \ + --enable-languages=c,ada,c++,d,lto,objc,obj-c++,rust$$ADDITIONAL_LANGUAGES$(OPT_IN_LANGUAGES); \ ) > log/$@-config.out 2>&1 $(LOGFILES) : log/%-make.out : %