qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Tanish Desai <tanishdesai37@gmail.com>, qemu-devel@nongnu.org
Cc: "Thomas Huth" <thuth@redhat.com>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Paolo Bonzini" <pbonzini@redhat.com>
Subject: Re: [PATCH] Fix duplicate symbol error on MacOS build
Date: Wed, 19 Mar 2025 14:52:43 +0100	[thread overview]
Message-ID: <b642a46c-6b7d-4afe-a9fe-0c4ee9f734a0@linaro.org> (raw)
In-Reply-To: <20250319023036.71493-1-tanishdesai37@gmail.com>

Cc'ing CI maintainers.

On 19/3/25 03:30, Tanish Desai wrote:
> The issue started after commit https://github.com/qemu/qemu/commit/59f4d65584bd3372070e2484876436c8d02505e4
> 
> Reproduction:
>    1. In the build directory on MacOS (haven't tried on other OS), run:
>         ../configure --enable-rust --target-list=aarch64-softmmu

This config isn't covered on our CI, we only test --enable-rust on
Linux. Should we also test it for all non-Linux hosts? I'd rather not...

>    2. Then run either:
>         ninja -C .
>         OR
>         make
>    3. At the end, you will encounter the error:
>         duplicate symbol '_pl011_create' in:
>             /Users/tanishdesai37/Downloads/qemu-master/build/libcommon.a.p/hw_char_pl011.c.o
>             librust_aarch64_softmmu.a[5](pl011.pl011.390d424367e209af-cgu.1.rcgu.o)
>         ld: 1 duplicate symbols
> 
> Root cause:
>    Both CONFIG_PL011 and X_PL011_RUST are selected, causing C++ and Rust to produce the same object.
>    This is due to the commit above where 'select PL011' forces a true condition instead of checking if HAVE_RUST is true.
>    If HAVE_RUST is true, X_PL011_RUST should be selected instead of CONFIG_PL011.
> 
> Signed-off-by: Tanish Desai <tanishdesai37@gmail.com>
> ---
>   hw/vmapple/Kconfig | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/vmapple/Kconfig b/hw/vmapple/Kconfig
> index 2382b297672..01bcbf40e00 100644
> --- a/hw/vmapple/Kconfig
> +++ b/hw/vmapple/Kconfig
> @@ -22,7 +22,8 @@ config VMAPPLE
>       select PLATFORM_BUS
>       select PCI_EXPRESS
>       select PCI_EXPRESS_GENERIC_BRIDGE
> -    select PL011 # UART
> +    select PL011 if !HAVE_RUST # UART
> +    select X_PL011_RUST if HAVE_RUST # UART
>       select PL031 # RTC
>       select PL061 # GPIO
>       select GPIO_PWR



  parent reply	other threads:[~2025-03-19 13:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-19  2:30 [PATCH] Fix duplicate symbol error on MacOS build Tanish Desai
2025-03-19 13:44 ` Peter Maydell
2025-03-19 13:49   ` Philippe Mathieu-Daudé
2025-03-19 14:02     ` Tanish Desai
2025-03-19 16:43       ` Peter Maydell
2025-03-19 14:36   ` Paolo Bonzini
2025-03-19 13:52 ` Philippe Mathieu-Daudé [this message]
2025-03-19 14:26   ` Daniel P. Berrangé

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=b642a46c-6b7d-4afe-a9fe-0c4ee9f734a0@linaro.org \
    --to=philmd@linaro.org \
    --cc=alex.bennee@linaro.org \
    --cc=berrange@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=tanishdesai37@gmail.com \
    --cc=thuth@redhat.com \
    /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).