From patchwork Mon Jun 7 07:30:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Jacobson X-Patchwork-Id: 1488455 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=cfsmjqp8; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Fz4nS1JlWz9sT6 for ; Mon, 7 Jun 2021 17:31:55 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6913F383B839 for ; Mon, 7 Jun 2021 07:31:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6913F383B839 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1623051113; bh=6+Tkq0knD7wf7/lZvJxXPUcmggVWYB/Ijp5+v4Bmz0g=; h=Date:Subject:To:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=cfsmjqp8NIRIxr+zGEVjN5edQunGXO5bQu+tUPSZ6Zv/m9h92Q9g8ycriHlg4uWZk 8A3KnNHqSsZF/bDxKQXOJbIJvjGtfny2p6AMXvpRK6Z/t9O4nEUGHLlnWNpo2zq3dc bhTsVdCPcjTpMfdKt4FLcQMH0zch86spwfqdm89I= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from pv34p98im-ztdg02172101.me.com (pv34p98im-ztdg02172101.me.com [17.143.234.142]) by sourceware.org (Postfix) with ESMTPS id 28EC93839C41 for ; Mon, 7 Jun 2021 07:30:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 28EC93839C41 Received: from [10.0.1.18] (cpe-98-26-0-177.nc.res.rr.com [98.26.0.177]) by pv34p98im-ztdg02172101.me.com (Postfix) with ESMTPSA id 2CFB35400D6; Mon, 7 Jun 2021 07:30:44 +0000 (UTC) Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.7\)) Date: Mon, 7 Jun 2021 03:30:41 -0400 Subject: [PATCH] build: Implement --with-multilib-list for avr target Message-Id: <4962954C-5270-4192-A024-8DD212453BE5@me.com> To: gcc-patches@gcc.gnu.org X-Mailer: Apple Mail (2.3608.120.23.2.7) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.761 definitions=2021-06-07_06:2021-06-04, 2021-06-07 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-2009150000 definitions=main-2106070059 X-Spam-Status: No, score=-14.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, 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: 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: Matt Jacobson via Gcc-patches From: Matt Jacobson Reply-To: Matt Jacobson Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" The AVR target builds a lot of multilib variants of target libraries by default, and I found myself wanting to use the --with-multilib-list argument to limit what I was building, to shorten build times. This patch implements that option for the AVR target. Tested by configuring and building an AVR compiler and target libs on macOS. I don't have commit access, so if this patch is suitable, I'd need someone else to commit it for me. Thanks. gcc/ChangeLog: 2020-06-07 Matt Jacobson * config.gcc: For the AVR target, populate TM_MULTILIB_CONFIG. * config/avr/genmultilib.awk: Add ability to filter generated multilib list. * config/avr/t-avr: Pass TM_MULTILIB_CONFIG to genmultilib.awk. * configure.ac: Update help string for --with-multilib-list. * configure: Regenerate. diff --git a/gcc/config.gcc b/gcc/config.gcc index 6a349965c..fd83996a4 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -4201,6 +4201,13 @@ case "${target}" in fi ;; + avr-*-*) + # Handle --with-multilib-list. + if test "x${with_multilib_list}" != xdefault; then + TM_MULTILIB_CONFIG="${with_multilib_list}" + fi + ;; + csky-*-*) supported_defaults="cpu endian float" ;; diff --git a/gcc/config/avr/genmultilib.awk b/gcc/config/avr/genmultilib.awk index 2d07c0e53..ad8814602 100644 --- a/gcc/config/avr/genmultilib.awk +++ b/gcc/config/avr/genmultilib.awk @@ -67,6 +67,16 @@ BEGIN { dir_long_double = "long-double" (96 - with_long_double) opt_long_double = "mlong-double=" (96 - with_long_double) + + if (with_multilib_list != "") + { + split(with_multilib_list, multilib_list, ",") + + for (i in multilib_list) + { + multilibs[multilib_list[i]] = 1 + } + } } ################################################################## @@ -137,6 +147,9 @@ BEGIN { if (core == "avr1") next + if (with_multilib_list != "" && !(core in multilibs)) + next + option[core] = "mmcu=" core m_options = m_options m_sep option[core] @@ -150,6 +163,9 @@ BEGIN { if (core == "avr1") next + if (with_multilib_list != "" && !(core in multilibs)) + next + opts = option[core] # split device specific feature list diff --git a/gcc/config/avr/t-avr b/gcc/config/avr/t-avr index 3e1a1ba68..7d20c6107 100644 --- a/gcc/config/avr/t-avr +++ b/gcc/config/avr/t-avr @@ -127,6 +127,7 @@ t-multilib-avr: $(srcdir)/config/avr/genmultilib.awk \ -v HAVE_LONG_DOUBLE64=$(HAVE_LONG_DOUBLE64) \ -v with_double=$(WITH_DOUBLE) \ -v with_long_double=$(WITH_LONG_DOUBLE) \ + -v with_multilib_list=$(TM_MULTILIB_CONFIG) \ -f $< $< $(AVR_MCUS) > $@ include t-multilib-avr diff --git a/gcc/configure.ac b/gcc/configure.ac index 715fcba04..c3ed65df7 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -1106,7 +1106,7 @@ if test x"$enable_hsa" = x1 ; then fi AC_ARG_WITH(multilib-list, -[AS_HELP_STRING([--with-multilib-list], [select multilibs (AArch64, SH and x86-64 only)])], +[AS_HELP_STRING([--with-multilib-list], [select multilibs (AArch64, AVR, i386, or1k, RISC-V, SH, and x86-64 only)])], :, with_multilib_list=default)