From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tim Deegan Subject: Re: [PATCH 02/34] xen: clang: Disable built-in assembler Date: Fri, 28 Mar 2014 12:28:54 +0100 Message-ID: <20140328112854.GB87844@deinos.phlegethon.org> References: <1395766541-23979-1-git-send-email-julien.grall@linaro.org> <1395766541-23979-3-git-send-email-julien.grall@linaro.org> <5332CDE00200007800002490@nat28.tlf.novell.com> <20140326131625.GB7885@deinos.phlegethon.org> <5332ED80.5070305@linaro.org> <533300BC02000078000027D4@nat28.tlf.novell.com> <20140327180134.GN91759@deinos.phlegethon.org> <53353D9202000078000033F6@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WTUy7-0006rU-8r for xen-devel@lists.xenproject.org; Fri, 28 Mar 2014 11:29:03 +0000 Content-Disposition: inline In-Reply-To: <53353D9202000078000033F6@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: xen-devel@lists.xenproject.org, Keir Fraser , Julien Grall , stefano.stabellini@citrix.com, ian.campbell@citrix.com List-Id: xen-devel@lists.xenproject.org At 08:14 +0000 on 28 Mar (1395990898), Jan Beulich wrote: > >>> On 27.03.14 at 19:01, wrote: > > The patch below works for me (at least as far as building > > asm-offsets.h on x86) by wrapping everything in a string. I did try > > just prefixing with '#' but clang 3.5 also strips the comments out. > > That seems unhelpful, since I know some people put comments in their > > inline assembler too. :( > > Looks generally okay, but in order for it to be as simple (and hence > understandable) as possible ... > > > --- a/xen/Makefile > > +++ b/xen/Makefile > > @@ -150,7 +150,7 @@ include/asm-$(TARGET_ARCH)/asm-offsets.h: arch/$(TARGET_ARCH)/asm-offsets.s > > echo "#ifndef __ASM_OFFSETS_H__"; \ > > echo "#define __ASM_OFFSETS_H__"; \ > > echo ""; \ > > - sed -ne "/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}"; \ > > + sed -ne "/==>/{s:^.*==>\(.*\)<==.*:\1:; s:^\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; p;}"; \ > > ... I think you should drop the ^ anchoring here, at least for the first > expression (.* will match from the beginning of the string anyway). Ack, will do. > I also wonder whether, now that we're intending to make use of it > elsewhere anyway, you shouldn't pass -r too, allowing all the escapes > on the parentheses to be dropped. OK. Do you think it would be worth shuffling most of the creation of the #define into the C side too? I think we can do everything except the $ or # prefix of the immediate value. That would leave the RE looking something like this: sed -ner "/==>/{s:.*==>(.*)<==.*:\1:; s:[\$$#]::; p;}". Cheers, Tim.