qemu-riscv
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2] docs/devel: Add cross-compiling doc


From: Andrew Jones
Subject: Re: [PATCH v2] docs/devel: Add cross-compiling doc
Date: Thu, 7 Sep 2023 14:31:18 +0200

On Thu, Sep 07, 2023 at 11:20:55AM +0100, Alex Bennée wrote:
> 
> Andrew Jones <ajones@ventanamicro.com> writes:
> 
> > Add instructions for how to cross-compile QEMU for RISC-V. The
> > file is named generically because there's no reason not to collect
> > other architectures steps into the same file, especially because
> > several subsections like those for cross-compiling QEMU dependencies
> > using meson and a cross-file could be shared. Additionally, other
> > approaches to creating sysroots, such as with debootstrap, may be
> > documented in this file in the future.
> >
> > Signed-off-by: Andrew Jones <ajones@ventanamicro.com>
> > ---
> >  docs/devel/cross-compiling.rst | 221 +++++++++++++++++++++++++++++++++
> >  docs/devel/index-build.rst     |   1 +
> >  2 files changed, 222 insertions(+)
> >  create mode 100644 docs/devel/cross-compiling.rst
> >
> > diff --git a/docs/devel/cross-compiling.rst b/docs/devel/cross-compiling.rst
> > new file mode 100644
> > index 000000000000..1b988ba54e4c
> > --- /dev/null
> > +++ b/docs/devel/cross-compiling.rst
> > @@ -0,0 +1,221 @@
> > +.. SPDX-License-Identifier: GPL-2.0-or-later
> > +
> > +====================
> > +Cross-compiling QEMU
> > +====================
> > +
> > +Cross-compiling QEMU first requires the preparation of a cross-toolchain
> > +and the cross-compiling of QEMU's dependencies. While the steps will be
> > +similar across architectures, each architecture will have its own specific
> > +recommendations.
> 
> "some architectures" - most of the cross compile stuff is hidden away by
> the build system on systems with appropriate development libraries
> installed. I think we would be remiss if we didn't just outline the
> common case:
> 
>    ../configure --cross-prefix=riscv64-linux-gnu-
> 
> I think we could make it clearer that in most cases you don't need to
> prepare and cross-compile a bunch of dependencies lest we send
> developers down a rabbit hole.
> 
> Maybe build-system.rst be updated and this reference it for the common
> case?
> 

Hi Alex,

tl;dr, I'd welcome instructions helping people get cross-arch development
libraries installed without having to build them. I wouldn't make a good
author for those instructions, though, since I don't know how.

I'm guessing the dependencies can be installed with a distro's package
management, assuming the package management supports cross-arch
installation and installing to a specified root directory. I'm on Fedora,
so I just tried

 $ sudo dnf install --forcearch=aarch64 --installroot=$SYSROOT --releasever=36 
glib2-devel

but it wanted to install a huge number of packages, which most people
probably wouldn't want to do. Maybe that command isn't what you had in
mind or other distros can manage this better. I'm all ears.

Thanks,
drew



reply via email to

[Prev in Thread] Current Thread [Next in Thread]