qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: "Philippe Mathieu-Daudé" <philmd@linaro.org>, qemu-devel@nongnu.org
Cc: "Thomas Huth" <thuth@redhat.com>,
	"Alistair Francis" <alistair.francis@wdc.com>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Warner Losh" <imp@bsdimp.com>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	"Michael Tokarev" <mjt@tls.msk.ru>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>
Subject: Re: [hotfix PATCH-for-8.1 v4] configure: Fix cross-building for RISCV host
Date: Tue, 11 Jul 2023 17:36:59 +0100	[thread overview]
Message-ID: <fc175fa2-f12c-b4ec-6622-ff0e85902bcc@linaro.org> (raw)
In-Reply-To: <20230711110619.56588-1-philmd@linaro.org>

On 7/11/23 12:06, Philippe Mathieu-Daudé wrote:
> While when building on native Linux the host architecture
> is reported as "riscv32" or "riscv64":
> 
>    Host machine cpu family: riscv64
>    Host machine cpu: riscv64
>    Found pkg-config: /usr/bin/pkg-config (0.29.2)
> 
> Since commit ba0e733362 ("configure: Merge riscv32 and riscv64
> host architectures"), when cross-compiling it is detected as
> "riscv". Meson handles the cross-detection but displays a warning:
> 
>    WARNING: Unknown CPU family riscv, please report this at https://github.com/mesonbuild/meson/issues/new
>    Host machine cpu family: riscv
>    Host machine cpu: riscv
>    Target machine cpu family: riscv
>    Target machine cpu: riscv
>    Found pkg-config: /usr/bin/riscv64-linux-gnu-pkg-config (1.8.1)
> 
> Now since commit 278c1bcef5 ("target/riscv: Only unify 'riscv32/64'
> -> 'riscv' for host cpu in meson") Meson expects the cpu to be in
> [riscv32, riscv64]. So when cross-building (for example on our
> cross-riscv64-system Gitlab-CI job) we get:
> 
>    WARNING: Unknown CPU family riscv, please report this at https://github.com/mesonbuild/meson/issues/new
>    Host machine cpu family: riscv
>    Host machine cpu: riscv
>    Target machine cpu family: riscv
>    Target machine cpu: riscv
>    ../meson.build:684:6: ERROR: Problem encountered: Unsupported CPU riscv, try --enable-tcg-interpreter
> 
> Fix by partially revert commit ba0e733362 so when cross-building
> the ./configure script passes the proper host architecture to meson.
> 
> Fixes: ba0e733362 ("configure: Merge riscv32 and riscv64 host architectures")
> Fixes: 278c1bcef5 ("target/riscv: Only unify 'riscv32/64' -> 'riscv' for host cpu in meson")
> Reported-by: Richard Henderson <richard.henderson@linaro.org>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> v4: pass from configure

Applied to master.


r~


> ---
>   configure | 6 +++++-
>   1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/configure b/configure
> index 2b41c49c0d..dffd44c059 100755
> --- a/configure
> +++ b/configure
> @@ -451,7 +451,11 @@ elif check_define __s390__ ; then
>       cpu="s390"
>     fi
>   elif check_define __riscv ; then
> -  cpu="riscv"
> +  if check_define _LP64 ; then
> +    cpu="riscv64"
> +  else
> +    cpu="riscv32"
> +  fi
>   elif check_define __arm__ ; then
>     cpu="arm"
>   elif check_define __aarch64__ ; then



      reply	other threads:[~2023-07-11 16:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-11 11:06 [hotfix PATCH-for-8.1 v4] configure: Fix cross-building for RISCV host Philippe Mathieu-Daudé
2023-07-11 16:36 ` Richard Henderson [this message]

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=fc175fa2-f12c-b4ec-6622-ff0e85902bcc@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=alex.bennee@linaro.org \
    --cc=alistair.francis@wdc.com \
    --cc=berrange@redhat.com \
    --cc=imp@bsdimp.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=mjt@tls.msk.ru \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=thuth@redhat.com \
    /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).