diff mbox series

[RFC,v2,09/17] fuzz: hardcode needed objects into i386 target

Message ID 20190805071038.32146-10-alxndr@bu.edu
State New
Headers show
Series Add virtual device fuzzing support | expand

Commit Message

Alexander Bulekov Aug. 5, 2019, 7:11 a.m. UTC
Temporary solution until there is a better build solution for fuzzers in
tests/Makefile.include

Signed-off-by: Alexander Oleinik <alxndr@bu.edu>
---
 target/i386/Makefile.objs | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

Comments

Stefan Hajnoczi Aug. 9, 2019, 9:33 a.m. UTC | #1
On Mon, Aug 05, 2019 at 07:11:10AM +0000, Oleinik, Alexander wrote:
> Temporary solution until there is a better build solution for fuzzers in
> tests/Makefile.include
> 
> Signed-off-by: Alexander Oleinik <alxndr@bu.edu>
> ---
>  target/i386/Makefile.objs | 20 ++++++++++++++++++++
>  1 file changed, 20 insertions(+)
> 
> diff --git a/target/i386/Makefile.objs b/target/i386/Makefile.objs
> index 48e0c28434..1b8976c0a6 100644
> --- a/target/i386/Makefile.objs
> +++ b/target/i386/Makefile.objs
> @@ -18,5 +18,25 @@ endif
>  obj-$(CONFIG_HVF) += hvf/
>  obj-$(CONFIG_WHPX) += whpx-all.o
>  endif
> +
> +# Need to link against target, qtest and qos.. Just list everything here, until
> +# I find a better way to integrate into the build system

There are two similar solutions:

1. Use tests/Makefile.include, e.g. libqos-obj-y.
2. Build a .a archive file in tests/Makefile.include and link against it.

In both cases it is no longer necessary to list ../../tests/ object
files in target/i386/Makefile.objs.

> +ifeq ($(CONFIG_FUZZ),y)

ifeq isn't necessary since obj-$(CONFIG_FUZZ) is already conditional
below.

> +obj-$(CONFIG_FUZZ) += ../../accel/fuzz.o ../../tests/libqos/qos_external.o
> +obj-$(CONFIG_FUZZ) += ../../tests/fuzz/fuzz.o ../../tests/fuzz/fuzzer_hooks.o
> +obj-$(CONFIG_FUZZ) += ../../tests/fuzz/virtio-net-fuzz.o
> +obj-$(CONFIG_FUZZ) += ../../tests/fuzz/snapshotting.o
> +obj-$(CONFIG_FUZZ) += ../../tests/fuzz/qtest_fuzz.o
> +obj-$(CONFIG_FUZZ) += ../../tests/libqtest.o
> +obj-$(CONFIG_FUZZ) += ../../tests/libqos/qgraph.o ../../tests/libqos/libqos.o
> +obj-$(CONFIG_FUZZ) += ../../tests/fuzz/qos_fuzz.o ../../tests/fuzz/qos_helpers.o
> +obj-$(CONFIG_FUZZ) +=  ../../tests/libqos/malloc.o ../../tests/libqos/pci-pc.o \
> +	../../tests/libqos/virtio-pci.o ../../tests/libqos/malloc-pc.o \
> +	../../tests/libqos/libqos-pc.o ../../tests/libqos/fw_cfg.o \
> +	../../tests/libqos/e1000e.o ../../tests/libqos/pci.o \
> +	../../tests/libqos/pci-pc.o ../../tests/libqos/virtio.o \
> +	../../tests/libqos/virtio-net.o ../../tests/libqos/x86_64_pc-machine.o

I see filenames here that are not in the tree yet at this point in the
patch series.  Please make sure that QEMU builds at each point in the
patch series so that git-bisect(1) works.

Stefan
Darren Kenny Aug. 16, 2019, 12:51 p.m. UTC | #2
Hi Alexander,

On Fri, Aug 09, 2019 at 10:33:59AM +0100, Stefan Hajnoczi wrote:
>On Mon, Aug 05, 2019 at 07:11:10AM +0000, Oleinik, Alexander wrote:
>> Temporary solution until there is a better build solution for fuzzers in
>> tests/Makefile.include
>>
>> Signed-off-by: Alexander Oleinik <alxndr@bu.edu>
>> ---
>>  target/i386/Makefile.objs | 20 ++++++++++++++++++++
>>  1 file changed, 20 insertions(+)
>>
>> diff --git a/target/i386/Makefile.objs b/target/i386/Makefile.objs
>> index 48e0c28434..1b8976c0a6 100644
>> --- a/target/i386/Makefile.objs
>> +++ b/target/i386/Makefile.objs
>> @@ -18,5 +18,25 @@ endif
>>  obj-$(CONFIG_HVF) += hvf/
>>  obj-$(CONFIG_WHPX) += whpx-all.o
>>  endif
>> +
>> +# Need to link against target, qtest and qos.. Just list everything here, until
>> +# I find a better way to integrate into the build system
>
>There are two similar solutions:
>
>1. Use tests/Makefile.include, e.g. libqos-obj-y.
>2. Build a .a archive file in tests/Makefile.include and link against it.
>
>In both cases it is no longer necessary to list ../../tests/ object
>files in target/i386/Makefile.objs.
>
>> +ifeq ($(CONFIG_FUZZ),y)
>
>ifeq isn't necessary since obj-$(CONFIG_FUZZ) is already conditional
>below.
>
>> +obj-$(CONFIG_FUZZ) += ../../accel/fuzz.o ../../tests/libqos/qos_external.o
>> +obj-$(CONFIG_FUZZ) += ../../tests/fuzz/fuzz.o ../../tests/fuzz/fuzzer_hooks.o
>> +obj-$(CONFIG_FUZZ) += ../../tests/fuzz/virtio-net-fuzz.o
>> +obj-$(CONFIG_FUZZ) += ../../tests/fuzz/snapshotting.o
>> +obj-$(CONFIG_FUZZ) += ../../tests/fuzz/qtest_fuzz.o
>> +obj-$(CONFIG_FUZZ) += ../../tests/libqtest.o
>> +obj-$(CONFIG_FUZZ) += ../../tests/libqos/qgraph.o ../../tests/libqos/libqos.o
>> +obj-$(CONFIG_FUZZ) += ../../tests/fuzz/qos_fuzz.o ../../tests/fuzz/qos_helpers.o
>> +obj-$(CONFIG_FUZZ) +=  ../../tests/libqos/malloc.o ../../tests/libqos/pci-pc.o \
>> +	../../tests/libqos/virtio-pci.o ../../tests/libqos/malloc-pc.o \
>> +	../../tests/libqos/libqos-pc.o ../../tests/libqos/fw_cfg.o \
>> +	../../tests/libqos/e1000e.o ../../tests/libqos/pci.o \
>> +	../../tests/libqos/pci-pc.o ../../tests/libqos/virtio.o \
>> +	../../tests/libqos/virtio-net.o ../../tests/libqos/x86_64_pc-machine.o
>
>I see filenames here that are not in the tree yet at this point in the
>patch series.  Please make sure that QEMU builds at each point in the
>patch series so that git-bisect(1) works.

Even after applying the series I'm not seeing any snapshotting.[ch]
files - so virtio-net-fuzz.c fails to build too because of the
missing header file.

But overall, I'm finding lots of failures when building the series,
not just at any specific point in time, so it would be worth at
least doing a clean checkout of the tree and applying the patches,
and doing a full build, before sending out the next set, to be sure
that they are complete.

Thanks,

Darren.
diff mbox series

Patch

diff --git a/target/i386/Makefile.objs b/target/i386/Makefile.objs
index 48e0c28434..1b8976c0a6 100644
--- a/target/i386/Makefile.objs
+++ b/target/i386/Makefile.objs
@@ -18,5 +18,25 @@  endif
 obj-$(CONFIG_HVF) += hvf/
 obj-$(CONFIG_WHPX) += whpx-all.o
 endif
+
+# Need to link against target, qtest and qos.. Just list everything here, until
+# I find a better way to integrate into the build system
+ifeq ($(CONFIG_FUZZ),y)
+obj-$(CONFIG_FUZZ) += ../../accel/fuzz.o ../../tests/libqos/qos_external.o
+obj-$(CONFIG_FUZZ) += ../../tests/fuzz/fuzz.o ../../tests/fuzz/fuzzer_hooks.o
+obj-$(CONFIG_FUZZ) += ../../tests/fuzz/virtio-net-fuzz.o
+obj-$(CONFIG_FUZZ) += ../../tests/fuzz/snapshotting.o
+obj-$(CONFIG_FUZZ) += ../../tests/fuzz/qtest_fuzz.o
+obj-$(CONFIG_FUZZ) += ../../tests/libqtest.o
+obj-$(CONFIG_FUZZ) += ../../tests/libqos/qgraph.o ../../tests/libqos/libqos.o
+obj-$(CONFIG_FUZZ) += ../../tests/fuzz/qos_fuzz.o ../../tests/fuzz/qos_helpers.o
+obj-$(CONFIG_FUZZ) +=  ../../tests/libqos/malloc.o ../../tests/libqos/pci-pc.o \
+	../../tests/libqos/virtio-pci.o ../../tests/libqos/malloc-pc.o \
+	../../tests/libqos/libqos-pc.o ../../tests/libqos/fw_cfg.o \
+	../../tests/libqos/e1000e.o ../../tests/libqos/pci.o \
+	../../tests/libqos/pci-pc.o ../../tests/libqos/virtio.o \
+	../../tests/libqos/virtio-net.o ../../tests/libqos/x86_64_pc-machine.o
+endif
+
 obj-$(CONFIG_SEV) += sev.o
 obj-$(call lnot,$(CONFIG_SEV)) += sev-stub.o