From eaabf0e5f0ebb3f0b621fb57cf9e9393210d5569 Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Fri, 1 Nov 2024 15:03:34 -0700 Subject: [PATCH] docs: cross-compile: add useful "apt" and "dnf" builddep commands MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These have been tested only with x86_64->i686 cross-compilation but I don't see why they couldn't work with other architectures if/when Linux distributions support them. For at least x86_64->i686 cross-compilation, these commands save an enormous amount of time. Reviewed-by: Tapani Pälli Part-of: --- docs/meson.rst | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/docs/meson.rst b/docs/meson.rst index 1f8c8456cb6..492812c7bdc 100644 --- a/docs/meson.rst +++ b/docs/meson.rst @@ -484,6 +484,31 @@ of those, as they'll have the right values for your system: - `meson-cross-x86-linux-gnu `__ - `meson-cross-aarch64-linux-gnu `__ +Cross-compilation requires cross-compiled versions of the same build +dependencies listed at the top of this page. + +On Debian, Ubuntu and similar, the command ``sudo apt-rdepends +--build-depends --follow=DEPENDS mesa`` provides a complete and +up-to-date list of all build dependencies. Append the ``:i386`` suffix +(or your desired architecture) to package names and install the ones you +need like this: ``sudo apt install libwayland-dev:i386 libelf-dev:i386 +...`` + +On Fedora and similar, try ``sudo setarch i686 dnf builddep mesa``. If +that fails, ``sudo dnf builddep mesa`` prints all native dependencies +even when they are already installed. Replace the ``.x86_64`` suffix +with ``.686`` (or your desired architecture) and install the ones you +need. + +You do not need a cross-compiled version of the dependencies like +``python3``, ``bison``, ``flex``, ``bindgen``,... that are *used only at +build time*. Some unnecessary ones may even confuse your system +configuration. Also, remember that some dependencies are optional +depending on how you configure your ``meson setup ...`` command - this +is not specific to cross-compilation; see details above. So you may want +to proceed with trial-and-error and install only cross-compiled packages +needed to fix build error messages. + 32-bit build on x86 linux: .. code-block:: ini