qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-devel@nongnu.org, "Thomas Huth" <thuth@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	"Michael Tokarev" <mjt@tls.msk.ru>,
	"Alistair Francis" <alistair.francis@wdc.com>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Richard Henderson" <richard.henderson@linaro.org>
Subject: Re: [hotfix PATCH-for-8.1 v2] meson: Fix cross-building for RISCV host
Date: Tue, 11 Jul 2023 12:05:21 +0200	[thread overview]
Message-ID: <3d25f58e-e926-2eeb-470c-5c816771577f@linaro.org> (raw)
In-Reply-To: <CAFEAcA9f0_dYHR9AbPdZxnk3Fk5Pqcwvv94PvLXOUTxSC8p=4g@mail.gmail.com>

On 11/7/23 11:35, Peter Maydell wrote:
> On Tue, 11 Jul 2023 at 10:26, Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
>>
>> While when building on native Linux the host architecture
>> is reported as "riscv32" or "riscv64", 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
> 
> So where does the "riscv" string come from? It seems odd,
> because don't we need to specify whether it's 32 or
> 64 bit ?
> 
> (https://github.com/mesonbuild/meson/issues/5950
> got closed as "not a bug in meson, you should be using
> riscv32 or riscv64 instead".)

The meson-log.txt isn't very helpful:

======

Build started at 2023-07-11T08:42:37.510716
Main binary: 
/home/philippe.mathieu-daude/qemu/build/docker_debian-riscv64-cross/pyvenv/bin/python3
Build Options: -Dwerror=true -Ddocs=disabled -Dprefix=/usr/local 
--cross-file=config-meson.cross
Python system: Linux
The Meson build system
Version: 1.1.1
Source dir: /home/philippe.mathieu-daude/qemu
Build dir: 
/home/philippe.mathieu-daude/qemu/build/docker_debian-riscv64-cross
Build type: cross build
Project name: qemu
Project version: 8.0.50
-----
Detecting compiler via: riscv64-linux-gnu-gcc --version
compiler returned <Popen: returncode: 0 args: ['riscv64-linux-gnu-gcc', 
'--version']>
compiler stdout:
riscv64-linux-gnu-gcc (Debian 12.3.0-4) 12.3.0
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


compiler stderr:

Running command: riscv64-linux-gnu-gcc -E -dM -
-----
Detecting linker via: riscv64-linux-gnu-gcc -Wl,--version
linker returned <Popen: returncode: 0 args: ['riscv64-linux-gnu-gcc', 
'-Wl,--version']>
linker stdout:
GNU ld (GNU Binutils for Debian) 2.40.90.20230705
Copyright (C) 2023 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later 
version.
This program has absolutely no warranty.

linker stderr:
collect2 version 12.3.0
/usr/lib/gcc-cross/riscv64-linux-gnu/12/../../../../riscv64-linux-gnu/bin/ld 
-plugin /usr/lib/gcc-cross/riscv64-linux-gnu/12/liblto_plugin.so 
-plugin-opt=/usr/lib/gcc-cross/riscv64-linux-gnu/12/lto-wrapper 
-plugin-opt=-fresolution=/tmp/ccbttPz7.res 
-plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s 
-plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc 
-plugin-opt=-pass-through=-lgcc_s --sysroot=/ --build-id --eh-frame-hdr 
-hash-style=gnu --as-needed -melf64lriscv -dynamic-linker 
/lib/ld-linux-riscv64-lp64d.so.1 -pie 
/usr/lib/gcc-cross/riscv64-linux-gnu/12/../../../../riscv64-linux-gnu/lib/Scrt1.o 
/usr/lib/gcc-cross/riscv64-linux-gnu/12/crti.o 
/usr/lib/gcc-cross/riscv64-linux-gnu/12/crtbeginS.o 
-L/usr/lib/gcc-cross/riscv64-linux-gnu/12 
-L/usr/lib/gcc-cross/riscv64-linux-gnu/12/../../../../riscv64-linux-gnu/lib 
-L/lib/riscv64-linux-gnu -L/usr/lib/riscv64-linux-gnu --version -lgcc 
--push-state --as-needed -lgcc_s --pop-state -lc -lgcc --push-state 
--as-needed -lgcc_s --pop-state 
/usr/lib/gcc-cross/riscv64-linux-gnu/12/crtendS.o 
/usr/lib/gcc-cross/riscv64-linux-gnu/12/crtn.o

Sanity testing C compiler: riscv64-linux-gnu-gcc
Is cross compiler: True.
Sanity check compiler command line: riscv64-linux-gnu-gcc sanitycheckc.c 
-o sanitycheckc_cross.exe -D_FILE_OFFSET_BITS=64 -c
Sanity check compile stdout:

-----
Sanity check compile stderr:

-----
C compiler for the host machine: riscv64-linux-gnu-gcc (gcc 12.3.0 
"riscv64-linux-gnu-gcc (Debian 12.3.0-4) 12.3.0")
C linker for the host machine: riscv64-linux-gnu-gcc ld.bfd 2.40.90.20230705
-----
Detecting compiler via: cc --version
compiler returned <Popen: returncode: 0 args: ['cc', '--version']>
compiler stdout:
cc (Debian 12.3.0-5) 12.3.0
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


compiler stderr:

Running command: cc -E -dM -
-----
Detecting linker via: cc -Wl,--version
linker returned <Popen: returncode: 0 args: ['cc', '-Wl,--version']>
linker stdout:
GNU ld (GNU Binutils for Debian) 2.40.90.20230705
Copyright (C) 2023 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later 
version.
This program has absolutely no warranty.

linker stderr:
collect2 version 12.3.0
/usr/bin/ld -plugin /usr/lib/gcc/x86_64-linux-gnu/12/liblto_plugin.so 
-plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/12/lto-wrapper 
-plugin-opt=-fresolution=/tmp/ccfGNRcN.res 
-plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s 
-plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc 
-plugin-opt=-pass-through=-lgcc_s --build-id --eh-frame-hdr -m 
elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker 
/lib64/ld-linux-x86-64.so.2 -pie 
/usr/lib/gcc/x86_64-linux-gnu/12/../../../x86_64-linux-gnu/Scrt1.o 
/usr/lib/gcc/x86_64-linux-gnu/12/../../../x86_64-linux-gnu/crti.o 
/usr/lib/gcc/x86_64-linux-gnu/12/crtbeginS.o 
-L/usr/lib/gcc/x86_64-linux-gnu/12 
-L/usr/lib/gcc/x86_64-linux-gnu/12/../../../x86_64-linux-gnu 
-L/usr/lib/gcc/x86_64-linux-gnu/12/../../../../lib 
-L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu 
-L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/12/../../.. --version 
-lgcc --push-state --as-needed -lgcc_s --pop-state -lc -lgcc 
--push-state --as-needed -lgcc_s --pop-state 
/usr/lib/gcc/x86_64-linux-gnu/12/crtendS.o 
/usr/lib/gcc/x86_64-linux-gnu/12/../../../x86_64-linux-gnu/crtn.o

Sanity testing C compiler: ccache cc
Is cross compiler: False.
Sanity check compiler command line: ccache cc sanitycheckc.c -o 
sanitycheckc.exe -D_FILE_OFFSET_BITS=64
Sanity check compile stdout:

-----
Sanity check compile stderr:

-----
Running test binary command: 
/home/philippe.mathieu-daude/qemu/build/docker_debian-riscv64-cross/meson-private/sanitycheckc.exe
C compiler for the build machine: ccache cc (gcc 12.3.0 "cc (Debian 
12.3.0-5) 12.3.0")
C linker for the build machine: cc ld.bfd 2.40.90.20230705
Build machine cpu family: x86_64
Build machine cpu: x86_64
Host machine cpu family: riscv
Host machine cpu: riscv
Target machine cpu family: riscv
Target machine cpu: riscv
Program scripts/symlink-install-tree.py found: YES 
(/home/philippe.mathieu-daude/qemu/build/docker_debian-riscv64-cross/pyvenv/bin/python3 
/home/philippe.mathieu-daude/qemu/scripts/symlink-install-tree.py)
Program sh found: YES (/usr/bin/sh)
Program python3 found: YES 
(/home/philippe.mathieu-daude/qemu/build/docker_debian-riscv64-cross/pyvenv/bin/python3)

[...]

======




      reply	other threads:[~2023-07-11 10:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-11  9:25 [hotfix PATCH-for-8.1 v2] meson: Fix cross-building for RISCV host Philippe Mathieu-Daudé
2023-07-11  9:35 ` Peter Maydell
2023-07-11 10:05   ` Philippe Mathieu-Daudé [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=3d25f58e-e926-2eeb-470c-5c816771577f@linaro.org \
    --to=philmd@linaro.org \
    --cc=alistair.francis@wdc.com \
    --cc=berrange@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=mjt@tls.msk.ru \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.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).