From c3cdfe2a328c59213b614a2b723184582550f8c7 Mon Sep 17 00:00:00 2001 From: Zixian Cai Date: Wed, 25 Oct 2023 08:33:10 +0000 Subject: [PATCH] 8318692: Add instructions for creating Ubuntu-based sysroot for cross compilation Reviewed-by: erikj, shade --- doc/building.html | 11 +++++++++++ doc/building.md | 15 +++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/doc/building.html b/doc/building.html index 2348c398a53..3601fa8af16 100644 --- a/doc/building.html +++ b/doc/building.html @@ -1413,6 +1413,17 @@ like this:

http://httpredir.debian.org/debian/ # If the target architecture is `riscv64`, # the path should be `debian-ports` instead of `debian`. +
  • To create a Ubuntu-based chroot:

    +
    sudo debootstrap \
    +  --arch=arm64 \
    +  --verbose \
    +  --components=main,universe \
    +  --include=fakeroot,symlinks,build-essential,libx11-dev,libxext-dev,libxrender-dev,libxrandr-dev,libxtst-dev,libxt-dev,libcups2-dev,libfontconfig1-dev,libasound2-dev,libfreetype6-dev,libpng-dev,libffi-dev \
    +  --resolve-deps \
    +  jammy \
    +  ~/sysroot-arm64 \
    +  http://ports.ubuntu.com/ubuntu-ports/
    +# symlinks is in the universe repository
  • Make sure the symlinks inside the newly created chroot point to proper locations:

    sudo chroot ~/sysroot-arm64 symlinks -cr .
  • diff --git a/doc/building.md b/doc/building.md index ac79cb314b6..68c65bf0517 100644 --- a/doc/building.md +++ b/doc/building.md @@ -1197,6 +1197,21 @@ For example, cross-compiling to AArch64 from x86_64 could be done like this: # the path should be `debian-ports` instead of `debian`. ``` + * To create a Ubuntu-based chroot: + + ``` + sudo debootstrap \ + --arch=arm64 \ + --verbose \ + --components=main,universe \ + --include=fakeroot,symlinks,build-essential,libx11-dev,libxext-dev,libxrender-dev,libxrandr-dev,libxtst-dev,libxt-dev,libcups2-dev,libfontconfig1-dev,libasound2-dev,libfreetype6-dev,libpng-dev,libffi-dev \ + --resolve-deps \ + jammy \ + ~/sysroot-arm64 \ + http://ports.ubuntu.com/ubuntu-ports/ + # symlinks is in the universe repository + ``` + * Make sure the symlinks inside the newly created chroot point to proper locations: ```