summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kanavin <alex.kanavin@gmail.com>2021-06-15 10:12:17 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-06-17 00:07:05 +0100
commitf9cbd62bf34658312a20132e8f081068ecb6d836 (patch)
treedff399995ec7976f4b4782b2713d2964bbbfbe02
parentb324d19336ad65b4a34da869c05dcb5711f1edc9 (diff)
downloadpoky-f9cbd62bf34658312a20132e8f081068ecb6d836.tar.gz
ovmf: update 2021.02 -> 2021.05
Reformat patches using git, so that rebasing them to newer versions is easier. (From OE-Core rev: 796f5a422a1bb9059ca8045b5aa199aa02b0e46a) Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-core/ovmf/ovmf/0001-ovmf-update-path-to-native-BaseTools.patch7
-rw-r--r--meta/recipes-core/ovmf/ovmf/0002-BaseTools-makefile-adjust-to-build-in-under-bitbake.patch11
-rw-r--r--meta/recipes-core/ovmf/ovmf/0003-ovmf-Update-to-latest.patch (renamed from meta/recipes-core/ovmf/ovmf/0004-ovmf-Update-to-latest.patch)13
-rw-r--r--meta/recipes-core/ovmf/ovmf/0004-Strip-build-paths.patch32
-rw-r--r--meta/recipes-core/ovmf/ovmf/0005-debug-prefix-map.patch (renamed from meta/recipes-core/ovmf/ovmf/debug_prefix_map.patch)43
-rw-r--r--meta/recipes-core/ovmf/ovmf/0006-reproducible.patch (renamed from meta/recipes-core/ovmf/ovmf/reproducible.patch)153
-rw-r--r--meta/recipes-core/ovmf/ovmf/zero.patch84
-rw-r--r--meta/recipes-core/ovmf/ovmf_git.bb12
8 files changed, 163 insertions, 192 deletions
diff --git a/meta/recipes-core/ovmf/ovmf/0001-ovmf-update-path-to-native-BaseTools.patch b/meta/recipes-core/ovmf/ovmf/0001-ovmf-update-path-to-native-BaseTools.patch
index c32963a807..89d9ffab5e 100644
--- a/meta/recipes-core/ovmf/ovmf/0001-ovmf-update-path-to-native-BaseTools.patch
+++ b/meta/recipes-core/ovmf/ovmf/0001-ovmf-update-path-to-native-BaseTools.patch
@@ -1,7 +1,7 @@
1From 200ff35c6545b4ab85f5ea7a6096fbaec3d82f6d Mon Sep 17 00:00:00 2001 1From 1125f5a02c2f327aeffe2d6b66a9d816ad2eeec0 Mon Sep 17 00:00:00 2001
2From: Ricardo Neri <ricardo.neri-calderon@linux.intel.com> 2From: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
3Date: Thu, 9 Jun 2016 02:23:01 -0700 3Date: Thu, 9 Jun 2016 02:23:01 -0700
4Subject: [PATCH 1/4] ovmf: update path to native BaseTools 4Subject: [PATCH 1/6] ovmf: update path to native BaseTools
5 5
6BaseTools is a set of utilities to build EDK-based firmware. These utilities 6BaseTools is a set of utilities to build EDK-based firmware. These utilities
7are used during the build process. Thus, they need to be built natively. 7are used during the build process. Thus, they need to be built natively.
@@ -11,7 +11,6 @@ with the appropriate location before building.
11 11
12Signed-off-by: Ricardo Neri <ricardo.neri-calderon@linux.intel.com> 12Signed-off-by: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
13Upstream-Status: Pending 13Upstream-Status: Pending
14
15--- 14---
16 OvmfPkg/build.sh | 2 +- 15 OvmfPkg/build.sh | 2 +-
17 1 file changed, 1 insertion(+), 1 deletion(-) 16 1 file changed, 1 insertion(+), 1 deletion(-)
@@ -30,5 +29,5 @@ index 91b1442ade..1858dae31a 100755
30 source edksetup.sh BaseTools 29 source edksetup.sh BaseTools
31 else 30 else
32-- 31--
332.28.0 322.32.0
34 33
diff --git a/meta/recipes-core/ovmf/ovmf/0002-BaseTools-makefile-adjust-to-build-in-under-bitbake.patch b/meta/recipes-core/ovmf/ovmf/0002-BaseTools-makefile-adjust-to-build-in-under-bitbake.patch
index c61a08f022..f6141c8af5 100644
--- a/meta/recipes-core/ovmf/ovmf/0002-BaseTools-makefile-adjust-to-build-in-under-bitbake.patch
+++ b/meta/recipes-core/ovmf/ovmf/0002-BaseTools-makefile-adjust-to-build-in-under-bitbake.patch
@@ -1,23 +1,22 @@
1From 667c0cf97dadc4f5994d26ec3984f559a05ec406 Mon Sep 17 00:00:00 2001 1From 19d4c7f9812062a683b3ba60b35aac0461190456 Mon Sep 17 00:00:00 2001
2From: Ricardo Neri <ricardo.neri-calderon@linux.intel.com> 2From: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
3Date: Fri, 26 Jul 2019 17:34:26 -0400 3Date: Fri, 26 Jul 2019 17:34:26 -0400
4Subject: [PATCH 2/4] BaseTools: makefile: adjust to build in under bitbake 4Subject: [PATCH 2/6] BaseTools: makefile: adjust to build in under bitbake
5 5
6Prepend the build flags with those of bitbake. This is to build 6Prepend the build flags with those of bitbake. This is to build
7using the bitbake native sysroot include and library directories. 7using the bitbake native sysroot include and library directories.
8 8
9Signed-off-by: Ricardo Neri <ricardo.neri@linux.intel.com> 9Signed-off-by: Ricardo Neri <ricardo.neri@linux.intel.com>
10Upstream-Status: Pending 10Upstream-Status: Pending
11
12--- 11---
13 BaseTools/Source/C/Makefiles/header.makefile | 17 +++++++++-------- 12 BaseTools/Source/C/Makefiles/header.makefile | 17 +++++++++--------
14 1 file changed, 9 insertions(+), 8 deletions(-) 13 1 file changed, 9 insertions(+), 8 deletions(-)
15 14
16diff --git a/BaseTools/Source/C/Makefiles/header.makefile b/BaseTools/Source/C/Makefiles/header.makefile 15diff --git a/BaseTools/Source/C/Makefiles/header.makefile b/BaseTools/Source/C/Makefiles/header.makefile
17index 1c105ee7d4..d5eea3864e 100644 16index 0df728f327..1299d47c87 100644
18--- a/BaseTools/Source/C/Makefiles/header.makefile 17--- a/BaseTools/Source/C/Makefiles/header.makefile
19+++ b/BaseTools/Source/C/Makefiles/header.makefile 18+++ b/BaseTools/Source/C/Makefiles/header.makefile
20@@ -69,35 +69,36 @@ $(error Bad HOST_ARCH) 19@@ -75,35 +75,36 @@ $(error Bad HOST_ARCH)
21 endif 20 endif
22 21
23 INCLUDE = $(TOOL_INCLUDE) -I $(MAKEROOT) -I $(MAKEROOT)/Include/Common -I $(MAKEROOT)/Include/ -I $(MAKEROOT)/Include/IndustryStandard -I $(MAKEROOT)/Common/ -I .. -I . $(ARCH_INCLUDE) 22 INCLUDE = $(TOOL_INCLUDE) -I $(MAKEROOT) -I $(MAKEROOT)/Include/Common -I $(MAKEROOT)/Include/ -I $(MAKEROOT)/Include/IndustryStandard -I $(MAKEROOT)/Common/ -I .. -I . $(ARCH_INCLUDE)
@@ -63,5 +62,5 @@ index 1c105ee7d4..d5eea3864e 100644
63 # 62 #
64 # Snow Leopard is a 32-bit and 64-bit environment. uname -m returns i386, but gcc defaults 63 # Snow Leopard is a 32-bit and 64-bit environment. uname -m returns i386, but gcc defaults
65-- 64--
662.28.0 652.32.0
67 66
diff --git a/meta/recipes-core/ovmf/ovmf/0004-ovmf-Update-to-latest.patch b/meta/recipes-core/ovmf/ovmf/0003-ovmf-Update-to-latest.patch
index 128438b201..d710429899 100644
--- a/meta/recipes-core/ovmf/ovmf/0004-ovmf-Update-to-latest.patch
+++ b/meta/recipes-core/ovmf/ovmf/0003-ovmf-Update-to-latest.patch
@@ -1,7 +1,7 @@
1From ad06fcf1e08736e79221cd6863ff2e3c9254f261 Mon Sep 17 00:00:00 2001 1From 67267d8cc31df16a3608cad1a17c5f1470ef8bbd Mon Sep 17 00:00:00 2001
2From: Steve Langasek <steve.langasek@ubuntu.com> 2From: Steve Langasek <steve.langasek@ubuntu.com>
3Date: Sat, 10 Jun 2017 01:39:36 -0700 3Date: Sat, 10 Jun 2017 01:39:36 -0700
4Subject: [PATCH 4/4] ovmf: Update to latest 4Subject: [PATCH 3/6] ovmf: Update to latest
5 5
6Description: pass -fno-stack-protector to all GCC toolchains 6Description: pass -fno-stack-protector to all GCC toolchains
7 The upstream build rules inexplicably pass -fno-stack-protector only 7 The upstream build rules inexplicably pass -fno-stack-protector only
@@ -9,16 +9,15 @@ Description: pass -fno-stack-protector to all GCC toolchains
9 generic rules for gcc 4.4 and later. 9 generic rules for gcc 4.4 and later.
10Last-Updated: 2016-04-12 10Last-Updated: 2016-04-12
11Upstream-Status: Pending 11Upstream-Status: Pending
12
13--- 12---
14 BaseTools/Conf/tools_def.template | 8 ++++---- 13 BaseTools/Conf/tools_def.template | 8 ++++----
15 1 file changed, 4 insertions(+), 4 deletions(-) 14 1 file changed, 4 insertions(+), 4 deletions(-)
16 15
17diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template 16diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template
18index 933b3160fd..c2fbbf0c38 100755 17index 498696e583..36241b6ede 100755
19--- a/BaseTools/Conf/tools_def.template 18--- a/BaseTools/Conf/tools_def.template
20+++ b/BaseTools/Conf/tools_def.template 19+++ b/BaseTools/Conf/tools_def.template
21@@ -1952,10 +1952,10 @@ DEFINE GCC_RISCV64_RC_FLAGS = -I binary -O elf64-littleriscv -B riscv 20@@ -1897,10 +1897,10 @@ DEFINE GCC_RISCV64_RC_FLAGS = -I binary -O elf64-littleriscv -B riscv
22 # GCC Build Flag for included header file list generation 21 # GCC Build Flag for included header file list generation
23 DEFINE GCC_DEPS_FLAGS = -MMD -MF $@.deps 22 DEFINE GCC_DEPS_FLAGS = -MMD -MF $@.deps
24 23
@@ -32,7 +31,7 @@ index 933b3160fd..c2fbbf0c38 100755
32 DEFINE GCC48_IA32_X64_ASLDLINK_FLAGS = DEF(GCC48_IA32_X64_DLINK_COMMON) -Wl,--entry,ReferenceAcpiTable -u ReferenceAcpiTable 31 DEFINE GCC48_IA32_X64_ASLDLINK_FLAGS = DEF(GCC48_IA32_X64_DLINK_COMMON) -Wl,--entry,ReferenceAcpiTable -u ReferenceAcpiTable
33 DEFINE GCC48_IA32_X64_DLINK_FLAGS = DEF(GCC48_IA32_X64_DLINK_COMMON) -Wl,--entry,$(IMAGE_ENTRY_POINT) -u $(IMAGE_ENTRY_POINT) -Wl,-Map,$(DEST_DIR_DEBUG)/$(BASE_NAME).map,--whole-archive 32 DEFINE GCC48_IA32_X64_DLINK_FLAGS = DEF(GCC48_IA32_X64_DLINK_COMMON) -Wl,--entry,$(IMAGE_ENTRY_POINT) -u $(IMAGE_ENTRY_POINT) -Wl,-Map,$(DEST_DIR_DEBUG)/$(BASE_NAME).map,--whole-archive
34 DEFINE GCC48_IA32_DLINK2_FLAGS = -Wl,--defsym=PECOFF_HEADER_SIZE=0x220 DEF(GCC_DLINK2_FLAGS_COMMON) 33 DEFINE GCC48_IA32_DLINK2_FLAGS = -Wl,--defsym=PECOFF_HEADER_SIZE=0x220 DEF(GCC_DLINK2_FLAGS_COMMON)
35@@ -1964,7 +1964,7 @@ DEFINE GCC48_X64_DLINK2_FLAGS = -Wl,--defsym=PECOFF_HEADER_SIZE=0x228 DEF 34@@ -1909,7 +1909,7 @@ DEFINE GCC48_X64_DLINK2_FLAGS = -Wl,--defsym=PECOFF_HEADER_SIZE=0x228 DEF
36 DEFINE GCC48_ASM_FLAGS = DEF(GCC_ASM_FLAGS) 35 DEFINE GCC48_ASM_FLAGS = DEF(GCC_ASM_FLAGS)
37 DEFINE GCC48_ARM_ASM_FLAGS = $(ARCHASM_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_ASM_FLAGS) -mlittle-endian 36 DEFINE GCC48_ARM_ASM_FLAGS = $(ARCHASM_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_ASM_FLAGS) -mlittle-endian
38 DEFINE GCC48_AARCH64_ASM_FLAGS = $(ARCHASM_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_ASM_FLAGS) -mlittle-endian 37 DEFINE GCC48_AARCH64_ASM_FLAGS = $(ARCHASM_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_ASM_FLAGS) -mlittle-endian
@@ -42,5 +41,5 @@ index 933b3160fd..c2fbbf0c38 100755
42 DEFINE GCC48_AARCH64_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -mcmodel=large DEF(GCC_AARCH64_CC_FLAGS) 41 DEFINE GCC48_AARCH64_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -mcmodel=large DEF(GCC_AARCH64_CC_FLAGS)
43 DEFINE GCC48_AARCH64_CC_XIPFLAGS = DEF(GCC_AARCH64_CC_XIPFLAGS) 42 DEFINE GCC48_AARCH64_CC_XIPFLAGS = DEF(GCC_AARCH64_CC_XIPFLAGS)
44-- 43--
452.28.0 442.32.0
46 45
diff --git a/meta/recipes-core/ovmf/ovmf/0004-Strip-build-paths.patch b/meta/recipes-core/ovmf/ovmf/0004-Strip-build-paths.patch
new file mode 100644
index 0000000000..dfb8a73398
--- /dev/null
+++ b/meta/recipes-core/ovmf/ovmf/0004-Strip-build-paths.patch
@@ -0,0 +1,32 @@
1From b7cfe97895e0586d14403ba98e62a0cd9373da96 Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Mon, 14 Jun 2021 19:55:08 +0200
4Subject: [PATCH 4/6] Strip build paths
5
6Pass --zero to GenFw in release builds so that the sections that link back to
7the intermediate binaries (containing build paths) are removed.
8
9Upstream-Status: Pending (discussion at https://bugzilla.tianocore.org/show_bug.cgi?id=3256)
10Signed-off-by: Ross Burton <ross.burton@arm.com>
11
12Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
13---
14 OvmfPkg/OvmfPkgIa32.dsc | 2 ++
15 1 file changed, 2 insertions(+)
16
17diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc
18index 33fbd76790..06c6d5ce60 100644
19--- a/OvmfPkg/OvmfPkgIa32.dsc
20+++ b/OvmfPkg/OvmfPkgIa32.dsc
21@@ -91,6 +91,8 @@
22
23 !include NetworkPkg/NetworkBuildOptions.dsc.inc
24
25+ RELEASE_*_*_GENFW_FLAGS = --zero
26+
27 [BuildOptions.common.EDKII.DXE_RUNTIME_DRIVER]
28 GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000
29 XCODE:*_*_*_DLINK_FLAGS = -seg1addr 0x1000 -segalign 0x1000
30--
312.32.0
32
diff --git a/meta/recipes-core/ovmf/ovmf/debug_prefix_map.patch b/meta/recipes-core/ovmf/ovmf/0005-debug-prefix-map.patch
index 0165fae7ce..e467d6f152 100644
--- a/meta/recipes-core/ovmf/ovmf/debug_prefix_map.patch
+++ b/meta/recipes-core/ovmf/ovmf/0005-debug-prefix-map.patch
@@ -1,23 +1,31 @@
1From 860bb1979f3578bb83257076fe0f3bd33f9d68bf Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Mon, 14 Jun 2021 19:56:28 +0200
4Subject: [PATCH 5/6] debug prefix map
5
1We want to pass ${DEBUG_PREFIX_MAP} to gcc commands and also pass in 6We want to pass ${DEBUG_PREFIX_MAP} to gcc commands and also pass in
2 --debug-prefix-map to nasm (we carry a patch to nasm for this). The 7 --debug-prefix-map to nasm (we carry a patch to nasm for this). The
3tools definitions file is built by ovmf-native so we need to pass this in 8tools definitions file is built by ovmf-native so we need to pass this in
4at target build time when we know the right values so we use the environment. 9at target build time when we know the right values so we use the environment.
5 10
6By using determininistc file paths during the ovmf build, it removes the 11By using determininistc file paths during the ovmf build, it removes the
7opportunitity for gcc/ld to change the output binaries due to path lengths 12opportunitity for gcc/ld to change the output binaries due to path lengths
8overflowing section sizes and causing small changes in the binary output. 13overflowing section sizes and causing small changes in the binary output.
9Previously we relied on the stripped output being the same which isn't always 14Previously we relied on the stripped output being the same which isn't always
10the case if the size of the debug symbols varies. 15the case if the size of the debug symbols varies.
11 16
12Upstream-Status: Pending [gcc parts may be upstreamable, nasm patch isn't upstream yet] 17Upstream-Status: Pending [gcc parts may be upstreamable, nasm patch isn't upstream yet]
13Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> 18Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
19Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
20---
21 BaseTools/Conf/tools_def.template | 18 +++++++++---------
22 1 file changed, 9 insertions(+), 9 deletions(-)
14 23
15 24diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template
16Index: git/BaseTools/Conf/tools_def.template 25index 36241b6ede..947fbf2e8d 100755
17=================================================================== 26--- a/BaseTools/Conf/tools_def.template
18--- git.orig/BaseTools/Conf/tools_def.template 27+++ b/BaseTools/Conf/tools_def.template
19+++ git/BaseTools/Conf/tools_def.template 28@@ -1863,7 +1863,7 @@ NOOPT_*_*_OBJCOPY_ADDDEBUGFLAG = --add-gnu-debuglink=$(DEBUG_DIR)/$(MODULE_N
20@@ -1918,7 +1918,7 @@ NOOPT_*_*_OBJCOPY_ADDDEBUGFLAG = --a
21 *_*_*_DTCPP_PATH = DEF(DTCPP_BIN) 29 *_*_*_DTCPP_PATH = DEF(DTCPP_BIN)
22 *_*_*_DTC_PATH = DEF(DTC_BIN) 30 *_*_*_DTC_PATH = DEF(DTC_BIN)
23 31
@@ -26,7 +34,7 @@ Index: git/BaseTools/Conf/tools_def.template
26 DEFINE GCC_IA32_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -m32 -malign-double -freorder-blocks -freorder-blocks-and-partition -O2 -mno-stack-arg-probe 34 DEFINE GCC_IA32_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -m32 -malign-double -freorder-blocks -freorder-blocks-and-partition -O2 -mno-stack-arg-probe
27 DEFINE GCC_X64_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -mno-red-zone -Wno-address -mno-stack-arg-probe 35 DEFINE GCC_X64_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -mno-red-zone -Wno-address -mno-stack-arg-probe
28 DEFINE GCC_ARM_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -mlittle-endian -mabi=aapcs -fno-short-enums -funsigned-char -ffunction-sections -fdata-sections -fomit-frame-pointer -Wno-address -mthumb -mfloat-abi=soft -fno-pic -fno-pie 36 DEFINE GCC_ARM_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -mlittle-endian -mabi=aapcs -fno-short-enums -funsigned-char -ffunction-sections -fdata-sections -fomit-frame-pointer -Wno-address -mthumb -mfloat-abi=soft -fno-pic -fno-pie
29@@ -1936,8 +1936,8 @@ DEFINE GCC_IA32_X64_ASLDLINK_FLAGS = -fu 37@@ -1881,8 +1881,8 @@ DEFINE GCC_IA32_X64_ASLDLINK_FLAGS = DEF(GCC_IA32_X64_DLINK_COMMON) --entry _Ref
30 DEFINE GCC_ARM_ASLDLINK_FLAGS = DEF(GCC_ARM_DLINK_FLAGS) -Wl,--entry,ReferenceAcpiTable -u $(IMAGE_ENTRY_POINT) DEF(GCC_ARM_AARCH64_ASLDLINK_FLAGS) 38 DEFINE GCC_ARM_ASLDLINK_FLAGS = DEF(GCC_ARM_DLINK_FLAGS) -Wl,--entry,ReferenceAcpiTable -u $(IMAGE_ENTRY_POINT) DEF(GCC_ARM_AARCH64_ASLDLINK_FLAGS)
31 DEFINE GCC_AARCH64_ASLDLINK_FLAGS = DEF(GCC_AARCH64_DLINK_FLAGS) -Wl,--entry,ReferenceAcpiTable -u $(IMAGE_ENTRY_POINT) DEF(GCC_ARM_AARCH64_ASLDLINK_FLAGS) 39 DEFINE GCC_AARCH64_ASLDLINK_FLAGS = DEF(GCC_AARCH64_DLINK_FLAGS) -Wl,--entry,ReferenceAcpiTable -u $(IMAGE_ENTRY_POINT) DEF(GCC_ARM_AARCH64_ASLDLINK_FLAGS)
32 DEFINE GCC_IA32_X64_DLINK_FLAGS = DEF(GCC_IA32_X64_DLINK_COMMON) --entry _$(IMAGE_ENTRY_POINT) --file-alignment 0x20 --section-alignment 0x20 -Map $(DEST_DIR_DEBUG)/$(BASE_NAME).map 40 DEFINE GCC_IA32_X64_DLINK_FLAGS = DEF(GCC_IA32_X64_DLINK_COMMON) --entry _$(IMAGE_ENTRY_POINT) --file-alignment 0x20 --section-alignment 0x20 -Map $(DEST_DIR_DEBUG)/$(BASE_NAME).map
@@ -37,7 +45,7 @@ Index: git/BaseTools/Conf/tools_def.template
37 DEFINE GCC_VFRPP_FLAGS = -x c -E -P -DVFRCOMPILE --include $(MODULE_NAME)StrDefs.h 45 DEFINE GCC_VFRPP_FLAGS = -x c -E -P -DVFRCOMPILE --include $(MODULE_NAME)StrDefs.h
38 DEFINE GCC_ASLPP_FLAGS = -x c -E -include AutoGen.h 46 DEFINE GCC_ASLPP_FLAGS = -x c -E -include AutoGen.h
39 DEFINE GCC_ASLCC_FLAGS = -x c 47 DEFINE GCC_ASLCC_FLAGS = -x c
40@@ -2082,7 +2082,7 @@ DEFINE GCC_PP_FLAGS 48@@ -2027,7 +2027,7 @@ DEFINE GCC_PP_FLAGS = -E -x assembler-with-cpp -include A
41 *_GCC48_IA32_DLINK2_FLAGS = DEF(GCC48_IA32_DLINK2_FLAGS) 49 *_GCC48_IA32_DLINK2_FLAGS = DEF(GCC48_IA32_DLINK2_FLAGS)
42 *_GCC48_IA32_RC_FLAGS = DEF(GCC_IA32_RC_FLAGS) 50 *_GCC48_IA32_RC_FLAGS = DEF(GCC_IA32_RC_FLAGS)
43 *_GCC48_IA32_OBJCOPY_FLAGS = 51 *_GCC48_IA32_OBJCOPY_FLAGS =
@@ -46,7 +54,7 @@ Index: git/BaseTools/Conf/tools_def.template
46 54
47 DEBUG_GCC48_IA32_CC_FLAGS = DEF(GCC48_IA32_CC_FLAGS) -Os 55 DEBUG_GCC48_IA32_CC_FLAGS = DEF(GCC48_IA32_CC_FLAGS) -Os
48 RELEASE_GCC48_IA32_CC_FLAGS = DEF(GCC48_IA32_CC_FLAGS) -Os -Wno-unused-but-set-variable 56 RELEASE_GCC48_IA32_CC_FLAGS = DEF(GCC48_IA32_CC_FLAGS) -Os -Wno-unused-but-set-variable
49@@ -2110,7 +2110,7 @@ RELEASE_GCC48_IA32_CC_FLAGS = DEF( 57@@ -2055,7 +2055,7 @@ RELEASE_GCC48_IA32_CC_FLAGS = DEF(GCC48_IA32_CC_FLAGS) -Os -Wno-unused-but
50 *_GCC48_X64_DLINK2_FLAGS = DEF(GCC48_X64_DLINK2_FLAGS) 58 *_GCC48_X64_DLINK2_FLAGS = DEF(GCC48_X64_DLINK2_FLAGS)
51 *_GCC48_X64_RC_FLAGS = DEF(GCC_X64_RC_FLAGS) 59 *_GCC48_X64_RC_FLAGS = DEF(GCC_X64_RC_FLAGS)
52 *_GCC48_X64_OBJCOPY_FLAGS = 60 *_GCC48_X64_OBJCOPY_FLAGS =
@@ -55,7 +63,7 @@ Index: git/BaseTools/Conf/tools_def.template
55 63
56 DEBUG_GCC48_X64_CC_FLAGS = DEF(GCC48_X64_CC_FLAGS) -Os 64 DEBUG_GCC48_X64_CC_FLAGS = DEF(GCC48_X64_CC_FLAGS) -Os
57 RELEASE_GCC48_X64_CC_FLAGS = DEF(GCC48_X64_CC_FLAGS) -Os -Wno-unused-but-set-variable 65 RELEASE_GCC48_X64_CC_FLAGS = DEF(GCC48_X64_CC_FLAGS) -Os -Wno-unused-but-set-variable
58@@ -2222,7 +2222,7 @@ RELEASE_GCC48_AARCH64_CC_FLAGS = DEF(G 66@@ -2167,7 +2167,7 @@ RELEASE_GCC48_AARCH64_CC_FLAGS = DEF(GCC48_AARCH64_CC_FLAGS) -Wno-unused-but-s
59 *_GCC49_IA32_DLINK2_FLAGS = DEF(GCC49_IA32_DLINK2_FLAGS) 67 *_GCC49_IA32_DLINK2_FLAGS = DEF(GCC49_IA32_DLINK2_FLAGS)
60 *_GCC49_IA32_RC_FLAGS = DEF(GCC_IA32_RC_FLAGS) 68 *_GCC49_IA32_RC_FLAGS = DEF(GCC_IA32_RC_FLAGS)
61 *_GCC49_IA32_OBJCOPY_FLAGS = 69 *_GCC49_IA32_OBJCOPY_FLAGS =
@@ -64,7 +72,7 @@ Index: git/BaseTools/Conf/tools_def.template
64 72
65 DEBUG_GCC49_IA32_CC_FLAGS = DEF(GCC49_IA32_CC_FLAGS) -Os 73 DEBUG_GCC49_IA32_CC_FLAGS = DEF(GCC49_IA32_CC_FLAGS) -Os
66 RELEASE_GCC49_IA32_CC_FLAGS = DEF(GCC49_IA32_CC_FLAGS) -Os -Wno-unused-but-set-variable -Wno-unused-const-variable 74 RELEASE_GCC49_IA32_CC_FLAGS = DEF(GCC49_IA32_CC_FLAGS) -Os -Wno-unused-but-set-variable -Wno-unused-const-variable
67@@ -2250,7 +2250,7 @@ RELEASE_GCC49_IA32_CC_FLAGS = DEF( 75@@ -2195,7 +2195,7 @@ RELEASE_GCC49_IA32_CC_FLAGS = DEF(GCC49_IA32_CC_FLAGS) -Os -Wno-unused-but
68 *_GCC49_X64_DLINK2_FLAGS = DEF(GCC49_X64_DLINK2_FLAGS) 76 *_GCC49_X64_DLINK2_FLAGS = DEF(GCC49_X64_DLINK2_FLAGS)
69 *_GCC49_X64_RC_FLAGS = DEF(GCC_X64_RC_FLAGS) 77 *_GCC49_X64_RC_FLAGS = DEF(GCC_X64_RC_FLAGS)
70 *_GCC49_X64_OBJCOPY_FLAGS = 78 *_GCC49_X64_OBJCOPY_FLAGS =
@@ -73,7 +81,7 @@ Index: git/BaseTools/Conf/tools_def.template
73 81
74 DEBUG_GCC49_X64_CC_FLAGS = DEF(GCC49_X64_CC_FLAGS) -Os 82 DEBUG_GCC49_X64_CC_FLAGS = DEF(GCC49_X64_CC_FLAGS) -Os
75 RELEASE_GCC49_X64_CC_FLAGS = DEF(GCC49_X64_CC_FLAGS) -Os -Wno-unused-but-set-variable -Wno-unused-const-variable 83 RELEASE_GCC49_X64_CC_FLAGS = DEF(GCC49_X64_CC_FLAGS) -Os -Wno-unused-but-set-variable -Wno-unused-const-variable
76@@ -2368,7 +2368,7 @@ RELEASE_GCC49_AARCH64_DLINK_XIPFLAGS = - 84@@ -2313,7 +2313,7 @@ RELEASE_GCC49_AARCH64_DLINK_XIPFLAGS = -z common-page-size=0x20
77 *_GCC5_IA32_DLINK2_FLAGS = DEF(GCC5_IA32_DLINK2_FLAGS) -no-pie 85 *_GCC5_IA32_DLINK2_FLAGS = DEF(GCC5_IA32_DLINK2_FLAGS) -no-pie
78 *_GCC5_IA32_RC_FLAGS = DEF(GCC_IA32_RC_FLAGS) 86 *_GCC5_IA32_RC_FLAGS = DEF(GCC_IA32_RC_FLAGS)
79 *_GCC5_IA32_OBJCOPY_FLAGS = 87 *_GCC5_IA32_OBJCOPY_FLAGS =
@@ -82,7 +90,7 @@ Index: git/BaseTools/Conf/tools_def.template
82 90
83 DEBUG_GCC5_IA32_CC_FLAGS = DEF(GCC5_IA32_CC_FLAGS) -flto -Os 91 DEBUG_GCC5_IA32_CC_FLAGS = DEF(GCC5_IA32_CC_FLAGS) -flto -Os
84 DEBUG_GCC5_IA32_DLINK_FLAGS = DEF(GCC5_IA32_X64_DLINK_FLAGS) -flto -Os -Wl,-m,elf_i386,--oformat=elf32-i386 92 DEBUG_GCC5_IA32_DLINK_FLAGS = DEF(GCC5_IA32_X64_DLINK_FLAGS) -flto -Os -Wl,-m,elf_i386,--oformat=elf32-i386
85@@ -2400,7 +2400,7 @@ RELEASE_GCC5_IA32_DLINK_FLAGS = DEF(G 93@@ -2345,7 +2345,7 @@ RELEASE_GCC5_IA32_DLINK_FLAGS = DEF(GCC5_IA32_X64_DLINK_FLAGS) -flto -Os -Wl,
86 *_GCC5_X64_DLINK2_FLAGS = DEF(GCC5_X64_DLINK2_FLAGS) 94 *_GCC5_X64_DLINK2_FLAGS = DEF(GCC5_X64_DLINK2_FLAGS)
87 *_GCC5_X64_RC_FLAGS = DEF(GCC_X64_RC_FLAGS) 95 *_GCC5_X64_RC_FLAGS = DEF(GCC_X64_RC_FLAGS)
88 *_GCC5_X64_OBJCOPY_FLAGS = 96 *_GCC5_X64_OBJCOPY_FLAGS =
@@ -91,3 +99,6 @@ Index: git/BaseTools/Conf/tools_def.template
91 99
92 DEBUG_GCC5_X64_CC_FLAGS = DEF(GCC5_X64_CC_FLAGS) -flto -DUSING_LTO -Os 100 DEBUG_GCC5_X64_CC_FLAGS = DEF(GCC5_X64_CC_FLAGS) -flto -DUSING_LTO -Os
93 DEBUG_GCC5_X64_DLINK_FLAGS = DEF(GCC5_X64_DLINK_FLAGS) -flto -Os 101 DEBUG_GCC5_X64_DLINK_FLAGS = DEF(GCC5_X64_DLINK_FLAGS) -flto -Os
102--
1032.32.0
104
diff --git a/meta/recipes-core/ovmf/ovmf/reproducible.patch b/meta/recipes-core/ovmf/ovmf/0006-reproducible.patch
index 5d2aeaacfe..343c21b541 100644
--- a/meta/recipes-core/ovmf/ovmf/reproducible.patch
+++ b/meta/recipes-core/ovmf/ovmf/0006-reproducible.patch
@@ -1,3 +1,8 @@
1From 27ed9962f5cb3afcc44d6c96c53277132a999712 Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Mon, 14 Jun 2021 19:57:30 +0200
4Subject: [PATCH 6/6] reproducible
5
1This patch fixes various things which make the build more reproducible. Some changes 6This patch fixes various things which make the build more reproducible. Some changes
2here only change intermediate artefacts but that means when you have two build trees 7here only change intermediate artefacts but that means when you have two build trees
3giving differing results, the differences can be isolated more easily. The issues here 8giving differing results, the differences can be isolated more easily. The issues here
@@ -11,22 +16,83 @@ TMPDIR = "${TOPDIR}/tmp-inital-mylongpath-mylongpath-mylongpath-mylongpath-mylon
11The patch specifically: 16The patch specifically:
12 17
13 * Sorts output in GNUmakefile 18 * Sorts output in GNUmakefile
14 * Always generates indirect flags files used to avoid pathlength issues else the 19 * Always generates indirect flags files used to avoid pathlength issues else the
15 compile commands suddenly change when using longer paths 20 compile commands suddenly change when using longer paths
16 * Sorts the AutoGenTimeStamp file contents 21 * Sorts the AutoGenTimeStamp file contents
17 * Makes the TargetDescBlock objects from BuildEngine sortable to allow the makefile fix 22 * Makes the TargetDescBlock objects from BuildEngine sortable to allow the makefile fix
18 * Fix ElfConvert within GenFw so that only the basename of the binary being converted 23 * Fix ElfConvert within GenFw so that only the basename of the binary being converted
19 is used, else the output from "GenFw XXX.bin" differs from "GenFw /long/path/XXX.bin" 24 is used, else the output from "GenFw XXX.bin" differs from "GenFw /long/path/XXX.bin"
20 with sufficiently long paths 25 with sufficiently long paths
21 26
22Upstream-Status: Pending [At least some of this might be interesting to upstream] 27Upstream-Status: Pending [At least some of this might be interesting to upstream]
23Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> 28Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
29Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
30---
31 BaseTools/Source/C/GenFw/Elf64Convert.c | 8 ++++---
32 .../Source/Python/AutoGen/BuildEngine.py | 3 +++
33 BaseTools/Source/Python/AutoGen/GenMake.py | 24 +++++++++----------
34 .../Source/Python/AutoGen/ModuleAutoGen.py | 5 +++-
35 4 files changed, 24 insertions(+), 16 deletions(-)
24 36
25Index: git/BaseTools/Source/Python/AutoGen/GenMake.py 37diff --git a/BaseTools/Source/C/GenFw/Elf64Convert.c b/BaseTools/Source/C/GenFw/Elf64Convert.c
26=================================================================== 38index d097db8632..a87ae6f3d0 100644
27--- git.orig/BaseTools/Source/Python/AutoGen/GenMake.py 39--- a/BaseTools/Source/C/GenFw/Elf64Convert.c
28+++ git/BaseTools/Source/Python/AutoGen/GenMake.py 40+++ b/BaseTools/Source/C/GenFw/Elf64Convert.c
29@@ -571,7 +571,7 @@ cleanlib: 41@@ -14,6 +14,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
42 #ifndef __GNUC__
43 #include <windows.h>
44 #include <io.h>
45+#else
46+#define _GNU_SOURCE
47 #endif
48 #include <assert.h>
49 #include <stdio.h>
50@@ -769,7 +771,7 @@ ScanSections64 (
51 }
52 mCoffOffset = mDebugOffset + sizeof(EFI_IMAGE_DEBUG_DIRECTORY_ENTRY) +
53 sizeof(EFI_IMAGE_DEBUG_CODEVIEW_NB10_ENTRY) +
54- strlen(mInImageName) + 1;
55+ strlen(basename(mInImageName)) + 1;
56
57 mCoffOffset = CoffAlign(mCoffOffset);
58 if (SectionCount == 0) {
59@@ -1608,7 +1610,7 @@ WriteDebug64 (
60 EFI_IMAGE_DEBUG_DIRECTORY_ENTRY *Dir;
61 EFI_IMAGE_DEBUG_CODEVIEW_NB10_ENTRY *Nb10;
62
63- Len = strlen(mInImageName) + 1;
64+ Len = strlen(basename(mInImageName)) + 1;
65
66 Dir = (EFI_IMAGE_DEBUG_DIRECTORY_ENTRY*)(mCoffFile + mDebugOffset);
67 Dir->Type = EFI_IMAGE_DEBUG_TYPE_CODEVIEW;
68@@ -1618,7 +1620,7 @@ WriteDebug64 (
69
70 Nb10 = (EFI_IMAGE_DEBUG_CODEVIEW_NB10_ENTRY*)(Dir + 1);
71 Nb10->Signature = CODEVIEW_SIGNATURE_NB10;
72- strcpy ((char *)(Nb10 + 1), mInImageName);
73+ strcpy ((char *)(Nb10 + 1), basename(mInImageName));
74
75
76 NtHdr = (EFI_IMAGE_OPTIONAL_HEADER_UNION *)(mCoffFile + mNtHdrOffset);
77diff --git a/BaseTools/Source/Python/AutoGen/BuildEngine.py b/BaseTools/Source/Python/AutoGen/BuildEngine.py
78index 722fead75a..8f1c236970 100644
79--- a/BaseTools/Source/Python/AutoGen/BuildEngine.py
80+++ b/BaseTools/Source/Python/AutoGen/BuildEngine.py
81@@ -70,6 +70,9 @@ class TargetDescBlock(object):
82 else:
83 return str(Other) == self.Target.Path
84
85+ def __lt__(self, other):
86+ return str(self) < str(other)
87+
88 def AddInput(self, Input):
89 if Input not in self.Inputs:
90 self.Inputs.append(Input)
91diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py b/BaseTools/Source/Python/AutoGen/GenMake.py
92index 961b2ab1c3..23c1592025 100755
93--- a/BaseTools/Source/Python/AutoGen/GenMake.py
94+++ b/BaseTools/Source/Python/AutoGen/GenMake.py
95@@ -575,7 +575,7 @@ cleanlib:
30 os.remove(RespFileList) 96 os.remove(RespFileList)
31 97
32 # convert source files and binary files to build targets 98 # convert source files and binary files to build targets
@@ -35,7 +101,7 @@ Index: git/BaseTools/Source/Python/AutoGen/GenMake.py
35 if len(self.ResultFileList) == 0 and len(MyAgo.SourceFileList) != 0: 101 if len(self.ResultFileList) == 0 and len(MyAgo.SourceFileList) != 0:
36 EdkLogger.error("build", AUTOGEN_ERROR, "Nothing to build", 102 EdkLogger.error("build", AUTOGEN_ERROR, "Nothing to build",
37 ExtraData="[%s]" % str(MyAgo)) 103 ExtraData="[%s]" % str(MyAgo))
38@@ -722,7 +722,7 @@ cleanlib: 104@@ -726,7 +726,7 @@ cleanlib:
39 OutputFile = '' 105 OutputFile = ''
40 DepsFileList = [] 106 DepsFileList = []
41 107
@@ -44,7 +110,7 @@ Index: git/BaseTools/Source/Python/AutoGen/GenMake.py
44 if Cmd[2]: 110 if Cmd[2]:
45 for CopyCmd in Cmd[2]: 111 for CopyCmd in Cmd[2]:
46 Src, Dst = CopyCmd 112 Src, Dst = CopyCmd
47@@ -755,7 +755,7 @@ cleanlib: 113@@ -759,7 +759,7 @@ cleanlib:
48 self.BuildTargetList.append('\t%s' % CmdString) 114 self.BuildTargetList.append('\t%s' % CmdString)
49 115
50 self.ParseSecCmd(DepsFileList, Cmd[1]) 116 self.ParseSecCmd(DepsFileList, Cmd[1])
@@ -53,7 +119,7 @@ Index: git/BaseTools/Source/Python/AutoGen/GenMake.py
53 self.BuildTargetList.append('%s : %s' % (self.ReplaceMacro(SecOutputFile), self.ReplaceMacro(SecDepsFile))) 119 self.BuildTargetList.append('%s : %s' % (self.ReplaceMacro(SecOutputFile), self.ReplaceMacro(SecDepsFile)))
54 self.BuildTargetList.append('\t%s' % self.ReplaceMacro(SecCmd)) 120 self.BuildTargetList.append('\t%s' % self.ReplaceMacro(SecCmd))
55 self.FfsOutputFileList = [] 121 self.FfsOutputFileList = []
56@@ -794,13 +794,13 @@ cleanlib: 122@@ -798,13 +798,13 @@ cleanlib:
57 123
58 def CommandExceedLimit(self): 124 def CommandExceedLimit(self):
59 FlagDict = { 125 FlagDict = {
@@ -74,7 +140,7 @@ Index: git/BaseTools/Source/Python/AutoGen/GenMake.py
74 } 140 }
75 141
76 RespDict = {} 142 RespDict = {}
77@@ -1003,9 +1003,9 @@ cleanlib: 143@@ -1007,9 +1007,9 @@ cleanlib:
78 if not self.ObjTargetDict.get(T.Target.SubDir): 144 if not self.ObjTargetDict.get(T.Target.SubDir):
79 self.ObjTargetDict[T.Target.SubDir] = set() 145 self.ObjTargetDict[T.Target.SubDir] = set()
80 self.ObjTargetDict[T.Target.SubDir].add(NewFile) 146 self.ObjTargetDict[T.Target.SubDir].add(NewFile)
@@ -86,10 +152,10 @@ Index: git/BaseTools/Source/Python/AutoGen/GenMake.py
86 # Generate related macros if needed 152 # Generate related macros if needed
87 if T.GenFileListMacro and T.FileListMacro not in self.FileListMacros: 153 if T.GenFileListMacro and T.FileListMacro not in self.FileListMacros:
88 self.FileListMacros[T.FileListMacro] = [] 154 self.FileListMacros[T.FileListMacro] = []
89Index: git/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py 155diff --git a/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py b/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py
90=================================================================== 156index d70b0d7ae8..25dca9a6df 100755
91--- git.orig/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py 157--- a/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py
92+++ git/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py 158+++ b/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py
93@@ -1484,6 +1484,9 @@ class ModuleAutoGen(AutoGen): 159@@ -1484,6 +1484,9 @@ class ModuleAutoGen(AutoGen):
94 for File in Files: 160 for File in Files:
95 if File.lower().endswith('.pdb'): 161 if File.lower().endswith('.pdb'):
@@ -109,57 +175,6 @@ Index: git/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py
109 175
110 # Ignore generating makefile when it is a binary module 176 # Ignore generating makefile when it is a binary module
111 if self.IsBinaryModule: 177 if self.IsBinaryModule:
112Index: git/BaseTools/Source/Python/AutoGen/BuildEngine.py 178--
113=================================================================== 1792.32.0
114--- git.orig/BaseTools/Source/Python/AutoGen/BuildEngine.py 180
115+++ git/BaseTools/Source/Python/AutoGen/BuildEngine.py
116@@ -70,6 +70,9 @@ class TargetDescBlock(object):
117 else:
118 return str(Other) == self.Target.Path
119
120+ def __lt__(self, other):
121+ return str(self) < str(other)
122+
123 def AddInput(self, Input):
124 if Input not in self.Inputs:
125 self.Inputs.append(Input)
126Index: git/BaseTools/Source/C/GenFw/Elf64Convert.c
127===================================================================
128--- git.orig/BaseTools/Source/C/GenFw/Elf64Convert.c
129+++ git/BaseTools/Source/C/GenFw/Elf64Convert.c
130@@ -14,6 +14,8 @@ SPDX-License-Identifier: BSD-2-Clause-Pa
131 #ifndef __GNUC__
132 #include <windows.h>
133 #include <io.h>
134+#else
135+#define _GNU_SOURCE
136 #endif
137 #include <assert.h>
138 #include <stdio.h>
139@@ -770,7 +772,7 @@ ScanSections64 (
140 }
141 mCoffOffset = mDebugOffset + sizeof(EFI_IMAGE_DEBUG_DIRECTORY_ENTRY) +
142 sizeof(EFI_IMAGE_DEBUG_CODEVIEW_NB10_ENTRY) +
143- strlen(mInImageName) + 1;
144+ strlen(basename(mInImageName)) + 1;
145
146 mCoffOffset = CoffAlign(mCoffOffset);
147 if (SectionCount == 0) {
148@@ -1609,7 +1611,7 @@ WriteDebug64 (
149 EFI_IMAGE_DEBUG_DIRECTORY_ENTRY *Dir;
150 EFI_IMAGE_DEBUG_CODEVIEW_NB10_ENTRY *Nb10;
151
152- Len = strlen(mInImageName) + 1;
153+ Len = strlen(basename(mInImageName)) + 1;
154
155 Dir = (EFI_IMAGE_DEBUG_DIRECTORY_ENTRY*)(mCoffFile + mDebugOffset);
156 Dir->Type = EFI_IMAGE_DEBUG_TYPE_CODEVIEW;
157@@ -1619,7 +1621,7 @@ WriteDebug64 (
158
159 Nb10 = (EFI_IMAGE_DEBUG_CODEVIEW_NB10_ENTRY*)(Dir + 1);
160 Nb10->Signature = CODEVIEW_SIGNATURE_NB10;
161- strcpy ((char *)(Nb10 + 1), mInImageName);
162+ strcpy ((char *)(Nb10 + 1), basename(mInImageName));
163
164
165 NtHdr = (EFI_IMAGE_OPTIONAL_HEADER_UNION *)(mCoffFile + mNtHdrOffset);
diff --git a/meta/recipes-core/ovmf/ovmf/zero.patch b/meta/recipes-core/ovmf/ovmf/zero.patch
deleted file mode 100644
index af7a9d31f6..0000000000
--- a/meta/recipes-core/ovmf/ovmf/zero.patch
+++ /dev/null
@@ -1,84 +0,0 @@
1Pass --zero to GenFw in release builds so that the sections that link back to
2the intermediate binaries (containing build paths) are removed.
3
4Upstream-Status: Pending (discussion at https://bugzilla.tianocore.org/show_bug.cgi?id=3256)
5Signed-off-by: Ross Burton <ross.burton@arm.com>
6
7From 6303b065802c9427c718fda129360189b79316e7 Mon Sep 17 00:00:00 2001
8From: Ross Burton <ross.burton@arm.com>
9Date: Tue, 16 Mar 2021 16:49:49 +0000
10Subject: [PATCH] Strip build paths
11
12---
13 OvmfPkg/AmdSev/AmdSevX64.dsc | 1 +
14 OvmfPkg/Bhyve/BhyveX64.dsc | 1 +
15 OvmfPkg/OvmfPkgIa32.dsc | 2 ++
16 OvmfPkg/OvmfPkgIa32X64.dsc | 1 +
17 OvmfPkg/OvmfPkgX64.dsc | 1 +
18 OvmfPkg/OvmfXen.dsc | 1 +
19 6 files changed, 7 insertions(+)
20
21diff --git a/OvmfPkg/Bhyve/BhyveX64.dsc b/OvmfPkg/Bhyve/BhyveX64.dsc
22index 4a1cdf5aca..132f55cf69 100644
23--- a/OvmfPkg/Bhyve/BhyveX64.dsc
24+++ b/OvmfPkg/Bhyve/BhyveX64.dsc
25@@ -76,6 +76,7 @@
26 GCC:*_*_X64_GENFW_FLAGS = --keepexceptiontable
27 INTEL:*_*_X64_GENFW_FLAGS = --keepexceptiontable
28 !endif
29+ RELEASE_*_*_GENFW_FLAGS = --zero
30
31 #
32 # Disable deprecated APIs.
33diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc
34index 1eaf3e99c6..ce20f09df8 100644
35--- a/OvmfPkg/OvmfPkgIa32.dsc
36+++ b/OvmfPkg/OvmfPkgIa32.dsc
37@@ -90,6 +90,8 @@
38
39 !include NetworkPkg/NetworkBuildOptions.dsc.inc
40
41+ RELEASE_*_*_GENFW_FLAGS = --zero
42+
43 [BuildOptions.common.EDKII.DXE_RUNTIME_DRIVER]
44 GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000
45 XCODE:*_*_*_DLINK_FLAGS = -seg1addr 0x1000 -segalign 0x1000
46diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc
47index 4a5a430147..97cc438250 100644
48--- a/OvmfPkg/OvmfPkgIa32X64.dsc
49+++ b/OvmfPkg/OvmfPkgIa32X64.dsc
50@@ -84,6 +84,7 @@
51 GCC:*_*_X64_GENFW_FLAGS = --keepexceptiontable
52 INTEL:*_*_X64_GENFW_FLAGS = --keepexceptiontable
53 !endif
54+ RELEASE_*_*_GENFW_FLAGS = --zero
55
56 #
57 # Disable deprecated APIs.
58diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc
59index d4d601b444..f544fb04bf 100644
60--- a/OvmfPkg/OvmfPkgX64.dsc
61+++ b/OvmfPkg/OvmfPkgX64.dsc
62@@ -84,6 +84,7 @@
63 GCC:*_*_X64_GENFW_FLAGS = --keepexceptiontable
64 INTEL:*_*_X64_GENFW_FLAGS = --keepexceptiontable
65 !endif
66+ RELEASE_*_*_GENFW_FLAGS = --zero
67
68 #
69 # Disable deprecated APIs.
70diff --git a/OvmfPkg/OvmfXen.dsc b/OvmfPkg/OvmfXen.dsc
71index 507029404f..fcaa35acf1 100644
72--- a/OvmfPkg/OvmfXen.dsc
73+++ b/OvmfPkg/OvmfXen.dsc
74@@ -74,6 +74,7 @@
75 GCC:*_*_X64_GENFW_FLAGS = --keepexceptiontable
76 INTEL:*_*_X64_GENFW_FLAGS = --keepexceptiontable
77 !endif
78+ RELEASE_*_*_GENFW_FLAGS = --zero
79
80 #
81 # Disable deprecated APIs.
82--
832.25.1
84
diff --git a/meta/recipes-core/ovmf/ovmf_git.bb b/meta/recipes-core/ovmf/ovmf_git.bb
index 888ea082ec..90dae2aed0 100644
--- a/meta/recipes-core/ovmf/ovmf_git.bb
+++ b/meta/recipes-core/ovmf/ovmf_git.bb
@@ -15,15 +15,15 @@ PACKAGECONFIG[secureboot] = ",,,"
15SRC_URI = "gitsm://github.com/tianocore/edk2.git;branch=master;protocol=https \ 15SRC_URI = "gitsm://github.com/tianocore/edk2.git;branch=master;protocol=https \
16 file://0001-ovmf-update-path-to-native-BaseTools.patch \ 16 file://0001-ovmf-update-path-to-native-BaseTools.patch \
17 file://0002-BaseTools-makefile-adjust-to-build-in-under-bitbake.patch \ 17 file://0002-BaseTools-makefile-adjust-to-build-in-under-bitbake.patch \
18 file://0004-ovmf-Update-to-latest.patch \ 18 file://0003-ovmf-Update-to-latest.patch \
19 file://zero.patch \ 19 file://0004-Strip-build-paths.patch \
20 file://debug_prefix_map.patch \ 20 file://0005-debug-prefix-map.patch \
21 file://reproducible.patch \ 21 file://0006-reproducible.patch \
22 file://0001-Fix-VLA-parameter-warning.patch \ 22 file://0001-Fix-VLA-parameter-warning.patch \
23 " 23 "
24 24
25PV = "edk2-stable202102" 25PV = "edk2-stable202105"
26SRCREV = "ef91b07388e1c0a50c604e5350eeda98428ccea6" 26SRCREV = "e1999b264f1f9d7230edf2448f757c73da567832"
27UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>edk2-stable.*)" 27UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>edk2-stable.*)"
28 28
29inherit deploy 29inherit deploy