From: "Jan Beulich" Subject: Re: Commit 7e90098 breaks Xen build on FreeBSD Date: Tue, 25 Mar 2014 08:53:17 +0000 Message-ID: <5331520D02000078000019DA@nat28.tlf.novell.com> References: <5330263E.9060109@citrix.com> <5330551C0200007800001701@nat28.tlf.novell.com> <53307E3D.3030406@citrix.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__PartA496CBED.1__=" Return-path: In-Reply-To: <53307E3D.3030406@citrix.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: =?UTF-8?Q?Roger=20Pau=20Monn=C3=A9?= Cc: xen-devel List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__PartA496CBED.1__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline >>> 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] >>=20 >> Was this a fresh build, or an incremental one? >=20 > Fresh build. >=20 >>=20 >> 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. >=20 > I'm sure FreeBSD doesn't understand [ \t] as a tab, but I think there=20 > are other glitches with the current sed runes (just replacing \t with = a=20 > tab didn't solve the problem). I've done the following in order to=20 > compile it (tested with both both GNU and FreeBSD sed). If this looks=20 > plausible I can submit a proper patch. >=20 > 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=20 > $(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,$@) > =20 > -xlat-y :=3D $(shell sed -ne 's,@arch@,$(compat-arch-y),g' -e 's,^[?!][ = \t]\+[^ \t]\+[ \t]\+,,p' xlat.lst | uniq) > +xlat-y :=3D $(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,$@) =20 -xlat-y :=3D $(shell sed -ne 's,@arch@,$(compat-arch-y),g' -e 's,^[?!][ = \t]\+[^ \t]\+[ \t]\+,,p' xlat.lst | uniq) +xlat-y :=3D $(shell sed -ne 's,@arch@,$(compat-arch-y),g' -e 's,^[?!][[:bl= ank:]]\+[^[:blank:]]\+[[:blank:]]\+,,p' xlat.lst | uniq) xlat-y :=3D $(filter $(patsubst compat/%,%,$(headers-y)),$(xlat-y)) =20 compat/xlat.h: $(addprefix compat/.xlat/,$(xlat-y)) Makefile --=__PartA496CBED.1__= Content-Type: text/plain; name="build-include-sed-fix.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="build-include-sed-fix.patch" --- a/xen/include/Makefile=0A+++ b/xen/include/Makefile=0A@@ -76,10 +76,10 = @@ compat/.xlat/%.h: compat/%.h compat/.xla=0A .PRECIOUS: compat/.xlat/%.ls= t=0A compat/.xlat/%.lst: xlat.lst Makefile=0A mkdir -p $(@D)=0A- = grep -v '^[ \t]*#' $< | sed -ne 's,@arch@,$(compat-arch-y),g' -e 's,[ = \t]\+$*\.h[ \t]*$$,,p' >$@.new=0A+ grep -v '^[[:blank:]]*#' $< | sed = -ne 's,@arch@,$(compat-arch-y),g' -e 's,[[:blank:]]\+$*\.h[[:blank:]]*$$,,p= ' >$@.new=0A $(call move-if-changed,$@.new,$@)=0A =0A-xlat-y :=3D = $(shell sed -ne 's,@arch@,$(compat-arch-y),g' -e 's,^[?!][ \t]\+[^ \t]\+[ = \t]\+,,p' xlat.lst | uniq)=0A+xlat-y :=3D $(shell sed -ne 's,@arch@,$(compa= t-arch-y),g' -e 's,^[?!][[:blank:]]\+[^[:blank:]]\+[[:blank:]]\+,,p' = xlat.lst | uniq)=0A xlat-y :=3D $(filter $(patsubst compat/%,%,$(headers-y)= ),$(xlat-y))=0A =0A compat/xlat.h: $(addprefix compat/.xlat/,$(xlat-y)) = Makefile=0A --=__PartA496CBED.1__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --=__PartA496CBED.1__=--