From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 72710 invoked by alias); 27 Jun 2017 16:14:59 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 72691 invoked by uid 89); 27 Jun 2017 16:14:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD,SPF_HELO_PASS,URIBL_RED autolearn=no version=3.3.2 spammy=3840, sweet X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 27 Jun 2017 16:14:57 +0000 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 mx1.redhat.com (Postfix) with ESMTPS id 26C767F3E4; Tue, 27 Jun 2017 16:14:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 26C767F3E4 Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=law@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 26C767F3E4 Received: from localhost.localdomain (ovpn-117-103.phx2.redhat.com [10.3.117.103]) by smtp.corp.redhat.com (Postfix) with ESMTP id D662C7DFC2; Tue, 27 Jun 2017 16:14:55 +0000 (UTC) Subject: Re: Fix genmultilib reuse rule checks for large sets of option combinations To: Joseph Myers , gcc-patches@gcc.gnu.org References: From: Jeff Law Message-ID: <594f5318-0661-76d5-dcb9-faaf11d8d8c2@redhat.com> Date: Tue, 27 Jun 2017 16:14:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2017-06/txt/msg02070.txt.bz2 On 06/08/2017 02:28 PM, Joseph Myers wrote: > genmultilib computes combination_space, a list of all combinations of > options in MULTILIB_OPTIONS that might have multilibs built for them > (some of which may end up not having multilibs built for them, and > some of those may end up being mapped to other multilibs with > MULTILIB_REUSE). It is then used to validate the right hand part of > MULTILIB_REUSE rules, checking with expr that combination_space > matches a basic regular expression derived from that right hand part. > > There are two problems with this approach to validation: > > * It requires that right hand part to have options in the same order > as in MULTILIB_OPTIONS, in contradiction to the documentation of > MULTILIB_REUSE saying that order does not matter there. > > * combination_space can be so large that the expr call fails with an > E2BIG error. I have a local ARM configuration with 40 multilibs but > 3840 combinations of options from MULTILIB_OPTIONS (so 3839 listed > in combination_space, since it doesn't list the default multilib) > and 996 MULTILIB_REUSE rules. This generates a combination_space > string longer than the Linux kernel's MAX_ARG_STRLEN (PAGE_SIZE * > 32, the limit on the length of a single argv string), so that expr > cannot be run. > > This patch changes the validation approach to generate a much shorter > extended regular expression for any sequence of multilib options in > any order, and uses that for the validation instead. > > Tested with a built for arm-none-eabi --with-multilib-list=aprofile > (as a configuration that uses MULTILIB_REUSE). > > 2017-06-08 Joseph Myers > > * genmultilib (combination_space): Remove variable. > Validate reuse rules against regular expression for any sequence > of multilib options in any order. Going to trust you on this :-) regexps are far from my sweet spot. jeff