qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Pierrick Bouvier <pierrick.bouvier@linaro.org>,
	qemu-devel@nongnu.org, Alexander Bulekov <alxndr@bu.edu>
Cc: "Richard Henderson" <richard.henderson@linaro.org>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Daniel P. Berrangé" <berrange@redhat.com>
Subject: Re: [PATCH v2 3/3] system/main.c: compile only once
Date: Mon, 1 Sep 2025 17:07:36 +0200	[thread overview]
Message-ID: <c6b5359b-27d0-4776-9690-7d49debe3d7c@linaro.org> (raw)
In-Reply-To: <20250730220519.1140447-4-pierrick.bouvier@linaro.org>

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



  reply	other threads:[~2025-09-01 15:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-30 22:05 [PATCH v2 0/3] single-binary: compile some top level files once Pierrick Bouvier
2025-07-30 22:05 ` [PATCH v2 1/3] cpu-target: build compilation unit once for user/system Pierrick Bouvier
2025-07-30 22:05 ` [PATCH v2 2/3] include/exec/target_page.h: move page-target.c to header Pierrick Bouvier
2025-07-30 22:05 ` [PATCH v2 3/3] system/main.c: compile only once Pierrick Bouvier
2025-09-01 15:07   ` Philippe Mathieu-Daudé [this message]
2025-09-01 20:51     ` Philippe Mathieu-Daudé
2025-09-02  8:40       ` Pierrick Bouvier
2025-08-22 14:30 ` [PATCH v2 0/3] single-binary: compile some top level files once Pierrick Bouvier
2025-08-22 14:54 ` Philippe Mathieu-Daudé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c6b5359b-27d0-4776-9690-7d49debe3d7c@linaro.org \
    --to=philmd@linaro.org \
    --cc=alxndr@bu.edu \
    --cc=berrange@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=pierrick.bouvier@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).