From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: qemu-rust@nongnu.org, qemu-stable@nongnu.org
Subject: [PATCH] rust: add --rust-target option for bindgen
Date: Thu, 6 Feb 2025 12:15:13 +0100 [thread overview]
Message-ID: <20250206111514.2134895-1-pbonzini@redhat.com> (raw)
Without it, recent bindgen will give an error
error: extern block cannot be declared unsafe
if rustc is not new enough to support the "unsafe extern" construct.
Cc: qemu-rust@nongnu.org
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
meson.build | 3 +++
1 file changed, 3 insertions(+)
diff --git a/meson.build b/meson.build
index 2c9ac9cfe1e..131b2225ab6 100644
--- a/meson.build
+++ b/meson.build
@@ -4054,6 +4054,9 @@ if have_rust
bindgen_args += ['--formatter', 'none']
endif
endif
+ if bindgen.version().version_compare('>=0.66.0')
+ bindgen_args += ['--rust-target', '1.59']
+ endif
if bindgen.version().version_compare('<0.61.0')
# default in 0.61+
bindgen_args += ['--size_t-is-usize']
--
2.48.1
next reply other threads:[~2025-02-06 11:15 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-06 11:15 Paolo Bonzini [this message]
2025-02-06 11:15 ` [PATCH] rust: pl011: convert pl011_create to safe Rust Paolo Bonzini
2025-02-10 9:59 ` Zhao Liu
2025-02-10 10:47 ` vtables and procedural macros (was Re: [PATCH] rust: pl011: convert pl011_create to safe Rust) Paolo Bonzini
2025-02-11 5:21 ` Junjie Mao
2025-02-11 9:00 ` Paolo Bonzini
2025-02-11 10:31 ` Junjie Mao
2025-02-11 12:16 ` Junjie Mao
2025-02-11 12:27 ` Paolo Bonzini
2025-02-12 1:22 ` Junjie Mao
2025-02-06 11:37 ` [PATCH] rust: add --rust-target option for bindgen Philippe Mathieu-Daudé
2025-02-06 11:38 ` Paolo Bonzini
2025-02-06 11:43 ` Philippe Mathieu-Daudé
2025-02-08 14:03 ` Stefan Hajnoczi
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=20250206111514.2134895-1-pbonzini@redhat.com \
--to=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-rust@nongnu.org \
--cc=qemu-stable@nongnu.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).