From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= Subject: Re: Commit 7e90098 breaks Xen build on FreeBSD Date: Tue, 25 Mar 2014 10:49:56 +0100 Message-ID: <53315144.8030809@citrix.com> References: <5330263E.9060109@citrix.com> <5330551C0200007800001701@nat28.tlf.novell.com> <53307E3D.3030406@citrix.com> <5331520D02000078000019DA@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <5331520D02000078000019DA@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 List-Id: xen-devel@lists.xenproject.org On 25/03/14 09:53, Jan Beulich wrote: >>>> On 24.03.14 at 19:49, wrote: >> On 24/03/14 15:54, Jan Beulich wrote: >>>>>> On 24.03.14 at 13:34, 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)? Yes, this is better, but still not fully working. The problem seems to come from BSD sed not correctly parsing the escaped '+', and the fact that those are extended regular expressions, so '-r' has to be passed to sed. The following is working on both FreeBSD and Linux: --- diff --git a/xen/include/Makefile b/xen/include/Makefile index d6f0cf7..f7ccbc9 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 '^[[:blank:]]*#' $< | sed -ne 's,@arch@,$(compat-arch-y),g' -re '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' -re '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