From patchwork Fri Jun 9 12:53:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Richard Earnshaw \(lists\)" X-Patchwork-Id: 103499 Delivered-To: patch@linaro.org Received: by 10.140.91.77 with SMTP id y71csp197919qgd; Fri, 9 Jun 2017 06:03:40 -0700 (PDT) X-Received: by 10.101.76.11 with SMTP id u11mr43155099pgq.109.1497013420520; Fri, 09 Jun 2017 06:03:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497013420; cv=none; d=google.com; s=arc-20160816; b=ak85jsuOUSxohxBp5nShSSReASmKwT3mXkJuUxD/Dt3xqmx2yJbmokUzBvwTytp1Nh dm2x7f6lpZuzvP5uafFWIXOVyjvXhrFktyxL58jYP+vd+fBjnNL6nDCxToS0jYFCj0Ee 2v7N6swQkfhN2x6VZtSJCAqwE0JBcn+YX8Vfr8Z+8zZqdgg8zY/1wcNdPd47lkyL+zP4 kKmfAfiV1+5yEHO9PRg0r+TxVRXjB99cAC/Hy+ir+7oc5a8N0H8pfrQccEQOX+KE1J5M opzG98a8YJsKUzmuVyoumgsFkJvK9U8IyHE4iakJpgfSH+g3qU+Whpwo2PqZPH/GfeP7 mdHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:references:in-reply-to:references:in-reply-to :message-id:date:subject:cc:to:from:delivered-to:sender:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mailing-list:dkim-signature:domainkey-signature :arc-authentication-results; bh=wvenNvNaQIi8lh109AHOHlRNkcn3WXFovIUrmy+bZ7M=; b=Onbo5nGW1rVVFZpZU2uDdoHi/dao/DTXkOuNh+cgWxhYjJuSD5fURR8Z40lpXB51XE kUc7ENjd5t9JoWxN6ta/TjPtr03uiHzrz3YyZTKGaIdzPOjgZjp4UYxbiUDKyr5qQaIh W2sx8R4mNeSsF7pHsc6dnlTJvMvKjYitFK1LwWfX8KoOPmNUHGBjOjDtRDA0ouw7Nc2T SP8yZkNJIG2nXws6n3ahu9+3tMh9lrwsmsTZxJjWEPsSzdhzcbJqj4DC23M0jAgFT+e2 Q8wMG1hOk/rjl8t1mXonhZWsvL8kkMHcX3nOnESUprQC6mD2eEPubqS1/OIr0iNWclj9 KMZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org; spf=pass (google.com: domain of gcc-patches-return-455543-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-455543-patch=linaro.org@gcc.gnu.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id m24si934714pfa.242.2017.06.09.06.03.40 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Jun 2017 06:03:40 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-455543-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org; spf=pass (google.com: domain of gcc-patches-return-455543-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-455543-patch=linaro.org@gcc.gnu.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references:mime-version:content-type; q=dns; s= default; b=mupP7n0s3pmZFtWyGAxGFYAp6+mNNFZ0B5q2ja/fFIfIO2Ehb0F3E pyvVCmRXaeGGq/WWKBF7etxBahleuSOfl6F63Lr1HMhljf3gX4IEUBir6keIdpjY i79zcPnJsR4OocINlJon0N+UZ5tc7014tIjX4oMgcqA474dB4M21fA= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references:mime-version:content-type; s=default; bh=KqDUwdIETHvIdEVHVtlK77awVZ8=; b=f+kpbuIV1wxpBzo5S7cbL01HIIQd Jra3V+OWmqDDEURoAEXQ9jpxcyA9t+diuDX3c61SQtG1VoperRYcUtilSZsbPW2f WQjxvyFw/2FiZEcgbxUsOetS9QUizA0MJMJu1BTmmr340IkXhxjsQDp9Uw0Bv8rz 0A3UiEOTk3M/fT0= Received: (qmail 100033 invoked by alias); 9 Jun 2017 12:55:01 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 87451 invoked by uid 89); 9 Jun 2017 12:54:41 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_SOFTFAIL autolearn=ham version=3.3.2 spammy=presents, 4668 X-HELO: eggs.gnu.org Received: from eggs.gnu.org (HELO eggs.gnu.org) (208.118.235.92) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 09 Jun 2017 12:54:38 +0000 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dJJQm-0007eL-4P for gcc-patches@gcc.gnu.org; Fri, 09 Jun 2017 08:54:25 -0400 Received: from foss.arm.com ([217.140.101.70]:47128) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dJJQl-0007Te-QN for gcc-patches@gcc.gnu.org; Fri, 09 Jun 2017 08:54:24 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 6A4322B; Fri, 9 Jun 2017 05:54:23 -0700 (PDT) Received: from e105689-lin.cambridge.arm.com (e105689-lin.cambridge.arm.com [10.2.207.32]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id ECAD23F3E1; Fri, 9 Jun 2017 05:54:22 -0700 (PDT) From: Richard Earnshaw To: gcc-patches@gcc.gnu.org Cc: Richard Earnshaw Subject: [PATCH 20/30] [genmultilib] Allow explicit periods to be escaped in MULTILIB_REUSE Date: Fri, 9 Jun 2017 13:53:49 +0100 Message-Id: <9d1582f19c9c87349cfee2d26145dcdb4bcba3cf.1497004220.git.Richard.Earnshaw@arm.com> In-Reply-To: References: In-Reply-To: References: MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 217.140.101.70 The MULTILIB_REUSE mapping rules are built up using periods to represent the placement of '=' signs in the command line syntax. This presents a problem if the option contains an explicit period because that is translated unconditionally. The result is that it is not currently possible to write a reuse rule that would match the ARMv8-M mainline architecture: -march=armv8-m.main To fix this, this patch allows an explicit period to be escaped by writing \. and by then preserving the period into the generated multilib header. * genmultilib (multilib_reuse): Allow an explicit period to be escaped with a backslash. Remove the backslash after substituting unescaped periods. * doc/fragments.texi (MULTILIB_REUSE): Document it. --- gcc/doc/fragments.texi | 10 ++++++---- gcc/genmultilib | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/gcc/doc/fragments.texi b/gcc/doc/fragments.texi index d68be7a..6aef553 100644 --- a/gcc/doc/fragments.texi +++ b/gcc/doc/fragments.texi @@ -160,10 +160,12 @@ A reuse rule is comprised of two parts connected by equality sign. The left part is the option set used to build multilib and the right part is the option set that will reuse this multilib. Both parts should only use options specified in @code{MULTILIB_OPTIONS} and the equality signs found in options -name should be replaced with periods. The order of options in the left part -matters and should be same with those specified in @code{MULTILIB_REQUIRED} or -aligned with the order in @code{MULTILIB_OPTIONS}. There is no such limitation -for options in the right part as we don't build multilib from them. +name should be replaced with periods. An explicit period in the rule can be +escaped by preceding it with a backslash. The order of options in the left +part matters and should be same with those specified in +@code{MULTILIB_REQUIRED} or aligned with the order in @code{MULTILIB_OPTIONS}. +There is no such limitation for options in the right part as we don't build +multilib from them. @code{MULTILIB_REUSE} is different from @code{MULTILIB_MATCHES} in that it sets up relations between two option sets rather than two options. Here is an diff --git a/gcc/genmultilib b/gcc/genmultilib index 2501f54..c8bcdf3 100644 --- a/gcc/genmultilib +++ b/gcc/genmultilib @@ -466,8 +466,8 @@ echo "static const char *const multilib_reuse_raw[] = {" for rrule in ${multilib_reuse}; do # The left part of the rule are the options we used to build multilib. # The right part of the rule are the options that can reuse this multilib. - combo=`echo ${rrule} | sed -e 's/=.*$//' -e 's/\./=/g'` - copts=`echo ${rrule} | sed -e 's/^.*=//' -e 's/\./=/g'` + combo=`echo ${rrule} | sed -e 's/=.*$//' -e 's/\([^\\]\)\./\1=/g' -e 's/\\\././g'` + copts=`echo ${rrule} | sed -e 's/^.*=//' -e 's/\([^\\]\)\./\1=/g' -e 's/\\\././g'` # The variable ${combinations} are the option combinations we will build # multilib from. If the combination in the left part of reuse rule isn't # in this variable, it means no multilib will be built for current reuse