From: Wei Liu <wei.liu2@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
Wei Liu <wei.liu2@citrix.com>,
Ian Jackson <Ian.Jackson@eu.citrix.com>,
Xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH v3 1/2] fuzz/x86emul: avoid race in link farm rune
Date: Mon, 20 Feb 2017 14:05:55 +0000 [thread overview]
Message-ID: <20170220140555.hso4n37f3musvq3p@citrix.com> (raw)
In-Reply-To: <58AAF134020000780013BD3D@prv-mh.provo.novell.com>
On Mon, Feb 20, 2017 at 05:37:56AM -0700, Jan Beulich wrote:
> >>> On 20.02.17 at 13:05, <wei.liu2@citrix.com> wrote:
> > Several `ln -sf` can race with each other and cause error like:
> >
> > 14:43:56 00:07:06 O: ln: cannot remove 'asm': No such file or directory
> >
> > Provide dedicated targets for soft-linking directories.
> >
> > Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
> > Signed-off-by: Wei Liu <wei.liu2@citrix.com>
> > ---
> > v3: use pattern matching rule
> > ---
> > tools/fuzz/x86_instruction_emulator/Makefile | 12 ++++++++----
> > 1 file changed, 8 insertions(+), 4 deletions(-)
> >
> > diff --git a/tools/fuzz/x86_instruction_emulator/Makefile
> > b/tools/fuzz/x86_instruction_emulator/Makefile
> > index fede7e9afd..b0ea31b2b0 100644
> > --- a/tools/fuzz/x86_instruction_emulator/Makefile
> > +++ b/tools/fuzz/x86_instruction_emulator/Makefile
> > @@ -8,11 +8,15 @@ else
> > x86-instruction-emulator-fuzzer-all:
> > endif
> >
> > -x86_emulate/x86_emulate.c x86_emulate/x86_emulate.h:
> > - [ -L x86_emulate ] || ln -sf $(XEN_ROOT)/xen/arch/x86/x86_emulate .
> > +x86_emulate:
> > + [ -L $@ ] || ln -sf $(XEN_ROOT)/xen/arch/x86/$@ .
>
> For consistency with the ln at the very bottom (patch context) you
> may want to omit the . here.
>
Sure.
> > -asm/x86-vendors.h asm/x86-defns.h asm/msr-index.h:
> > - [ -L asm ] || ln -sf $(XEN_ROOT)/xen/include/asm-x86 asm
> > +x86_emulate/x86_emulate.c x86_emulate/x86_emulate.h: x86_emulate
>
> So why don't you use a pattern rule here?
>
Forgot this place. Will fix.
> > +asm:
> > + [ -L $@ ] || ln -sf $(XEN_ROOT)/xen/include/asm-x86 $@
> > +
> > +asm/%: asm ;
>
> Is the semicolon needed here? You don't have one above ...
>
Yes, this is needed; otherwise make complains not knowing how to make
the target. When I change x86_emulate.[ch] to use patter rule, I will
need to add a semicolon as well.
From Make manual for empty recipes:
Empty recipes can also be used to avoid errors for targets that will be
created as a side-effect of another recipe: if the target does not exist
the empty recipe ensures that make won’t complain that it doesn't know
how to build the target, and make will assume the target is out of date.
Wei.
> Jan
>
> > x86_emulate.c x86_emulate.h: %:
> > [ -L $* ] || ln -sf $(XEN_ROOT)/tools/tests/x86_emulator/$*
>
>
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2017-02-20 14:06 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-20 12:05 [PATCH v3 0/2] Fuzz/x86emul and x86emul/test fixes Wei Liu
2017-02-20 12:05 ` [PATCH v3 1/2] fuzz/x86emul: avoid race in link farm rune Wei Liu
2017-02-20 12:37 ` Jan Beulich
2017-02-20 14:05 ` Wei Liu [this message]
2017-02-20 14:28 ` Jan Beulich
2017-02-20 12:05 ` [PATCH v3 2/2] x86emul/test: " Wei Liu
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=20170220140555.hso4n37f3musvq3p@citrix.com \
--to=wei.liu2@citrix.com \
--cc=Ian.Jackson@eu.citrix.com \
--cc=JBeulich@suse.com \
--cc=andrew.cooper3@citrix.com \
--cc=xen-devel@lists.xenproject.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).