Append the UEFI recipe. Patch was necessary for brotli, taken from [1]
[1] https://github.com/google/brotli/commit/0a3944c8c99b8d10cc4325f721b7c273d2b4...
Signed-off-by: Pawel Zalewski pzalewski@thegoodpenguin.co.uk Reviewed-by: Andrew Murray amurray@thegoodpenguin.co.uk --- recipes-bsp/uefi/edk2-firmware_%.bbappend | 48 +++++++++++++++++++ ...Basetools-remove-brotli-build-errors.patch | 45 +++++++++++++++++ 2 files changed, 93 insertions(+) create mode 100644 recipes-bsp/uefi/edk2-firmware_%.bbappend create mode 100644 recipes-bsp/uefi/files/0001-Basetools-remove-brotli-build-errors.patch
diff --git a/recipes-bsp/uefi/edk2-firmware_%.bbappend b/recipes-bsp/uefi/edk2-firmware_%.bbappend new file mode 100644 index 0000000..146c962 --- /dev/null +++ b/recipes-bsp/uefi/edk2-firmware_%.bbappend @@ -0,0 +1,48 @@ +inherit python3native llvm-morello-native + +COMPATIBLE_MACHINE = "morello" +SUMMARY = "EDK2 to be compiled with LLVM Morello" +OUTPUTS_NAME = "uefi" +SECTION = "firmware" + +PROVIDES += "virtual/${OUTPUTS_NAME}" +DEPENDS += "acpica-native python3-native" + +FILESEXTRAPATHS:prepend := "${THISDIR}:" + +SRC_URI = "\ + ${EDK2_SRC_URI};name=edk2;destsuffix=edk2 \ + ${EDK2_PLATFORMS_SRC_URI};name=edk2-platforms;destsuffix=edk2/edk2-platforms \ + ${EDK2_NON_OSI_SRC_URI};name=edk2-non-osi;destsuffix=edk2-non-osi \ + file://files/0001-Basetools-remove-brotli-build-errors.patch \ + " + +EDK2_SRC_URI = "gitsm://git.morello-project.org/morello/edk2;branch=morello/master;protocol=https" +EDK2_PLATFORMS_SRC_URI = "gitsm://git.morello-project.org/morello/edk2-platforms;branch=morello/master;protocol=https" +EDK2_NON_OSI_SRC_URI = "git://github.com/tianocore/edk2-non-osi;branch=master;protocol=https" +SRCREV_edk2-non-osi = "0320db977fb27e63424b0953a3020bb81c89e8f0" +SRCREV_edk2 = "ce510c33dfc354e262ccd71619add069876d6a08" +SRCREV_edk2-platforms = "6bae2381d664e668875720e7eb86f751cb1de373" +PV = "git${SRCPV}" + +EDK2_BUILD_RELEASE = "0" +EDK2_PLATFORM = "morellosoc" +EDK2_PLATFORM_DSC = "edk2-platforms/Platform/ARM/Morello/MorelloPlatformSoc.dsc" +EDK2_BIN_NAME = "BL33_AP_UEFI.fd" +EDK2_ARCH = "AARCH64" +EDK2_BUILD_FLAGS += "-D ENABLE_MORELLO_CAP=1" +EDK_COMPILER = "CLANG35" + +export CLANG35_AARCH64_PREFIX = "${TARGET_PREFIX}" +export CLANG35_BIN = "${LLVM_PATH}/" +export CLANG35_AARCH64_PREFIX = "${LLVM_PATH}/llvm-" +export PACKAGES_PATH = "${S}:${S}/edk2-platforms:${WORKDIR}/edk2-non-osi" +export CC_PATH = "${LLVM_PATH}/clang" +export LLVM_PATH_35 = "${LLVM_PATH}" + +do_deploy[noexec] = "1" + +do_install() { + install -d ${D}/firmware + install ${B}/Build/${EDK2_PLATFORM}/${EDK2_BUILD_MODE}_${EDK_COMPILER}/FV/${EDK2_BIN_NAME} ${D}/firmware/uefi.bin +} \ No newline at end of file diff --git a/recipes-bsp/uefi/files/0001-Basetools-remove-brotli-build-errors.patch b/recipes-bsp/uefi/files/0001-Basetools-remove-brotli-build-errors.patch new file mode 100644 index 0000000..53d16ad --- /dev/null +++ b/recipes-bsp/uefi/files/0001-Basetools-remove-brotli-build-errors.patch @@ -0,0 +1,45 @@ +From 27dd7265403d8e8fed99a854b9c3e1db7d79525f Mon Sep 17 00:00:00 2001 +From: Jeremy Maitin-Shepard jbms@google.com +Date: Tue, 14 Sep 2021 12:27:45 -0700 +Subject: [PATCH 09/22] Fix -Werror=vla-parameter errors with GCC 11.2.0 + +--- + BaseTools/Source/C/BrotliCompress/brotli/c/dec/decode.c | 6 ++++-- + BaseTools/Source/C/BrotliCompress/brotli/c/enc/encode.c | 5 +++-- + 2 files changed, 7 insertions(+), 4 deletions(-) + +diff --git a/BaseTools/Source/C/BrotliCompress/brotli/c/dec/decode.c b/c/dec/decode.c +index 114c505..4c89a73 100644 +--- a/BaseTools/Source/C/BrotliCompress/brotli/c/dec/decode.c ++++ b/BaseTools/Source/C/BrotliCompress/brotli/c/dec/decode.c +@@ -2030,8 +2030,10 @@ static BROTLI_NOINLINE BrotliDecoderErrorCode SafeProcessCommands( + } + + BrotliDecoderResult BrotliDecoderDecompress( +- size_t encoded_size, const uint8_t* encoded_buffer, size_t* decoded_size, +- uint8_t* decoded_buffer) { ++ size_t encoded_size, ++ const uint8_t encoded_buffer[BROTLI_ARRAY_PARAM(encoded_size)], ++ size_t* decoded_size, ++ uint8_t decoded_buffer[BROTLI_ARRAY_PARAM(*decoded_size)]) { + BrotliDecoderState s; + BrotliDecoderResult result; + size_t total_out = 0; +diff --git a/BaseTools/Source/C/BrotliCompress/brotli/c/enc/encode.c b/c/enc/encode.c +index 68548ef..dc3704e 100644 +--- a/BaseTools/Source/C/BrotliCompress/brotli/c/enc/encode.c ++++ b/BaseTools/Source/C/BrotliCompress/brotli/c/enc/encode.c +@@ -1470,8 +1470,9 @@ static size_t MakeUncompressedStream( + + BROTLI_BOOL BrotliEncoderCompress( + int quality, int lgwin, BrotliEncoderMode mode, size_t input_size, +- const uint8_t* input_buffer, size_t* encoded_size, +- uint8_t* encoded_buffer) { ++ const uint8_t input_buffer[BROTLI_ARRAY_PARAM(input_size)], ++ size_t* encoded_size, ++ uint8_t encoded_buffer[BROTLI_ARRAY_PARAM(*encoded_size)]) { + BrotliEncoderState* s; + size_t out_size = *encoded_size; + const uint8_t* input_start = input_buffer; +-- +2.34.1 \ No newline at end of file