configure: set the bindgen cross target

Implement a bash version of rust-bindgen rust_to_clang_target() to
convert from rust target to clang target.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-ID: <20250924120426.2158655-8-marcandre.lureau@redhat.com>
This commit is contained in:
Marc-André Lureau
2025-09-24 16:04:04 +04:00
parent c102f036bf
commit 0d4fb8f746
4 changed files with 111 additions and 1 deletions

7
configure vendored
View File

@@ -1878,6 +1878,13 @@ if test "$skip_meson" = no; then
eval "c=\$devices_${a}"
echo "${a}-softmmu = '$c'" >> $cross
done
if test "$rust" != disabled; then
if test "$cross_compile" = "yes"; then
. "$source_path/scripts/rust-to-clang-target.sh"
clang_target=$(rust_to_clang_target "$rust_target_triple")
echo "bindgen_clang_arguments = [$(meson_quote --target="$clang_target")]" >> $cross
fi
fi
echo "[built-in options]" >> $cross
echo "c_args = [$(meson_quote $CFLAGS $EXTRA_CFLAGS)]" >> $cross