From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: Re: Commit 7e90098 breaks Xen build on FreeBSD
Date: Tue, 25 Mar 2014 10:49:56 +0100 [thread overview]
Message-ID: <53315144.8030809@citrix.com> (raw)
In-Reply-To: <5331520D02000078000019DA@nat28.tlf.novell.com>
On 25/03/14 09:53, Jan Beulich wrote:
>>>> On 24.03.14 at 19:49, <roger.pau@citrix.com> wrote:
>> On 24/03/14 15:54, Jan Beulich wrote:
>>>>>> On 24.03.14 at 13:34, <roger.pau@citrix.com> 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
prev parent reply other threads:[~2014-03-25 9:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-24 12:34 Commit 7e90098 breaks Xen build on FreeBSD Roger Pau Monné
2014-03-24 12:41 ` Ian Campbell
2014-03-24 14:54 ` Jan Beulich
2014-03-24 18:49 ` Roger Pau Monné
2014-03-25 8:53 ` Jan Beulich
2014-03-25 9:49 ` Roger Pau Monné [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=53315144.8030809@citrix.com \
--to=roger.pau@citrix.com \
--cc=JBeulich@suse.com \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).