From 298da5590207970d642ffc314c2bfd5917a34912 Mon Sep 17 00:00:00 2001 From: Saravanan D Date: Wed, 21 Jan 2026 00:35:03 +0000 Subject: [PATCH] scripts: fix build_edk2 compilation build_edk2() module in scripts/common-aarch64.sh does not produce the UEFI firmware for aarch64 as the commits used to assemble sources for acpica, edk2-platforms and edk2 do not compile after GCC version upgraded from 11.4.0 to 13.3.0 in the developer container (ubuntu 22.04 to 24.04) Apply minimum upgrade to EDK2_REPO and ACPICA_REPO required to compile with GCC 13.3.0 while still assuring guest VM boot for all integration tests BaseTools: Brotli compression submodule that was previously failing has been fixed following commit bump Developers can now produce UEFI firmware for aarch64 using the following commands ``` ./scripts/dev_cli.sh shell source scripts/test-util.sh source scripts/common-aarch64.sh build_edk2 ``` Update docs/uefi.md Fixes #7608 Signed-off-by: Saravanan D --- docs/uefi.md | 43 +++++++++++++++++++++++++++++++-------- scripts/common-aarch64.sh | 4 ++-- 2 files changed, 37 insertions(+), 10 deletions(-) diff --git a/docs/uefi.md b/docs/uefi.md index a93fb929c..cabbdf256 100644 --- a/docs/uefi.md +++ b/docs/uefi.md @@ -35,13 +35,31 @@ After the successful build, the resulting firmware binaries are available under # On an AArch64 machine: $ sudo apt-get update $ sudo apt-get install uuid-dev nasm iasl build-essential python3-distutils git -$ git clone --depth 1 https://github.com/tianocore/edk2.git -b master -$ cd edk2 -$ git submodule update --init -$ cd .. -$ git clone --depth 1 https://github.com/tianocore/edk2-platforms.git -b master -$ git clone --depth 1 https://github.com/acpica/acpica.git -b master - +# Master branches for these repos can be unstable, and newer GCC versions +# enforce strict warning-as-error policies that break builds +# These specific commit # are verified to compile cleanly with GCC 13.3.0 +# Shallow clone edk2 repo +$ mkdir -p edk2 && cd edk2 && \ +git init -q && \ +git remote add origin https://github.com/tianocore/edk2.git && \ +git fetch -q --depth 1 origin 22130dcd98b4d4b76ac8d922adb4a2dbc86fa52c && \ +git checkout -q FETCH_HEAD && \ +git submodule update --init --recursive --depth 1 && \ +cd .. +# Shallow clone edk2-platforms repo +$ mkdir -p edk2-platforms && cd edk2-platforms && \ +git init -q && \ +git remote add origin https://github.com/tianocore/edk2-platforms.git && \ +git fetch -q --depth 1 origin 8227e9e9f6a8aefbd772b40138f835121ccb2307 && \ +git checkout -q FETCH_HEAD && \ +cd .. +# Shallow clone acpica repo +$ mkdir -p acpica && cd acpica && \ +git init -q && \ +git remote add origin https://github.com/acpica/acpica.git && \ +git fetch -q --depth 1 origin e80cbd7b52de20aa8c75bfba9845e9cb61f2e681 && \ +git checkout -q FETCH_HEAD && \ +cd .. # Build tools $ export PACKAGES_PATH="$PWD/edk2:$PWD/edk2-platforms" $ export IASL_PREFIX="$PWD/acpica/generate/unix/bin/" @@ -53,10 +71,19 @@ $ make -C edk2/BaseTools # Build EDK2 $ build -a AARCH64 -t GCC5 -p ArmVirtPkg/ArmVirtCloudHv.dsc -b RELEASE + +# Alternate method +# Launch developer container from AArch64 machine +$ ./scripts/dev_cli.sh shell +# Inside the container +$ source scripts/test-util.sh +$ source scripts/common-aarch64.sh +$ build_edk2 ``` If the build goes well, the EDK2 binary is available at -`edk2/Build/ArmVirtCloudHv-AARCH64/RELEASE_GCC5/FV/CLOUDHV_EFI.fd`. +`edk2/Build/ArmVirtCloudHv-AARCH64/RELEASE_GCC5/FV/CLOUDHV_EFI.fd` or `workloads/CLOUDHV_EFI.fd` +when using developer container to produce firmware. ## Using OVMF Binaries diff --git a/scripts/common-aarch64.sh b/scripts/common-aarch64.sh index b44770efe..ae7f63292 100644 --- a/scripts/common-aarch64.sh +++ b/scripts/common-aarch64.sh @@ -21,12 +21,12 @@ build_edk2() { fi # Prepare source code - checkout_repo "$EDK2_DIR" "$EDK2_REPO" master "46b4606ba23498d3d0e66b53e498eb3d5d592586" + checkout_repo "$EDK2_DIR" "$EDK2_REPO" master "22130dcd98b4d4b76ac8d922adb4a2dbc86fa52c" pushd "$EDK2_DIR" || exit git submodule update --init popd || exit checkout_repo "$EDK2_PLAT_DIR" "$EDK2_PLAT_REPO" master "8227e9e9f6a8aefbd772b40138f835121ccb2307" - checkout_repo "$ACPICA_DIR" "$ACPICA_REPO" master "b9c69f81a05c45611c91ea9cbce8756078d76233" + checkout_repo "$ACPICA_DIR" "$ACPICA_REPO" master "e80cbd7b52de20aa8c75bfba9845e9cb61f2e681" if [[ ! -f "$EDK2_DIR/.built" || ! -f "$EDK2_PLAT_DIR/.built" ||