[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 02/34] xen: clang: Disable built-in assembler



At 08:14 +0000 on 28 Mar (1395990898), Jan Beulich wrote:
> >>> On 27.03.14 at 19:01, <tim@xxxxxxx> 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.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.