[all-commits] [llvm/llvm-project] ba11e1: [docs] Rewrite HowToCrossCompileLLVM (#129451)

Alex Bradbury via All-commits all-commits at lists.llvm.org
Tue Mar 11 11:34:14 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ba11e1e5222cb5bdcd8d63f23fb994cc0a8ffb3c
      https://github.com/llvm/llvm-project/commit/ba11e1e5222cb5bdcd8d63f23fb994cc0a8ffb3c
  Author: Alex Bradbury <asb at igalia.com>
  Date:   2025-03-11 (Tue, 11 Mar 2025)

  Changed paths:
    M llvm/docs/HowToCrossCompileLLVM.rst

  Log Message:
  -----------
  [docs] Rewrite HowToCrossCompileLLVM (#129451)

The document has had a few minor tweaks over the years, but the last
major piece of work on it was 2016, after first being introduced in
2013. My aim is to provide a clear and clean recipe for cross-compiling
LLVM that:
* Should be achievable for anyone on common variants of Linux
(_including_ the step of acquiring a working sysroot).
* I think I've kept the coverage of setting up acquiring a Debian
sysroot minimal enough that it can reasonably be included. `debootstrap`
is packaged for most common Linux distributions including non-Debian
derived distributions like Arch Linux and Fedora.
* Describes a setup that we can reasonably support within the community.
* I realise with the ninja symlink canonicalisation issue I haven't
completely avoided hacks, but I look particularly to point 2 under hacks
in the current docs which talks about libraries on the host being found
by CMake and adding `-L` and `-I` to try to hack around this. We've all
been there and made these kind of temporary workarounds to see if we can
get further, but it's very hard to support someone who has problems with
a setup that's improperly leaking between the host and target like this.
The approach I describe with a clean sysroot and setting appropriate
`CMAKE_FIND_ROOT_PATH_MODE_*` settings doesn't have this issue.
* Cuts down on extraneous / outdated information, especially where it is
better covered elsewhere (e.g. detailed descriptions of CMake options
not directly relevant to cross compilation).

I've run through the instructions for AArch64, RISC-V (64-bit), and
armhf.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list