Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
---
meson.build | 4 ++--
system/meson.build | 1 +
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/meson.build b/meson.build
index f94209bb301..b72d4ce8618 100644
--- a/meson.build
+++ b/meson.build
@@ -4420,14 +4420,14 @@ foreach target : target_dirs
execs = [{
'name': 'qemu-system-' + target_name,
'win_subsystem': 'console',
- 'sources': files('system/main.c'),
+ 'sources': [],
'dependencies': [sdl]
}]
if host_os == 'windows' and (sdl.found() or gtk.found())
execs += [{
'name': 'qemu-system-' + target_name + 'w',
'win_subsystem': 'windows',
- 'sources': files('system/main.c'),
+ 'sources': [],
'dependencies': [sdl]
}]
endif
diff --git a/system/meson.build b/system/meson.build
index 6d21ff9faa7..f358c2c446d 100644
--- a/system/meson.build
+++ b/system/meson.build
@@ -18,6 +18,7 @@ system_ss.add(files(
'globals.c',
'ioport.c',
'ram-block-attributes.c',
+ 'main.c',
'memory_mapping.c',
'memory.c',
'physmem.c',
--
2.47.2
Hi,
On 31/7/25 00:05, Pierrick Bouvier wrote:
> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
> ---
> meson.build | 4 ++--
> system/meson.build | 1 +
> 2 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/meson.build b/meson.build
> index f94209bb301..b72d4ce8618 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -4420,14 +4420,14 @@ foreach target : target_dirs
> execs = [{
> 'name': 'qemu-system-' + target_name,
> 'win_subsystem': 'console',
> - 'sources': files('system/main.c'),
> + 'sources': [],
> 'dependencies': [sdl]
> }]
> if host_os == 'windows' and (sdl.found() or gtk.found())
> execs += [{
> 'name': 'qemu-system-' + target_name + 'w',
> 'win_subsystem': 'windows',
> - 'sources': files('system/main.c'),
> + 'sources': [],
> 'dependencies': [sdl]
> }]
> endif
> diff --git a/system/meson.build b/system/meson.build
> index 6d21ff9faa7..f358c2c446d 100644
> --- a/system/meson.build
> +++ b/system/meson.build
> @@ -18,6 +18,7 @@ system_ss.add(files(
> 'globals.c',
> 'ioport.c',
> 'ram-block-attributes.c',
> + 'main.c',
> 'memory_mapping.c',
> 'memory.c',
> 'physmem.c',
This makes the build-oss-fuzz job to fail:
FAILED: qemu-fuzz-i386
clang -m64 @qemu-fuzz-i386.rsp
/usr/bin/ld: libsystem.a.p/system_main.c.o: in function `main':
/builds/philmd/qemu/build-oss-fuzz/../system/main.c:70: multiple
definition of `main';
/usr/bin/../lib/clang/18/lib/x86_64-redhat-linux-gnu/libclang_rt.fuzzer.a(FuzzerMain.cpp.o):(.text+0x0):
first defined here
/usr/bin/ld: qemu-fuzz-i386.p/tests_qtest_fuzz_fuzz.c.o:(.bss+0x0):
multiple definition of `__odr_asan_gen_qemu_main';
libsystem.a.p/system_main.c.o:(.bss+0x0): first defined here
clang: error: linker command failed with exit code 1 (use -v to see
invocation)
ninja: build stopped: subcommand failed.
make: *** [Makefile:168: run-ninja] Error 1
Error : Build failed. Please specify a compiler with fuzzing support
using the $CC and $CXX environment variables \nFor example: CC=clang
CXX=clang++ ./scripts/oss-fuzz/build.sh, exiting.
https://gitlab.com/philmd/qemu/-/jobs/11205571060
On 1/9/25 17:07, Philippe Mathieu-Daudé wrote:
> Hi,
>
> On 31/7/25 00:05, Pierrick Bouvier wrote:
>> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
>> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
>> ---
>> meson.build | 4 ++--
>> system/meson.build | 1 +
>> 2 files changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/meson.build b/meson.build
>> index f94209bb301..b72d4ce8618 100644
>> --- a/meson.build
>> +++ b/meson.build
>> @@ -4420,14 +4420,14 @@ foreach target : target_dirs
>> execs = [{
>> 'name': 'qemu-system-' + target_name,
>> 'win_subsystem': 'console',
>> - 'sources': files('system/main.c'),
>> + 'sources': [],
>> 'dependencies': [sdl]
>> }]
>> if host_os == 'windows' and (sdl.found() or gtk.found())
>> execs += [{
>> 'name': 'qemu-system-' + target_name + 'w',
>> 'win_subsystem': 'windows',
>> - 'sources': files('system/main.c'),
>> + 'sources': [],
>> 'dependencies': [sdl]
>> }]
>> endif
>> diff --git a/system/meson.build b/system/meson.build
>> index 6d21ff9faa7..f358c2c446d 100644
>> --- a/system/meson.build
>> +++ b/system/meson.build
>> @@ -18,6 +18,7 @@ system_ss.add(files(
>> 'globals.c',
>> 'ioport.c',
>> 'ram-block-attributes.c',
>> + 'main.c',
>> 'memory_mapping.c',
>> 'memory.c',
>> 'physmem.c',
>
> This makes the build-oss-fuzz job to fail:
>
> FAILED: qemu-fuzz-i386
> clang -m64 @qemu-fuzz-i386.rsp
> /usr/bin/ld: libsystem.a.p/system_main.c.o: in function `main':
> /builds/philmd/qemu/build-oss-fuzz/../system/main.c:70: multiple
> definition of `main'; /usr/bin/../lib/clang/18/lib/x86_64-redhat-linux-
> gnu/libclang_rt.fuzzer.a(FuzzerMain.cpp.o):(.text+0x0): first defined here
> /usr/bin/ld: qemu-fuzz-i386.p/tests_qtest_fuzz_fuzz.c.o:(.bss+0x0):
> multiple definition of `__odr_asan_gen_qemu_main'; libsystem.a.p/
> system_main.c.o:(.bss+0x0): first defined here
> clang: error: linker command failed with exit code 1 (use -v to see
> invocation)
> ninja: build stopped: subcommand failed.
> make: *** [Makefile:168: run-ninja] Error 1
> Error : Build failed. Please specify a compiler with fuzzing support
> using the $CC and $CXX environment variables \nFor example: CC=clang
> CXX=clang++ ./scripts/oss-fuzz/build.sh, exiting.
>
> https://gitlab.com/philmd/qemu/-/jobs/11205571060
FYI I'm dropping this single patch from my queue (but keeping the
other two).
On 2025-09-01 22:51, Philippe Mathieu-Daudé wrote:
> On 1/9/25 17:07, Philippe Mathieu-Daudé wrote:
>> Hi,
>>
>> On 31/7/25 00:05, Pierrick Bouvier wrote:
>>> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
>>> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
>>> ---
>>> meson.build | 4 ++--
>>> system/meson.build | 1 +
>>> 2 files changed, 3 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/meson.build b/meson.build
>>> index f94209bb301..b72d4ce8618 100644
>>> --- a/meson.build
>>> +++ b/meson.build
>>> @@ -4420,14 +4420,14 @@ foreach target : target_dirs
>>> execs = [{
>>> 'name': 'qemu-system-' + target_name,
>>> 'win_subsystem': 'console',
>>> - 'sources': files('system/main.c'),
>>> + 'sources': [],
>>> 'dependencies': [sdl]
>>> }]
>>> if host_os == 'windows' and (sdl.found() or gtk.found())
>>> execs += [{
>>> 'name': 'qemu-system-' + target_name + 'w',
>>> 'win_subsystem': 'windows',
>>> - 'sources': files('system/main.c'),
>>> + 'sources': [],
>>> 'dependencies': [sdl]
>>> }]
>>> endif
>>> diff --git a/system/meson.build b/system/meson.build
>>> index 6d21ff9faa7..f358c2c446d 100644
>>> --- a/system/meson.build
>>> +++ b/system/meson.build
>>> @@ -18,6 +18,7 @@ system_ss.add(files(
>>> 'globals.c',
>>> 'ioport.c',
>>> 'ram-block-attributes.c',
>>> + 'main.c',
>>> 'memory_mapping.c',
>>> 'memory.c',
>>> 'physmem.c',
>>
>> This makes the build-oss-fuzz job to fail:
>>
>> FAILED: qemu-fuzz-i386
>> clang -m64 @qemu-fuzz-i386.rsp
>> /usr/bin/ld: libsystem.a.p/system_main.c.o: in function `main':
>> /builds/philmd/qemu/build-oss-fuzz/../system/main.c:70: multiple
>> definition of `main'; /usr/bin/../lib/clang/18/lib/x86_64-redhat-linux-
>> gnu/libclang_rt.fuzzer.a(FuzzerMain.cpp.o):(.text+0x0): first defined here
>> /usr/bin/ld: qemu-fuzz-i386.p/tests_qtest_fuzz_fuzz.c.o:(.bss+0x0):
>> multiple definition of `__odr_asan_gen_qemu_main'; libsystem.a.p/
>> system_main.c.o:(.bss+0x0): first defined here
>> clang: error: linker command failed with exit code 1 (use -v to see
>> invocation)
>> ninja: build stopped: subcommand failed.
>> make: *** [Makefile:168: run-ninja] Error 1
>> Error : Build failed. Please specify a compiler with fuzzing support
>> using the $CC and $CXX environment variables \nFor example: CC=clang
>> CXX=clang++ ./scripts/oss-fuzz/build.sh, exiting.
>>
>> https://gitlab.com/philmd/qemu/-/jobs/11205571060
>
> FYI I'm dropping this single patch from my queue (but keeping the
> other two).
>
Thanks, you did well.
Nothing critical on this specific patch.
© 2016 - 2026 Red Hat, Inc.