mirror of
https://github.com/qemu/qemu.git
synced 2026-02-15 05:35:55 +00:00
With the bump to Meson 1.10.0, C objects can be passed to rust targets. This way, the Rust libstd will be added by rustc itself in its final linker invocation. Use that to eliminate the staticlib and allow dynamic linking with libstd (also introduced by Meson 1.9.0, but not for staticlib crates due to lack of support in rustc). The main() function is still provided by C, which is possible by declaring the main source file of the Rust executable (which is still created by scripts/rust/rust_root_crate.sh) as #![no_main]. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
15 lines
184 B
Bash
Executable File
15 lines
184 B
Bash
Executable File
#!/bin/sh
|
|
|
|
set -eu
|
|
|
|
cat <<EOF
|
|
// @generated
|
|
// This file is autogenerated by scripts/rust/rust_root_crate.sh
|
|
|
|
#![no_main]
|
|
EOF
|
|
|
|
for crate in $*; do
|
|
echo "extern crate $crate;"
|
|
done
|