qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH-for-6.0] hw/mem/meson: Fix linking sparse-mem device with fuzzer
@ 2021-04-06 13:39 Philippe Mathieu-Daudé
  2021-04-06 13:40 ` Philippe Mathieu-Daudé
  2021-04-06 14:39 ` Alexander Bulekov
  0 siblings, 2 replies; 6+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-04-06 13:39 UTC (permalink / raw)
  To: qemu-devel
  Cc: Darren Kenny, Igor Mammedov, Paolo Bonzini,
	Philippe Mathieu-Daudé,
	Michael S. Tsirkin

sparse-mem.c is added to the 'mem_ss' source set, which itself
is conditionally added to softmmu_ss if CONFIG_MEM_DEVICE is
selected.
But if CONFIG_MEM_DEVICE isn't selected, we get a link failure
even if CONFIG_FUZZ is selected:

  /usr/bin/ld: tests_qtest_fuzz_generic_fuzz.c.o: in function `generic_pre_fuzz':
  tests/qtest/fuzz/generic_fuzz.c:826: undefined reference to `sparse_mem_init'
  clang-10: error: linker command failed with exit code 1 (use -v to see invocation)

Fix by adding sparse-mem.c directly to the softmmu_ss set.

Fixes: 230376d285b ("memory: add a sparse memory device for fuzzing")
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 hw/mem/meson.build | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/hw/mem/meson.build b/hw/mem/meson.build
index ef79e046787..3c8fdef9f9e 100644
--- a/hw/mem/meson.build
+++ b/hw/mem/meson.build
@@ -1,8 +1,9 @@
 mem_ss = ss.source_set()
 mem_ss.add(files('memory-device.c'))
-mem_ss.add(when: 'CONFIG_FUZZ', if_true: files('sparse-mem.c'))
 mem_ss.add(when: 'CONFIG_DIMM', if_true: files('pc-dimm.c'))
 mem_ss.add(when: 'CONFIG_NPCM7XX', if_true: files('npcm7xx_mc.c'))
 mem_ss.add(when: 'CONFIG_NVDIMM', if_true: files('nvdimm.c'))
 
 softmmu_ss.add_all(when: 'CONFIG_MEM_DEVICE', if_true: mem_ss)
+
+softmmu_ss.add(when: 'CONFIG_FUZZ', if_true: files('sparse-mem.c'))
-- 
2.26.3



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH-for-6.0] hw/mem/meson: Fix linking sparse-mem device with fuzzer
  2021-04-06 13:39 [PATCH-for-6.0] hw/mem/meson: Fix linking sparse-mem device with fuzzer Philippe Mathieu-Daudé
@ 2021-04-06 13:40 ` Philippe Mathieu-Daudé
  2021-04-06 14:39 ` Alexander Bulekov
  1 sibling, 0 replies; 6+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-04-06 13:40 UTC (permalink / raw)
  To: qemu-devel, Alexander Bulekov
  Cc: Darren Kenny, Igor Mammedov, Paolo Bonzini, Michael S. Tsirkin

+Alex

On 4/6/21 3:39 PM, Philippe Mathieu-Daudé wrote:
> sparse-mem.c is added to the 'mem_ss' source set, which itself
> is conditionally added to softmmu_ss if CONFIG_MEM_DEVICE is
> selected.
> But if CONFIG_MEM_DEVICE isn't selected, we get a link failure
> even if CONFIG_FUZZ is selected:
> 
>   /usr/bin/ld: tests_qtest_fuzz_generic_fuzz.c.o: in function `generic_pre_fuzz':
>   tests/qtest/fuzz/generic_fuzz.c:826: undefined reference to `sparse_mem_init'
>   clang-10: error: linker command failed with exit code 1 (use -v to see invocation)
> 
> Fix by adding sparse-mem.c directly to the softmmu_ss set.
> 
> Fixes: 230376d285b ("memory: add a sparse memory device for fuzzing")
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  hw/mem/meson.build | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/mem/meson.build b/hw/mem/meson.build
> index ef79e046787..3c8fdef9f9e 100644
> --- a/hw/mem/meson.build
> +++ b/hw/mem/meson.build
> @@ -1,8 +1,9 @@
>  mem_ss = ss.source_set()
>  mem_ss.add(files('memory-device.c'))
> -mem_ss.add(when: 'CONFIG_FUZZ', if_true: files('sparse-mem.c'))
>  mem_ss.add(when: 'CONFIG_DIMM', if_true: files('pc-dimm.c'))
>  mem_ss.add(when: 'CONFIG_NPCM7XX', if_true: files('npcm7xx_mc.c'))
>  mem_ss.add(when: 'CONFIG_NVDIMM', if_true: files('nvdimm.c'))
>  
>  softmmu_ss.add_all(when: 'CONFIG_MEM_DEVICE', if_true: mem_ss)
> +
> +softmmu_ss.add(when: 'CONFIG_FUZZ', if_true: files('sparse-mem.c'))
> 



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH-for-6.0] hw/mem/meson: Fix linking sparse-mem device with fuzzer
  2021-04-06 13:39 [PATCH-for-6.0] hw/mem/meson: Fix linking sparse-mem device with fuzzer Philippe Mathieu-Daudé
  2021-04-06 13:40 ` Philippe Mathieu-Daudé
@ 2021-04-06 14:39 ` Alexander Bulekov
  2021-04-12 11:07   ` Philippe Mathieu-Daudé
  1 sibling, 1 reply; 6+ messages in thread
From: Alexander Bulekov @ 2021-04-06 14:39 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Darren Kenny, Paolo Bonzini, Michael S. Tsirkin, qemu-devel,
	Igor Mammedov

On 210406 1539, Philippe Mathieu-Daudé wrote:
> sparse-mem.c is added to the 'mem_ss' source set, which itself
> is conditionally added to softmmu_ss if CONFIG_MEM_DEVICE is
> selected.
> But if CONFIG_MEM_DEVICE isn't selected, we get a link failure
> even if CONFIG_FUZZ is selected:
> 
>   /usr/bin/ld: tests_qtest_fuzz_generic_fuzz.c.o: in function `generic_pre_fuzz':
>   tests/qtest/fuzz/generic_fuzz.c:826: undefined reference to `sparse_mem_init'
>   clang-10: error: linker command failed with exit code 1 (use -v to see invocation)
> 
> Fix by adding sparse-mem.c directly to the softmmu_ss set.
> 
> Fixes: 230376d285b ("memory: add a sparse memory device for fuzzing")
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>

Oops..
Reviewed-by: Alexander Bulekov <alxndr@bu.edu>

> ---
>  hw/mem/meson.build | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/mem/meson.build b/hw/mem/meson.build
> index ef79e046787..3c8fdef9f9e 100644
> --- a/hw/mem/meson.build
> +++ b/hw/mem/meson.build
> @@ -1,8 +1,9 @@
>  mem_ss = ss.source_set()
>  mem_ss.add(files('memory-device.c'))
> -mem_ss.add(when: 'CONFIG_FUZZ', if_true: files('sparse-mem.c'))
>  mem_ss.add(when: 'CONFIG_DIMM', if_true: files('pc-dimm.c'))
>  mem_ss.add(when: 'CONFIG_NPCM7XX', if_true: files('npcm7xx_mc.c'))
>  mem_ss.add(when: 'CONFIG_NVDIMM', if_true: files('nvdimm.c'))
>  
>  softmmu_ss.add_all(when: 'CONFIG_MEM_DEVICE', if_true: mem_ss)
> +
> +softmmu_ss.add(when: 'CONFIG_FUZZ', if_true: files('sparse-mem.c'))
> -- 
> 2.26.3
> 
> 


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH-for-6.0] hw/mem/meson: Fix linking sparse-mem device with fuzzer
  2021-04-06 14:39 ` Alexander Bulekov
@ 2021-04-12 11:07   ` Philippe Mathieu-Daudé
  2021-05-11  3:48     ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 6+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-04-12 11:07 UTC (permalink / raw)
  To: Alexander Bulekov
  Cc: Darren Kenny, Paolo Bonzini, Michael S. Tsirkin, qemu-devel,
	Igor Mammedov

ping?

On 4/6/21 4:39 PM, Alexander Bulekov wrote:
> On 210406 1539, Philippe Mathieu-Daudé wrote:
>> sparse-mem.c is added to the 'mem_ss' source set, which itself
>> is conditionally added to softmmu_ss if CONFIG_MEM_DEVICE is
>> selected.
>> But if CONFIG_MEM_DEVICE isn't selected, we get a link failure
>> even if CONFIG_FUZZ is selected:
>>
>>   /usr/bin/ld: tests_qtest_fuzz_generic_fuzz.c.o: in function `generic_pre_fuzz':
>>   tests/qtest/fuzz/generic_fuzz.c:826: undefined reference to `sparse_mem_init'
>>   clang-10: error: linker command failed with exit code 1 (use -v to see invocation)
>>
>> Fix by adding sparse-mem.c directly to the softmmu_ss set.
>>
>> Fixes: 230376d285b ("memory: add a sparse memory device for fuzzing")
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> 
> Oops..
> Reviewed-by: Alexander Bulekov <alxndr@bu.edu>
> 
>> ---
>>  hw/mem/meson.build | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/hw/mem/meson.build b/hw/mem/meson.build
>> index ef79e046787..3c8fdef9f9e 100644
>> --- a/hw/mem/meson.build
>> +++ b/hw/mem/meson.build
>> @@ -1,8 +1,9 @@
>>  mem_ss = ss.source_set()
>>  mem_ss.add(files('memory-device.c'))
>> -mem_ss.add(when: 'CONFIG_FUZZ', if_true: files('sparse-mem.c'))
>>  mem_ss.add(when: 'CONFIG_DIMM', if_true: files('pc-dimm.c'))
>>  mem_ss.add(when: 'CONFIG_NPCM7XX', if_true: files('npcm7xx_mc.c'))
>>  mem_ss.add(when: 'CONFIG_NVDIMM', if_true: files('nvdimm.c'))
>>  
>>  softmmu_ss.add_all(when: 'CONFIG_MEM_DEVICE', if_true: mem_ss)
>> +
>> +softmmu_ss.add(when: 'CONFIG_FUZZ', if_true: files('sparse-mem.c'))
>> -- 
>> 2.26.3
>>
>>
> 



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH-for-6.0] hw/mem/meson: Fix linking sparse-mem device with fuzzer
  2021-04-12 11:07   ` Philippe Mathieu-Daudé
@ 2021-05-11  3:48     ` Philippe Mathieu-Daudé
  2021-05-13 16:10       ` Laurent Vivier
  0 siblings, 1 reply; 6+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-05-11  3:48 UTC (permalink / raw)
  To: Alexander Bulekov, QEMU Trivial
  Cc: Darren Kenny, Paolo Bonzini, Michael S. Tsirkin, qemu-devel,
	Igor Mammedov

Cc'ing qemu-trivial (patch reviewed).

On 4/12/21 1:07 PM, Philippe Mathieu-Daudé wrote:
> ping?
> 
> On 4/6/21 4:39 PM, Alexander Bulekov wrote:
>> On 210406 1539, Philippe Mathieu-Daudé wrote:
>>> sparse-mem.c is added to the 'mem_ss' source set, which itself
>>> is conditionally added to softmmu_ss if CONFIG_MEM_DEVICE is
>>> selected.
>>> But if CONFIG_MEM_DEVICE isn't selected, we get a link failure
>>> even if CONFIG_FUZZ is selected:
>>>
>>>   /usr/bin/ld: tests_qtest_fuzz_generic_fuzz.c.o: in function `generic_pre_fuzz':
>>>   tests/qtest/fuzz/generic_fuzz.c:826: undefined reference to `sparse_mem_init'
>>>   clang-10: error: linker command failed with exit code 1 (use -v to see invocation)
>>>
>>> Fix by adding sparse-mem.c directly to the softmmu_ss set.
>>>
>>> Fixes: 230376d285b ("memory: add a sparse memory device for fuzzing")
>>> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>>
>> Oops..
>> Reviewed-by: Alexander Bulekov <alxndr@bu.edu>
>>
>>> ---
>>>  hw/mem/meson.build | 3 ++-
>>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/hw/mem/meson.build b/hw/mem/meson.build
>>> index ef79e046787..3c8fdef9f9e 100644
>>> --- a/hw/mem/meson.build
>>> +++ b/hw/mem/meson.build
>>> @@ -1,8 +1,9 @@
>>>  mem_ss = ss.source_set()
>>>  mem_ss.add(files('memory-device.c'))
>>> -mem_ss.add(when: 'CONFIG_FUZZ', if_true: files('sparse-mem.c'))
>>>  mem_ss.add(when: 'CONFIG_DIMM', if_true: files('pc-dimm.c'))
>>>  mem_ss.add(when: 'CONFIG_NPCM7XX', if_true: files('npcm7xx_mc.c'))
>>>  mem_ss.add(when: 'CONFIG_NVDIMM', if_true: files('nvdimm.c'))
>>>  
>>>  softmmu_ss.add_all(when: 'CONFIG_MEM_DEVICE', if_true: mem_ss)
>>> +
>>> +softmmu_ss.add(when: 'CONFIG_FUZZ', if_true: files('sparse-mem.c'))
>>> -- 
>>> 2.26.3
>>>
>>>
>>
> 



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH-for-6.0] hw/mem/meson: Fix linking sparse-mem device with fuzzer
  2021-05-11  3:48     ` Philippe Mathieu-Daudé
@ 2021-05-13 16:10       ` Laurent Vivier
  0 siblings, 0 replies; 6+ messages in thread
From: Laurent Vivier @ 2021-05-13 16:10 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, Alexander Bulekov, QEMU Trivial
  Cc: Darren Kenny, Igor Mammedov, Michael S. Tsirkin, qemu-devel,
	Paolo Bonzini

Le 11/05/2021 à 05:48, Philippe Mathieu-Daudé a écrit :
> Cc'ing qemu-trivial (patch reviewed).

Applied to my trivial-patches branch.

Thanks,
Laurent

> 
> On 4/12/21 1:07 PM, Philippe Mathieu-Daudé wrote:
>> ping?
>>
>> On 4/6/21 4:39 PM, Alexander Bulekov wrote:
>>> On 210406 1539, Philippe Mathieu-Daudé wrote:
>>>> sparse-mem.c is added to the 'mem_ss' source set, which itself
>>>> is conditionally added to softmmu_ss if CONFIG_MEM_DEVICE is
>>>> selected.
>>>> But if CONFIG_MEM_DEVICE isn't selected, we get a link failure
>>>> even if CONFIG_FUZZ is selected:
>>>>
>>>>   /usr/bin/ld: tests_qtest_fuzz_generic_fuzz.c.o: in function `generic_pre_fuzz':
>>>>   tests/qtest/fuzz/generic_fuzz.c:826: undefined reference to `sparse_mem_init'
>>>>   clang-10: error: linker command failed with exit code 1 (use -v to see invocation)
>>>>
>>>> Fix by adding sparse-mem.c directly to the softmmu_ss set.
>>>>
>>>> Fixes: 230376d285b ("memory: add a sparse memory device for fuzzing")
>>>> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>>>
>>> Oops..
>>> Reviewed-by: Alexander Bulekov <alxndr@bu.edu>
>>>
>>>> ---
>>>>  hw/mem/meson.build | 3 ++-
>>>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>>>
>>>> diff --git a/hw/mem/meson.build b/hw/mem/meson.build
>>>> index ef79e046787..3c8fdef9f9e 100644
>>>> --- a/hw/mem/meson.build
>>>> +++ b/hw/mem/meson.build
>>>> @@ -1,8 +1,9 @@
>>>>  mem_ss = ss.source_set()
>>>>  mem_ss.add(files('memory-device.c'))
>>>> -mem_ss.add(when: 'CONFIG_FUZZ', if_true: files('sparse-mem.c'))
>>>>  mem_ss.add(when: 'CONFIG_DIMM', if_true: files('pc-dimm.c'))
>>>>  mem_ss.add(when: 'CONFIG_NPCM7XX', if_true: files('npcm7xx_mc.c'))
>>>>  mem_ss.add(when: 'CONFIG_NVDIMM', if_true: files('nvdimm.c'))
>>>>  
>>>>  softmmu_ss.add_all(when: 'CONFIG_MEM_DEVICE', if_true: mem_ss)
>>>> +
>>>> +softmmu_ss.add(when: 'CONFIG_FUZZ', if_true: files('sparse-mem.c'))
>>>> -- 
>>>> 2.26.3
>>>>
>>>>
>>>
>>
> 
> 



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-05-13 16:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-06 13:39 [PATCH-for-6.0] hw/mem/meson: Fix linking sparse-mem device with fuzzer Philippe Mathieu-Daudé
2021-04-06 13:40 ` Philippe Mathieu-Daudé
2021-04-06 14:39 ` Alexander Bulekov
2021-04-12 11:07   ` Philippe Mathieu-Daudé
2021-05-11  3:48     ` Philippe Mathieu-Daudé
2021-05-13 16:10       ` Laurent Vivier

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).