]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
fuzz/x86emul: avoid race in link farm rune
authorWei Liu <wei.liu2@citrix.com>
Mon, 20 Feb 2017 14:37:36 +0000 (14:37 +0000)
committerWei Liu <wei.liu2@citrix.com>
Mon, 20 Feb 2017 15:13:54 +0000 (15:13 +0000)
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>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
tools/fuzz/x86_instruction_emulator/Makefile

index fede7e9afdaa0da14946ab85884806dc44ae2352..3b75beb07d443ee7dba2a7daebdb53dfa3a706d5 100644 (file)
@@ -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/$@
 
-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 ;
+
+asm:
+       [ -L $@ ] || ln -sf $(XEN_ROOT)/xen/include/asm-x86 $@
+
+asm/%: asm ;
 
 x86_emulate.c x86_emulate.h: %:
        [ -L $* ] || ln -sf $(XEN_ROOT)/tools/tests/x86_emulator/$*