diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2024-12-20 10:37:34 +0100 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2025-04-04 11:56:17 -0700 |
commit | a53f129586812c932776d201a891a484f73f0bac (patch) | |
tree | 026dd2269e4d48d9ea1824ca002abcb31851af15 /docs/markdown/snippets/rust-objects.md | |
parent | 9b0a178a27be75f7b53ada4bacde2a7de418281e (diff) | |
download | meson-a53f129586812c932776d201a891a484f73f0bac.zip meson-a53f129586812c932776d201a891a484f73f0bac.tar.gz meson-a53f129586812c932776d201a891a484f73f0bac.tar.bz2 |
rust: add external objects to the link command line
Because rustc does not support extract_objects, QEMU creates a static library
with all the C objects. It then passes this static library as link_whole,
together with another static library containing general purpose utility
functions which is passed as link_with.
However, this is brittle because the two have a circular dependency and
they cannot be merged because of the link_whole/link_with difference.
While lld seems to have the --start-group/--end-group semantics
automatically, ld.bfd can fail if these options are needed. This can
cause difference between distros depending on how Rust is packaged
(e.g. Ubuntu 22.04 and Debian bookworm seem to use ld.bfd).
The simplest solution is for Meson to implement "objects:" properly
for Rust. Then QEMU can use the same internal dependency objects that it
already has in place for C programs.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'docs/markdown/snippets/rust-objects.md')
-rw-r--r-- | docs/markdown/snippets/rust-objects.md | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/docs/markdown/snippets/rust-objects.md b/docs/markdown/snippets/rust-objects.md new file mode 100644 index 0000000..575e1f6 --- /dev/null +++ b/docs/markdown/snippets/rust-objects.md @@ -0,0 +1,4 @@ +## `objects` added correctly to Rust executables + +Any objects included in a Rust executable were previously ignored. They +are now added correctly. |