[PATCH 06/24] RFC: configure: use the same machine as the host triple by default

marcandre.lureau@redhat.com posted 24 patches 1 week, 2 days ago
Maintainers: "Alex Bennée" <alex.bennee@linaro.org>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Thomas Huth <thuth@redhat.com>, Yonggang Luo <luoyonggang@gmail.com>, Paolo Bonzini <pbonzini@redhat.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, "Daniel P. Berrangé" <berrange@redhat.com>, Kohei Tokunaga <ktokunaga.mail@gmail.com>, Warner Losh <imp@bsdimp.com>, Kyle Evans <kevans@freebsd.org>, Ed Maste <emaste@freebsd.org>, Li-Wen Hsu <lwhsu@freebsd.org>
There is a newer version of this series
[PATCH 06/24] RFC: configure: use the same machine as the host triple by default
Posted by marcandre.lureau@redhat.com 1 week, 2 days ago
From: Marc-André Lureau <marcandre.lureau@redhat.com>

IIRC, this fixes build on msys2 - although I can't reproduce. Maybe with
some other host, on *bsd?

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure b/configure
index 32eb313941..c2f4534964 100755
--- a/configure
+++ b/configure
@@ -1205,7 +1205,7 @@ if test "$rust" != disabled && test -z "$rust_target_triple"; then
   # arch and os generally matches between meson and rust
   rust_arch=$host_arch
   rust_os=$host_os
-  rust_machine=unknown
+  rust_machine=$(echo $rust_host_triple | cut -d- -f2)
   rust_osvariant=
 
   # tweak rust_os if needed; also, machine and variant depend on the OS
-- 
2.51.0


Re: [PATCH 06/24] RFC: configure: use the same machine as the host triple by default
Posted by Paolo Bonzini 1 week, 2 days ago
On 9/19/25 15:33, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> IIRC, this fixes build on msys2 - although I can't reproduce. Maybe with
> some other host, on *bsd?
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>   configure | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/configure b/configure
> index 32eb313941..c2f4534964 100755
> --- a/configure
> +++ b/configure
> @@ -1205,7 +1205,7 @@ if test "$rust" != disabled && test -z "$rust_target_triple"; then
>     # arch and os generally matches between meson and rust
>     rust_arch=$host_arch
>     rust_os=$host_os
> -  rust_machine=unknown
> +  rust_machine=$(echo $rust_host_triple | cut -d- -f2)
In theory the machine, when not unknown, should be computed in the case 
statement(s) below.  I remember I checked against "rustc --print 
target-list" but I could have missed some.

Paolo


Re: [PATCH 06/24] RFC: configure: use the same machine as the host triple by default
Posted by Paolo Bonzini 1 week, 1 day ago
On Fri, Sep 19, 2025 at 5:11 PM Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> On 9/19/25 15:33, marcandre.lureau@redhat.com wrote:
> > From: Marc-André Lureau <marcandre.lureau@redhat.com>
> >
> > IIRC, this fixes build on msys2 - although I can't reproduce. Maybe with
> > some other host, on *bsd?

msys2 should have host_os=windows, so rust_machine would be
overwritten to pc below. The only cases where this makes a difference
should be cygwin, which is not supported, and wasm32 (I guess the Rust
triple to use would be wasm32-wasip1-threads).

Paolo