[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [XEN PATCH v3 06/25] tools/fuzz/x86_instruction_emulator: rework makefile


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • Date: Tue, 2 Aug 2022 18:09:32 +0100
  • Authentication-results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 02 Aug 2022 17:10:12 +0000
  • Ironport-data: A9a23:vjCRj6iMFHoBB5re4VcTRXzEX161cBAKZh0ujC45NGQN5FlHY01je htvWWCAOf/ZZTemeox1PN61oBlT7J+GnNcxQFc5rSs2RSkb9cadCdqndUqhZCn6wu8v7a5EA 2fyTvGacajYm1eF/k/F3oDJ9CU6j+fQLlbFILasEjhrQgN5QzsWhxtmmuoo6qZlmtH8CA6W0 T/Ii5S31GSNhnglaQr414rZ8Ek15KSq4mtD1rADTasjUGH2xiF94K03fcldH1OgKqFIE+izQ fr0zb3R1gs1KD90V7tJOp6iGqE7aua60Tqm0xK6aID76vR2nQQg075TCRYpQRw/ZwNlPTxG4 I4lWZSYEW/FN0BX8QgXe0Ew/ypWZcWq9FJbSJQWXAP6I0DuKhPRL/tS4E4eM6Qy/L4vJG5yz 98SAzc8KQishumW3+fuIgVsrpxLwMjDOYoevjdrzC3DDOZgSpfGK0nIzYYGhnFq3JkIRKuAI ZpCAdZsRE2ojxlnM1ELCJU4jaGwi2P2aTFwo1OJv6snpWPUyWSd1ZCyb4SOJITWGK25mG6Ct 2zk4HzJCSgwbuyj+RGu0n+Og+HAyHaTtIU6S+Tjq68CbEeo7nMXIA0bUx28u/bRol6zXZdTJ lIZ/gIqrLMu7wq7Q9/lRRq6rXWY+BkGVLJ4CPYm4QuAzq7V5QexBWUeSDNFLts8u6ceRzYny 1uIlNPBHiF0vfueTnf13rWJqTK/PwAFIGlEYjULJTbp+PG6/tt11EiWCI8+Tujl1bUZBA0c3 RiEhQI43+02gvIx9K+Q+mGAmx2trbjWG1tdChrsYo610u9oTNf7Ot30sQWCsKwowJWxFQfY4 iVd8ySKxKVXVMzWynTQKAkYNOvxj8tpJgEwlrKG83MJ0z22s0CucolLiN2VDBc4a51UEdMFj aK6hO+w2HOwFCHzBUOPS9jtY/nGNIC5fTgfatjab8BVfr96fxKd8SdlaCa4hj6wwRNzwPlmY sbKKK5A6Er27ow+lVKLqxo1i+d3lkjSO0uJLXwE8/hX+eXHPyPEIVv0GFCPcvo4/Mu5nekhy P4GbpPi40gOD4XDjtz/q9F7waYicSdmXvgbaqV/Koa+H+aRMDt+W6eAkO98K90NcmY8vr6gw 0xRk3RwkDLX7UAr4y3RMhiPtJuHsU5DkE8G
  • Ironport-hdrordr: A9a23:Q0UzC6PaFSv8BsBcTsGjsMiBIKoaSvp037Eqv3oedfVwSL39qy nOpoV/6faaslsssR0b9exofZPwJk80lqQFg7X5X43DYOCOggLBR+tfBMnZsl7d8kXFh4hgPM xbEpSWZueeMWRH
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Mon, Jul 11, 2022 at 04:08:55PM +0200, Jan Beulich wrote:
> On 24.06.2022 18:04, Anthony PERARD wrote:
> > --- a/tools/fuzz/x86_instruction_emulator/Makefile
> > +++ b/tools/fuzz/x86_instruction_emulator/Makefile
> > @@ -8,33 +8,27 @@ else
> >  x86-insn-fuzz-all:
> >  endif
> >  
> > -# Add libx86 to the build
> > -vpath %.c $(XEN_ROOT)/xen/lib/x86
> > +cpuid.c: %: $(XEN_ROOT)/xen/lib/x86/% FORCE
> > +   ln -nsf $< $@
> 
> I guess the idea with the original construct was to allow using further
> source files from libx86 with as little code churn as possible. Your
> change now requires two more lines to be touched. As long as we avoid
> name collisions in the various directories (wrapper.c and a few more
> files come from yet somewhere else), couldn't this rule simply be
> 
> %.c: $(XEN_ROOT)/xen/lib/x86/%.c FORCE
>       ln -nsf $< $@
> 
> ?

Sounds good.

> > -x86_emulate:
> > -   [ -L $@ ] || ln -sf $(XEN_ROOT)/xen/arch/x86/$@
> > +x86_emulate: FORCE
> > +   ln -nsf $(XEN_ROOT)/xen/arch/x86/$@
> >  
> >  x86_emulate/%: x86_emulate ;
> >  
> > -x86-emulate.c x86-emulate.h wrappers.c: %:
> > -   [ -L $* ] || ln -sf $(XEN_ROOT)/tools/tests/x86_emulator/$*
> > +x86-emulate.c x86-emulate.h wrappers.c: %: 
> > $(XEN_ROOT)/tools/tests/x86_emulator/% FORCE
> > +   ln -nsf $< $@
> 
> And similarly
> 
> %.c: $(XEN_ROOT)/tools/tests/x86_emulator/%.c FORCE
>       ln -nsf $< $@
> 
> %.h: $(XEN_ROOT)/tools/tests/x86_emulator/%.h FORCE
>       ln -nsf $< $@
> 
> here? (I'm hesitant to suggest plain %, i.e. without the filename
> suffixes, as that would likely be at least confusing for Makefile.)

Will do.

> > @@ -67,3 +61,5 @@ afl: afl-harness
> >  
> >  .PHONY: afl-cov
> >  afl-cov: afl-harness-cov
> > +
> > +-include $(DEPS_INCLUDE)
> 
> I would expect doing so was avoided for some reason. Albeit it may
> well be that too much cloning of tests/x86_emulator was done here,

There's quite a few places in tools/ where "-include $(DEPS_INCLUDE)" is
missing, so I kind of expect it to be forgotten rather than avoided on
purpose.

> and it's all fine this way. Can you confirm things to work when
> building locally in just this subdir, e.g. via
> 
> make -sC .../tools/fuzz/x86_instruction_emulator 
> CC=/build/afl/2.52b-base/afl-gcc
> 
> ?

Yes, that still works. But I'm not sure why you would ask since the
tools/ build system works this way, execution of make in a subdir
doesn't depends on the execution from the parent dir (it doesn't
depends on anything in the envvar).

Thanks,

-- 
Anthony PERARD



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.