[PATCH] x86emul/fuzz: correct header (symlink) dependencies

Jan Beulich posted 1 patch 1 year ago
Failed in applying to current master (apply log)
[PATCH] x86emul/fuzz: correct header (symlink) dependencies
Posted by Jan Beulich 1 year ago
A use of $(x86_emulate.h) was introduced (mirroring what the testharness
has) without realizing that no such variable exists here. (Re)name the
variable (to) "private.h", which better expresses what is included which
way.

Note that because of automatic dependencies tracking, unlike in the test
harness no $(x86.h) variable is needed here - we solely need explicit
dependencies for files which need symlinks created.

Fixes: 9ace97ab9b87 ("x86emul: split off opcode 0f01 handling")
Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/tools/fuzz/x86_instruction_emulator/Makefile
+++ b/tools/fuzz/x86_instruction_emulator/Makefile
@@ -35,14 +35,16 @@ OBJS := fuzz-emul.o x86-emulate.o
 OBJS += x86_emulate/0f01.o x86_emulate/0fae.o x86_emulate/0fc7.o
 OBJS += x86_emulate/decode.o x86_emulate/fpu.o
 
+private.h := x86-emulate.h x86_emulate/x86_emulate.h x86_emulate/private.h
+
 x86-emulate.h: x86_emulate/x86_emulate.h
-x86-emulate.o x86-emulate-cov.o: x86-emulate.h x86_emulate/x86_emulate.c x86_emulate/private.h
+x86-emulate.o x86-emulate-cov.o: x86_emulate/x86_emulate.c $(private.h)
 fuzz-emul.o fuzz-emul-cov.o wrappers.o: x86-emulate.h
 
-$(filter x86_emulate/%.o,$(OBJS)): x86_emulate/%.o: x86_emulate/%.c x86_emulate/private.h $(x86_emulate.h)
+$(filter x86_emulate/%.o,$(OBJS)): x86_emulate/%.o: x86_emulate/%.c $(private.h)
 	$(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_$*.o) -c -o $@ $< $(APPEND_CFLAGS)
 
-$(patsubst %.o,%-cov.o,$(filter x86_emulate/%.o,$(OBJS))): x86_emulate/%-cov.o: x86_emulate/%.c x86_emulate/private.h $(x86_emulate.h)
+$(patsubst %.o,%-cov.o,$(filter x86_emulate/%.o,$(OBJS))): x86_emulate/%-cov.o: x86_emulate/%.c $(private.h)
 	$(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_$*.o) $(GCOV_FLAGS) -c -o $@ $< $(APPEND_CFLAGS)
 
 x86-insn-fuzzer.a: $(OBJS) cpuid.o
Re: [PATCH] x86emul/fuzz: correct header (symlink) dependencies
Posted by Andrew Cooper 1 year ago
On 17/04/2023 8:54 am, Jan Beulich wrote:
> A use of $(x86_emulate.h) was introduced (mirroring what the testharness
> has) without realizing that no such variable exists here. (Re)name the
> variable (to) "private.h", which better expresses what is included which
> way.
>
> Note that because of automatic dependencies tracking, unlike in the test
> harness no $(x86.h) variable is needed here - we solely need explicit
> dependencies for files which need symlinks created.
>
> Fixes: 9ace97ab9b87 ("x86emul: split off opcode 0f01 handling")
> Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>