diff --git a/meta-arm/recipes-bsp/uefi/edk2-firmware_202411.bb b/meta-arm/recipes-bsp/uefi/edk2-firmware_202411.bb index 5892a485..22e72434 100644 --- a/meta-arm/recipes-bsp/uefi/edk2-firmware_202411.bb +++ b/meta-arm/recipes-bsp/uefi/edk2-firmware_202411.bb @@ -5,3 +5,7 @@ SRCREV_edk2-platforms ?= "2d66a9e048285af8ba4bfe4bdaab37a8e98288b3" TOOLCHAIN:aarch64 = "gcc" require recipes-bsp/uefi/edk2-firmware.inc + +SRC_URI += "\ + file://edk2_fix_epoch.patch \ +" diff --git a/meta-arm/recipes-bsp/uefi/files/edk2_fix_epoch.patch b/meta-arm/recipes-bsp/uefi/files/edk2_fix_epoch.patch new file mode 100644 index 00000000..d128df46 --- /dev/null +++ b/meta-arm/recipes-bsp/uefi/files/edk2_fix_epoch.patch @@ -0,0 +1,33 @@ +From ef9dfeb6e96bf7f71162691a78d6b82c9516c0c0 Mon Sep 17 00:00:00 2001 +From: Mikko Rapeli +Date: Tue, 1 Apr 2025 10:34:31 -0400 +Subject: [PATCH] edk2-firmware: fix SOURCE_DATE_EPOCH use + +printenv host tool is not exposed to recipes so +just set epoch using SOURCE_DATE_EPOCH which is always +set. Fixes compile error: + +Building ... ../build/tmp_zynqmp-kria-starter-psa/work/zynqmp_kria_starter_psa-poky-linux/edk2-firmware/202411/edk2/MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf [AARCH64] +../build/tmp_zynqmp-kria-starter-psa/work/zynqmp_kria_starter_psa-poky-linux/edk2-firmware/202411/edk2/EmbeddedPkg/Library/VirtualRealTimeClockLib/VirtualRealTimeClockLib.c: In function 'LibGetTime': +: error: stray '`' in program +../build/tmp_zynqmp-kria-starter-psa/work/zynqmp_kria_starter_psa-poky-linux/edk2-firmware/202411/edk2/EmbeddedPkg/Library/VirtualRealTimeClockLib/VirtualRealTimeClockLib.c:89:20: note: in expansion of macro 'BUILD_EPOCH' + 89 | EpochSeconds = BUILD_EPOCH; + | ^~~~~~~~~~~ + +Signed-off-by: Mikko Rapeli + +Upstream-Status: Inappropriate [OE specific build config fix, though filed as https://github.com/tianocore/edk2/issues/10910] +--- + .../Library/VirtualRealTimeClockLib/VirtualRealTimeClockLib.inf | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/EmbeddedPkg/Library/VirtualRealTimeClockLib/VirtualRealTimeClockLib.inf b/EmbeddedPkg/Library/VirtualRealTimeClockLib/VirtualRealTimeClockLib.inf +index 285e880daab8..e1c986a6532d 100644 +--- a/EmbeddedPkg/Library/VirtualRealTimeClockLib/VirtualRealTimeClockLib.inf ++++ b/EmbeddedPkg/Library/VirtualRealTimeClockLib/VirtualRealTimeClockLib.inf +@@ -34,4 +34,4 @@ + + # Current usage of this library expects GCC in a UNIX-like shell environment with the date command + [BuildOptions] +- GCC:*_*_*_CC_FLAGS = -DBUILD_EPOCH=`printenv SOURCE_DATE_EPOCH || date +%s` ++ GCC:*_*_*_CC_FLAGS = -DBUILD_EPOCH=${SOURCE_DATE_EPOCH}