qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Junjie Mao <junjie.mao@intel.com>
To: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	"Thomas Huth" <thuth@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"John Snow" <jsnow@redhat.com>, "Cleber Rosa" <crosa@redhat.com>,
	"Beraldo Leal" <bleal@redhat.com>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Wainer dos Santos Moschetta" <wainersm@redhat.com>,
	"Liu, Zhao1" <zhao1.liu@intel.com>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"ARM TCG CPUs" <qemu-arm@nongnu.org>,
	"Stefan Hajnoczi" <stefanha@redhat.com>,
	"Pierrick Bouvier" <pierrick.bouvier@linaro.org>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Gustavo Romero" <gustavo.romero@linaro.org>,
	"Hart, Rowan" <rowan.hart@intel.com>,
	"Mads Ynddal" <mads@ynddal.dk>,
	"Markus Armbruster" <armbru@redhat.com>
Subject: Re: [PATCH v7 0/7] Add Rust build support, ARM PL011 device impl
Date: Fri, 16 Aug 2024 16:06:10 +0800	[thread overview]
Message-ID: <8f5f670b-313e-4172-a04b-ff8439bc4777@intel.com> (raw)
In-Reply-To: <20240815-rust-pl011-v7-0-975135e98831@linaro.org>

On 8/15/2024 7:42 PM, Manos Pitsidianakis wrote:
> Outstanding issues
> ==================
> 
> Outstanding issues that are not blocking for merge are:
> 
> - Cross-compilation for aarch64 is not possible out-of-the-box because of this bug:
>    <https://github.com/rust-lang/rust/issues/125619> in llvm which when
>    fixed, must be ported to upstream rust's llvm fork. Since the problem
>    is an extraneous symbol we could strip it with objcopy -N|--strip-symbol
> - Adding more than one Rust device ends up with duplicate symbols from
>    rust std library because we are linking as whole archives because...
>    constructors are stripped by the linker otherwise :( It can be worked
>    around if a single Rust library is built with all the devices as
>    dependencies which is then linked to qemu. The fix is a small change
>    which I will add either in a next version or when a new Rust device is
>    added.
> 

Hi Manos,

I also noticed that when I tried adding a second device. Some other projects met 
similar issues [1], but no clean solution seems to be available yet. The options 
are:

1) Combining all crates into one staticlib which is linked to the final 
executable. That requires generating one .rs with extern crate decls of all 
enabled crates. In the context of QEMU, different targets may enable different 
set of crates (e.g., some crates have arch constraints), thus one .rs for each 
target will be needed in general.

2) Linking rlibs (or emitted objects) directly with other C objects using the C 
linker. That somehow works (with some tricks) but is not officially supported 
and may break in the future.

I'm working on (1), but would like to have your thoughts and preference on those 
options.

[1] https://github.com/rust-lang/rust/issues/73632

---
Best Regards
Junjie Mao


  parent reply	other threads:[~2024-08-16  8:07 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-15 11:42 [PATCH v7 0/7] Add Rust build support, ARM PL011 device impl Manos Pitsidianakis
2024-08-15 11:42 ` [PATCH v7 1/7] Require meson version 1.5.0 Manos Pitsidianakis
2024-08-15 11:42 ` [PATCH v7 2/7] build-sys: Add rust feature option Manos Pitsidianakis
2024-08-15 11:42 ` [PATCH v7 3/7] configure, meson: detect Rust toolchain Manos Pitsidianakis
2024-08-15 11:42 ` [PATCH v7 4/7] rust: add bindgen step as a meson dependency Manos Pitsidianakis
2024-08-15 11:42 ` [PATCH v7 5/7] .gitattributes: add Rust diff and merge attributes Manos Pitsidianakis
2024-08-15 11:42 ` [PATCH v7 6/7] rust: add crate to expose bindings and interfaces Manos Pitsidianakis
2024-08-15 14:01   ` Philippe Mathieu-Daudé
2024-08-15 14:50     ` Manos Pitsidianakis
2024-08-15 15:06     ` Daniel P. Berrangé
2024-08-16  8:34       ` Philippe Mathieu-Daudé
2024-08-21  7:24         ` Manos Pitsidianakis
2024-08-16  8:26   ` Junjie Mao
2024-08-15 11:42 ` [PATCH v7 7/7] rust: add PL011 device model Manos Pitsidianakis
2024-08-15 17:10 ` [PATCH v7 0/7] Add Rust build support, ARM PL011 device impl Peter Maydell
2024-08-16  8:06 ` Junjie Mao [this message]
2024-08-16  8:17   ` Manos Pitsidianakis
2024-08-19  4:09     ` Junjie Mao

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=8f5f670b-313e-4172-a04b-ff8439bc4777@intel.com \
    --to=junjie.mao@intel.com \
    --cc=alex.bennee@linaro.org \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=bleal@redhat.com \
    --cc=crosa@redhat.com \
    --cc=gustavo.romero@linaro.org \
    --cc=jsnow@redhat.com \
    --cc=mads@ynddal.dk \
    --cc=manos.pitsidianakis@linaro.org \
    --cc=marcandre.lureau@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@linaro.org \
    --cc=pierrick.bouvier@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=rowan.hart@intel.com \
    --cc=stefanha@redhat.com \
    --cc=thuth@redhat.com \
    --cc=wainersm@redhat.com \
    --cc=zhao1.liu@intel.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).