From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by sourceware.org (Postfix) with ESMTP id 17D5C3833037 for ; Wed, 2 Dec 2020 05:27:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 17D5C3833037 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-518-qcrpUfpVO1ikyfM8JqIODg-1; Wed, 02 Dec 2020 00:27:52 -0500 X-MC-Unique: qcrpUfpVO1ikyfM8JqIODg-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0975F1005D68; Wed, 2 Dec 2020 05:27:51 +0000 (UTC) Received: from localhost.localdomain (ovpn-112-145.phx2.redhat.com [10.3.112.145]) by smtp.corp.redhat.com (Postfix) with ESMTP id A9C245D6AD; Wed, 2 Dec 2020 05:27:50 +0000 (UTC) Subject: Re: [PATCH 1/2] Add TARGET_COMPUTE_MULTILIB hook to override multi-lib result. To: Kito Cheng , gcc-patches@gcc.gnu.org, kito.cheng@gmail.com, jimw@sifive.com References: <20201201092920.8677-1-kito.cheng@sifive.com> From: Jeff Law Message-ID: <4de87b8f-a84a-44b6-d08d-2a6fdba9f2c0@redhat.com> Date: Tue, 1 Dec 2020 22:27:50 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 In-Reply-To: <20201201092920.8677-1-kito.cheng@sifive.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Content-Language: en-US X-Spam-Status: No, score=-6.2 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, 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-List-Received-Date: Wed, 02 Dec 2020 05:27:56 -0000 On 12/1/20 2:29 AM, Kito Cheng wrote: > Create a new hook to let target could override the multi-lib result, > the motivation is RISC-V might have very complicated multi-lib re-use > rule*, which is hard to maintain and use current multi-lib scripts, > we even hit the "argument list too long" error when we tried to add more > multi-lib reuse rule. > > So I think it would be great to have a target specific way to determine > the multi-lib re-use rule, then we could write those rule in C, instead > of expand every possible case in MULTILIB_REUSE. > > * Here is an example for RISC-V multi-lib rules: > https://gist.github.com/kito-cheng/0289cd42d9a756382e5afeb77b42b73b > > gcc/ChangeLog: > > * common/common-target.def (compute_multilib): New. > * common/common-targhooks.c (default_compute_multilib): New. > * doc/tm.texi.in (TARGET_COMPUTE_MULTILIB): New. > * doc/tm.texi: Regen. > * gcc.c: Include common/common-target.h. > (set_multilib_dir) Call targetm_common.compute_multilib. > (SWITCH_LIVE): Move to opts.h. > (SWITCH_FALSE): Ditto. > (SWITCH_IGNORE): Ditto. > (SWITCH_IGNORE_PERMANENTLY): Ditto. > (SWITCH_KEEP_FOR_GCC): Ditto. > (struct switchstr): Ditto. > * opts.h (SWITCH_LIVE): Move from gcc.c. > (SWITCH_FALSE): Ditto. > (SWITCH_IGNORE): Ditto. > (SWITCH_IGNORE_PERMANENTLY): Ditto. > (SWITCH_KEEP_FOR_GCC): Ditto. > (struct switchstr): Ditto. Can this defer to gcc-12?  We're well into stage3 at this point. jeff