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

Re: [Xen-devel] Commit 7e90098 breaks Xen build on FreeBSD



>>> On 24.03.14 at 19:49, <roger.pau@xxxxxxxxxx> wrote:
> On 24/03/14 15:54, Jan Beulich wrote:
>>>>> On 24.03.14 at 13:34, <roger.pau@xxxxxxxxxx> wrote:
>>> ...
>>> echo "#pragma pack()" >>compat/arch-x86_32.h.new; \
>>> echo "#endif /* $id */" >>compat/arch-x86_32.h.new
>>> mv -f compat/arch-x86_32.h.new compat/arch-x86_32.h
>>> cat  >compat/xlat.h.new
>>> [build stuck here]
>> 
>> Was this a fresh build, or an incremental one?
> 
> Fresh build.
> 
>> 
>> Irrespective of the answer, printing (e.g. via $(warning ...)) $^
>> (and maybe also $(xlat-y) right after it got set, since this may well
>> be a sed incompatibility) right before the problematic cat might shed
>> some light on this. It's suspicious that there's no mention of
>> compat/.xlat/ or get-fields.sh throughout the log you sent.
> 
> I'm sure FreeBSD doesn't understand [ \t] as a tab, but I think there 
> are other glitches with the current sed runes (just replacing \t with a 
> tab didn't solve the problem). I've done the following in order to 
> compile it (tested with both both GNU and FreeBSD sed). If this looks 
> plausible I can submit a proper patch.
> 
> diff --git a/xen/include/Makefile b/xen/include/Makefile
> index d6f0cf7..a1a08f7 100644
> --- a/xen/include/Makefile
> +++ b/xen/include/Makefile
> @@ -76,10 +76,10 @@ compat/.xlat/%.h: compat/%.h compat/.xlat/%.lst 
> $(BASEDIR)/tools/get-fields.sh M
>  .PRECIOUS: compat/.xlat/%.lst
>  compat/.xlat/%.lst: xlat.lst Makefile
>       mkdir -p $(@D)
> -     grep -v '^[ \t]*#' $< | sed -ne 's,@arch@,$(compat-arch-y),g' -e 's,[ 
> \t]\+$*\.h[ \t]*$$,,p' >$@.new
> +     grep -v '^[ \t]*#' $< | sed -ne 's,@arch@,$(compat-arch-y),g' -e 's,[   
> | ]$*\.h$$,,p' | awk '{ print $$1"\t"$$2 }' >$@.new

I guess you meant \( |  \) here?

>       $(call move-if-changed,$@.new,$@)
>  
> -xlat-y := $(shell sed -ne 's,@arch@,$(compat-arch-y),g' -e 's,^[?!][ \t]\+[^ 
> \t]\+[ \t]\+,,p' xlat.lst | uniq)
> +xlat-y := $(shell sed -ne 's,@arch@,$(compat-arch-y),g' -e '/^[?!]/p' 
> xlat.lst | awk '{ print $$3 }' | uniq)

And in both cases I'm not in favor of using two utilities if we can do with
one. Can you give the below a try instead (character classes are
documented to be supported by sed)?

Thanks, Jan

--- a/xen/include/Makefile
+++ b/xen/include/Makefile
@@ -76,10 +76,10 @@ compat/.xlat/%.h: compat/%.h compat/.xla
 .PRECIOUS: compat/.xlat/%.lst
 compat/.xlat/%.lst: xlat.lst Makefile
        mkdir -p $(@D)
-       grep -v '^[ \t]*#' $< | sed -ne 's,@arch@,$(compat-arch-y),g' -e 's,[ 
\t]\+$*\.h[ \t]*$$,,p' >$@.new
+       grep -v '^[[:blank:]]*#' $< | sed -ne 's,@arch@,$(compat-arch-y),g' -e 
's,[[:blank:]]\+$*\.h[[:blank:]]*$$,,p' >$@.new
        $(call move-if-changed,$@.new,$@)
 
-xlat-y := $(shell sed -ne 's,@arch@,$(compat-arch-y),g' -e 's,^[?!][ \t]\+[^ 
\t]\+[ \t]\+,,p' xlat.lst | uniq)
+xlat-y := $(shell sed -ne 's,@arch@,$(compat-arch-y),g' -e 
's,^[?!][[:blank:]]\+[^[:blank:]]\+[[:blank:]]\+,,p' xlat.lst | uniq)
 xlat-y := $(filter $(patsubst compat/%,%,$(headers-y)),$(xlat-y))
 
 compat/xlat.h: $(addprefix compat/.xlat/,$(xlat-y)) Makefile


Attachment: build-include-sed-fix.patch
Description: Text document

_______________________________________________
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®.