summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/ovmf/ovmf
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/ovmf/ovmf')
-rw-r--r--meta/recipes-core/ovmf/ovmf/0001-ovmf-update-path-to-native-BaseTools.patch9
-rw-r--r--meta/recipes-core/ovmf/ovmf/0002-BaseTools-makefile-adjust-to-build-in-under-bitbake.patch58
-rw-r--r--meta/recipes-core/ovmf/ovmf/0003-debug-prefix-map.patch104
-rw-r--r--meta/recipes-core/ovmf/ovmf/0003-ovmf-enable-long-path-file.patch28
-rw-r--r--meta/recipes-core/ovmf/ovmf/0004-ovmf-Update-to-latest.patch46
-rw-r--r--meta/recipes-core/ovmf/ovmf/0004-reproducible.patch180
6 files changed, 318 insertions, 107 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..490d9e8046 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,4 +1,4 @@
1From 200ff35c6545b4ab85f5ea7a6096fbaec3d82f6d Mon Sep 17 00:00:00 2001 1From d8df6b6433351763e1db791dd84d432983d2b249 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/4] ovmf: update path to native BaseTools
@@ -10,14 +10,13 @@ tools. The BBAKE_EDK_TOOLS_PATH string is used as a pattern to be replaced
10with the appropriate location before building. 10with 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: Inappropriate [oe-core cross compile specific]
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(-)
18 17
19diff --git a/OvmfPkg/build.sh b/OvmfPkg/build.sh 18diff --git a/OvmfPkg/build.sh b/OvmfPkg/build.sh
20index 91b1442ade..1858dae31a 100755 19index b0334fb76e..094f86f096 100755
21--- a/OvmfPkg/build.sh 20--- a/OvmfPkg/build.sh
22+++ b/OvmfPkg/build.sh 21+++ b/OvmfPkg/build.sh
23@@ -24,7 +24,7 @@ then 22@@ -24,7 +24,7 @@ then
@@ -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.30.2
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..eeedc9e20f 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,67 +1,69 @@
1From 667c0cf97dadc4f5994d26ec3984f559a05ec406 Mon Sep 17 00:00:00 2001 1From ac9df4fb92965f1f95a5bdbde5f2f86d0c569711 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] 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> 9Note from Alex: this is not appropriate for upstream submission as
10Upstream-Status: Pending 10the recipe already does lots of similar in-place fixups elsewhere, so
11this patch shold be converted to follow that pattern. We're not going
12to fight against how upstream wants to configure the build.
11 13
14Signed-off-by: Ricardo Neri <ricardo.neri@linux.intel.com>
15Upstream-Status: Inappropriate [needs to be converted to in-recipe fixups]
12--- 16---
13 BaseTools/Source/C/Makefiles/header.makefile | 17 +++++++++-------- 17 BaseTools/Source/C/Makefiles/header.makefile | 15 +++++++--------
14 1 file changed, 9 insertions(+), 8 deletions(-) 18 1 file changed, 7 insertions(+), 8 deletions(-)
15 19
16diff --git a/BaseTools/Source/C/Makefiles/header.makefile b/BaseTools/Source/C/Makefiles/header.makefile 20diff --git a/BaseTools/Source/C/Makefiles/header.makefile b/BaseTools/Source/C/Makefiles/header.makefile
17index 1c105ee7d4..d5eea3864e 100644 21index d369908a09..22c670f316 100644
18--- a/BaseTools/Source/C/Makefiles/header.makefile 22--- a/BaseTools/Source/C/Makefiles/header.makefile
19+++ b/BaseTools/Source/C/Makefiles/header.makefile 23+++ b/BaseTools/Source/C/Makefiles/header.makefile
20@@ -69,35 +69,36 @@ $(error Bad HOST_ARCH) 24@@ -85,35 +85,34 @@ endif
21 endif
22 25
23 INCLUDE = $(TOOL_INCLUDE) -I $(MAKEROOT) -I $(MAKEROOT)/Include/Common -I $(MAKEROOT)/Include/ -I $(MAKEROOT)/Include/IndustryStandard -I $(MAKEROOT)/Common/ -I .. -I . $(ARCH_INCLUDE) 26 INCLUDE = $(TOOL_INCLUDE) -I $(MAKEROOT) -I $(MAKEROOT)/Include/Common -I $(MAKEROOT)/Include/ -I $(MAKEROOT)/Include/IndustryStandard -I $(MAKEROOT)/Common/ -I .. -I . $(ARCH_INCLUDE)
24-BUILD_CPPFLAGS = $(INCLUDE) 27 INCLUDE += -I $(EDK2_PATH)/MdePkg/Include
25+BUILD_CPPFLAGS += $(INCLUDE) 28-CPPFLAGS = $(INCLUDE)
29+CPPFLAGS += $(INCLUDE)
26 30
27 # keep EXTRA_OPTFLAGS last 31 # keep EXTRA_OPTFLAGS last
28 BUILD_OPTFLAGS = -O2 $(EXTRA_OPTFLAGS) 32 BUILD_OPTFLAGS = -O2 $(EXTRA_OPTFLAGS)
29 33
30 ifeq ($(DARWIN),Darwin) 34 ifeq ($(DARWIN),Darwin)
31 # assume clang or clang compatible flags on OS X 35 # assume clang or clang compatible flags on OS X
32-BUILD_CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror \ 36-CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror \
33+BUILD_CFLAGS += -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror \ 37+CFLAGS += -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror \
34 -Wno-deprecated-declarations -Wno-self-assign -Wno-unused-result -nostdlib -g 38 -Wno-deprecated-declarations -Wno-self-assign -Wno-unused-result -nostdlib -g
35 else 39 else
36 ifeq ($(CXX), llvm) 40 ifneq ($(CLANG),)
37-BUILD_CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -fwrapv \ 41-CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -fwrapv \
38+BUILD_CFLAGS += -MD -fshort-wchar -fno-strict-aliasing -fwrapv \ 42+CFLAGS += -MD -fshort-wchar -fno-strict-aliasing -fwrapv \
39 -fno-delete-null-pointer-checks -Wall -Werror \ 43 -fno-delete-null-pointer-checks -Wall -Werror \
40 -Wno-deprecated-declarations -Wno-self-assign \ 44 -Wno-deprecated-declarations -Wno-self-assign \
41 -Wno-unused-result -nostdlib -g 45 -Wno-unused-result -nostdlib -g
42 else 46 else
43-BUILD_CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -fwrapv \ 47-CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -fwrapv \
44+BUILD_CFLAGS += -MD -fshort-wchar -fno-strict-aliasing -fwrapv \ 48+CFLAGS += -MD -fshort-wchar -fno-strict-aliasing -fwrapv \
45 -fno-delete-null-pointer-checks -Wall -Werror \ 49 -fno-delete-null-pointer-checks -Wall -Werror \
46 -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict \ 50 -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict \
47 -Wno-unused-result -nostdlib -g 51 -Wno-unused-result -nostdlib -g
48 endif 52 endif
49 endif 53 endif
50 ifeq ($(CXX), llvm) 54 ifneq ($(CLANG),)
51-BUILD_LFLAGS = 55-LDFLAGS =
52-BUILD_CXXFLAGS = -Wno-deprecated-register -Wno-unused-result 56-CXXFLAGS = -Wno-deprecated-register -Wno-unused-result -std=c++14
53+BUILD_LFLAGS = $(LDFLAGS) 57+CXXFLAGS += -Wno-deprecated-register -Wno-unused-result -std=c++14
54+BUILD_CXXFLAGS += -Wno-deprecated-register -Wno-unused-result
55 else 58 else
56-BUILD_LFLAGS = 59-LDFLAGS =
57-BUILD_CXXFLAGS = -Wno-unused-result 60-CXXFLAGS = -Wno-unused-result
58+BUILD_LFLAGS = $(LDFLAGS) 61+CXXFLAGS += -Wno-unused-result
59+BUILD_CXXFLAGS += -Wno-unused-result
60 endif 62 endif
61+ 63+
62 ifeq ($(HOST_ARCH), IA32) 64 ifeq ($(HOST_ARCH), IA32)
63 # 65 #
64 # Snow Leopard is a 32-bit and 64-bit environment. uname -m returns i386, but gcc defaults 66 # Snow Leopard is a 32-bit and 64-bit environment. uname -m returns i386, but gcc defaults
65-- 67--
662.28.0 682.30.2
67 69
diff --git a/meta/recipes-core/ovmf/ovmf/0003-debug-prefix-map.patch b/meta/recipes-core/ovmf/ovmf/0003-debug-prefix-map.patch
new file mode 100644
index 0000000000..c0c763c1cf
--- /dev/null
+++ b/meta/recipes-core/ovmf/ovmf/0003-debug-prefix-map.patch
@@ -0,0 +1,104 @@
1From 03e536b20d0b72cf078052f6748de8df3836625c 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 3/4] debug prefix map
5
6We want to pass ${DEBUG_PREFIX_MAP} to gcc commands and also pass in
7 --debug-prefix-map to nasm (we carry a patch to nasm for this). The
8tools definitions file is built by ovmf-native so we need to pass this in
9at target build time when we know the right values so we use the environment.
10
11By using determininistc file paths during the ovmf build, it removes the
12opportunitity for gcc/ld to change the output binaries due to path lengths
13overflowing section sizes and causing small changes in the binary output.
14Previously we relied on the stripped output being the same which isn't always
15the case if the size of the debug symbols varies.
16
17Upstream-Status: Submitted [https://github.com/tianocore/edk2/pull/2202]
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(-)
23
24diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template
25index 503a6687c1..10ac38ef9e 100755
26--- a/BaseTools/Conf/tools_def.template
27+++ b/BaseTools/Conf/tools_def.template
28@@ -739,7 +739,7 @@ NOOPT_*_*_OBJCOPY_ADDDEBUGFLAG = --add-gnu-debuglink="$(DEBUG_DIR)/$(MODULE_
29 *_*_*_DTCPP_PATH = DEF(DTCPP_BIN)
30 *_*_*_DTC_PATH = DEF(DTC_BIN)
31
32-DEFINE GCC_ALL_CC_FLAGS = -g -Os -fshort-wchar -fno-builtin -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -include AutoGen.h -fno-common
33+DEFINE GCC_ALL_CC_FLAGS = -g -Os -fshort-wchar -fno-builtin -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -include AutoGen.h -fno-common ENV(GCC_PREFIX_MAP)
34 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 -fno-pic -fno-pie
35 DEFINE GCC_LOONGARCH64_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -mabi=lp64d -fno-asynchronous-unwind-tables -fno-plt -Wno-address -fno-short-enums -fsigned-char -ffunction-sections -fdata-sections
36 DEFINE GCC_ARM_CC_XIPFLAGS = -mno-unaligned-access
37@@ -759,8 +759,8 @@ DEFINE GCC_ARM_ASLDLINK_FLAGS = DEF(GCC_ARM_DLINK_FLAGS) -Wl,--entry,Refere
38 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_LOONGARCH64_ASLDLINK_FLAGS = DEF(GCC_LOONGARCH64_DLINK_FLAGS) -Wl,--entry,ReferenceAcpiTable -u $(IMAGE_ENTRY_POINT)
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
41-DEFINE GCC_ASM_FLAGS = -c -x assembler -imacros AutoGen.h
42-DEFINE GCC_PP_FLAGS = -E -x assembler-with-cpp -include AutoGen.h
43+DEFINE GCC_ASM_FLAGS = -c -x assembler -imacros AutoGen.h ENV(GCC_PREFIX_MAP)
44+DEFINE GCC_PP_FLAGS = -E -x assembler-with-cpp -include AutoGen.h ENV(GCC_PREFIX_MAP)
45 DEFINE GCC_VFRPP_FLAGS = -x c -E -P -DVFRCOMPILE --include $(MODULE_NAME)StrDefs.h
46 DEFINE GCC_ASLPP_FLAGS = -x c -E -include AutoGen.h
47 DEFINE GCC_ASLCC_FLAGS = -x c
48@@ -913,7 +913,7 @@ DEFINE GCC5_LOONGARCH64_PP_FLAGS = -mabi=lp64d -march=loongarch64 DEF(
49 *_GCC48_IA32_DLINK2_FLAGS = DEF(GCC48_IA32_DLINK2_FLAGS)
50 *_GCC48_IA32_RC_FLAGS = DEF(GCC_IA32_RC_FLAGS)
51 *_GCC48_IA32_OBJCOPY_FLAGS =
52-*_GCC48_IA32_NASM_FLAGS = -f elf32
53+*_GCC48_IA32_NASM_FLAGS = -f elf32 ENV(NASM_PREFIX_MAP)
54
55 DEBUG_GCC48_IA32_CC_FLAGS = DEF(GCC48_IA32_CC_FLAGS)
56 RELEASE_GCC48_IA32_CC_FLAGS = DEF(GCC48_IA32_CC_FLAGS) -Wno-unused-but-set-variable
57@@ -941,7 +941,7 @@ RELEASE_GCC48_IA32_CC_FLAGS = DEF(GCC48_IA32_CC_FLAGS) -Wno-unused-but-set
58 *_GCC48_X64_DLINK2_FLAGS = DEF(GCC48_X64_DLINK2_FLAGS)
59 *_GCC48_X64_RC_FLAGS = DEF(GCC_X64_RC_FLAGS)
60 *_GCC48_X64_OBJCOPY_FLAGS =
61-*_GCC48_X64_NASM_FLAGS = -f elf64
62+*_GCC48_X64_NASM_FLAGS = -f elf64 ENV(NASM_PREFIX_MAP)
63
64 DEBUG_GCC48_X64_CC_FLAGS = DEF(GCC48_X64_CC_FLAGS)
65 RELEASE_GCC48_X64_CC_FLAGS = DEF(GCC48_X64_CC_FLAGS) -Wno-unused-but-set-variable
66@@ -1050,7 +1050,7 @@ RELEASE_GCC48_AARCH64_CC_FLAGS = DEF(GCC48_AARCH64_CC_FLAGS) -Wno-unused-but-s
67 *_GCC49_IA32_DLINK2_FLAGS = DEF(GCC49_IA32_DLINK2_FLAGS)
68 *_GCC49_IA32_RC_FLAGS = DEF(GCC_IA32_RC_FLAGS)
69 *_GCC49_IA32_OBJCOPY_FLAGS =
70-*_GCC49_IA32_NASM_FLAGS = -f elf32
71+*_GCC49_IA32_NASM_FLAGS = -f elf32 ENV(NASM_PREFIX_MAP)
72
73 DEBUG_GCC49_IA32_CC_FLAGS = DEF(GCC49_IA32_CC_FLAGS)
74 RELEASE_GCC49_IA32_CC_FLAGS = DEF(GCC49_IA32_CC_FLAGS) -Wno-unused-but-set-variable -Wno-unused-const-variable
75@@ -1078,7 +1078,7 @@ RELEASE_GCC49_IA32_CC_FLAGS = DEF(GCC49_IA32_CC_FLAGS) -Wno-unused-but-set
76 *_GCC49_X64_DLINK2_FLAGS = DEF(GCC49_X64_DLINK2_FLAGS)
77 *_GCC49_X64_RC_FLAGS = DEF(GCC_X64_RC_FLAGS)
78 *_GCC49_X64_OBJCOPY_FLAGS =
79-*_GCC49_X64_NASM_FLAGS = -f elf64
80+*_GCC49_X64_NASM_FLAGS = -f elf64 ENV(NASM_PREFIX_MAP)
81
82 DEBUG_GCC49_X64_CC_FLAGS = DEF(GCC49_X64_CC_FLAGS)
83 RELEASE_GCC49_X64_CC_FLAGS = DEF(GCC49_X64_CC_FLAGS) -Wno-unused-but-set-variable -Wno-unused-const-variable
84@@ -1337,7 +1337,7 @@ RELEASE_GCCNOLTO_AARCH64_DLINK_XIPFLAGS = -z common-page-size=0x20
85 *_GCC5_IA32_DLINK2_FLAGS = DEF(GCC5_IA32_DLINK2_FLAGS) -no-pie
86 *_GCC5_IA32_RC_FLAGS = DEF(GCC_IA32_RC_FLAGS)
87 *_GCC5_IA32_OBJCOPY_FLAGS =
88-*_GCC5_IA32_NASM_FLAGS = -f elf32
89+*_GCC5_IA32_NASM_FLAGS = -f elf32 ENV(NASM_PREFIX_MAP)
90
91 DEBUG_GCC5_IA32_CC_FLAGS = DEF(GCC5_IA32_CC_FLAGS) -flto
92 DEBUG_GCC5_IA32_DLINK_FLAGS = DEF(GCC5_IA32_X64_DLINK_FLAGS) -flto -Os -Wl,-m,elf_i386,--oformat=elf32-i386
93@@ -1369,7 +1369,7 @@ RELEASE_GCC5_IA32_DLINK_FLAGS = DEF(GCC5_IA32_X64_DLINK_FLAGS) -flto -Os -Wl,
94 *_GCC5_X64_DLINK2_FLAGS = DEF(GCC5_X64_DLINK2_FLAGS)
95 *_GCC5_X64_RC_FLAGS = DEF(GCC_X64_RC_FLAGS)
96 *_GCC5_X64_OBJCOPY_FLAGS =
97-*_GCC5_X64_NASM_FLAGS = -f elf64
98+*_GCC5_X64_NASM_FLAGS = -f elf64 ENV(NASM_PREFIX_MAP)
99
100 DEBUG_GCC5_X64_CC_FLAGS = DEF(GCC5_X64_CC_FLAGS) -flto -DUSING_LTO
101 DEBUG_GCC5_X64_DLINK_FLAGS = DEF(GCC5_X64_DLINK_FLAGS) -flto -Os
102--
1032.30.2
104
diff --git a/meta/recipes-core/ovmf/ovmf/0003-ovmf-enable-long-path-file.patch b/meta/recipes-core/ovmf/ovmf/0003-ovmf-enable-long-path-file.patch
deleted file mode 100644
index df1d159011..0000000000
--- a/meta/recipes-core/ovmf/ovmf/0003-ovmf-enable-long-path-file.patch
+++ /dev/null
@@ -1,28 +0,0 @@
1From e19481e5a64f8915ac118899b10c40d12c0f9daa Mon Sep 17 00:00:00 2001
2From: Dengke Du <dengke.du@windriver.com>
3Date: Mon, 11 Sep 2017 02:21:55 -0400
4Subject: [PATCH 3/4] ovmf: enable long path file
5
6Upstream-Status: Pending
7Signed-off-by: Dengke Du <dengke.du@windriver.com>
8
9---
10 BaseTools/Source/C/Common/CommonLib.h | 2 +-
11 1 file changed, 1 insertion(+), 1 deletion(-)
12
13diff --git a/BaseTools/Source/C/Common/CommonLib.h b/BaseTools/Source/C/Common/CommonLib.h
14index e1cce985f7..d67d03c70c 100644
15--- a/BaseTools/Source/C/Common/CommonLib.h
16+++ b/BaseTools/Source/C/Common/CommonLib.h
17@@ -14,7 +14,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
18 #include <assert.h>
19 #define PRINTED_GUID_BUFFER_SIZE 37 // including null-termination
20
21-#define MAX_LONG_FILE_PATH 500
22+#define MAX_LONG_FILE_PATH 1023
23
24 #define MAX_UINT64 ((UINT64)0xFFFFFFFFFFFFFFFFULL)
25 #define MAX_UINT32 ((UINT32)0xFFFFFFFF)
26--
272.28.0
28
diff --git a/meta/recipes-core/ovmf/ovmf/0004-ovmf-Update-to-latest.patch b/meta/recipes-core/ovmf/ovmf/0004-ovmf-Update-to-latest.patch
deleted file mode 100644
index 128438b201..0000000000
--- a/meta/recipes-core/ovmf/ovmf/0004-ovmf-Update-to-latest.patch
+++ /dev/null
@@ -1,46 +0,0 @@
1From ad06fcf1e08736e79221cd6863ff2e3c9254f261 Mon Sep 17 00:00:00 2001
2From: Steve Langasek <steve.langasek@ubuntu.com>
3Date: Sat, 10 Jun 2017 01:39:36 -0700
4Subject: [PATCH 4/4] ovmf: Update to latest
5
6Description: pass -fno-stack-protector to all GCC toolchains
7 The upstream build rules inexplicably pass -fno-stack-protector only
8 when building for i386 and amd64. Add this essential argument to the
9 generic rules for gcc 4.4 and later.
10Last-Updated: 2016-04-12
11Upstream-Status: Pending
12
13---
14 BaseTools/Conf/tools_def.template | 8 ++++----
15 1 file changed, 4 insertions(+), 4 deletions(-)
16
17diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template
18index 933b3160fd..c2fbbf0c38 100755
19--- a/BaseTools/Conf/tools_def.template
20+++ b/BaseTools/Conf/tools_def.template
21@@ -1952,10 +1952,10 @@ DEFINE GCC_RISCV64_RC_FLAGS = -I binary -O elf64-littleriscv -B riscv
22 # GCC Build Flag for included header file list generation
23 DEFINE GCC_DEPS_FLAGS = -MMD -MF $@.deps
24
25-DEFINE GCC48_ALL_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -ffunction-sections -fdata-sections -DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
26+DEFINE GCC48_ALL_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -ffunction-sections -fdata-sections -fno-stack-protector -DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
27 DEFINE GCC48_IA32_X64_DLINK_COMMON = -nostdlib -Wl,-n,-q,--gc-sections -z common-page-size=0x20
28-DEFINE GCC48_IA32_CC_FLAGS = DEF(GCC48_ALL_CC_FLAGS) -m32 -march=i586 -malign-double -fno-stack-protector -D EFI32 -fno-asynchronous-unwind-tables -Wno-address
29-DEFINE GCC48_X64_CC_FLAGS = DEF(GCC48_ALL_CC_FLAGS) -m64 -fno-stack-protector "-DEFIAPI=__attribute__((ms_abi))" -maccumulate-outgoing-args -mno-red-zone -Wno-address -mcmodel=small -fpie -fno-asynchronous-unwind-tables -Wno-address
30+DEFINE GCC48_IA32_CC_FLAGS = DEF(GCC48_ALL_CC_FLAGS) -m32 -march=i586 -malign-double -D EFI32 -fno-asynchronous-unwind-tables -Wno-address
31+DEFINE GCC48_X64_CC_FLAGS = DEF(GCC48_ALL_CC_FLAGS) -m64 "-DEFIAPI=__attribute__((ms_abi))" -maccumulate-outgoing-args -mno-red-zone -Wno-address -mcmodel=small -fpie -fno-asynchronous-unwind-tables -Wno-address
32 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
34 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
36 DEFINE GCC48_ASM_FLAGS = DEF(GCC_ASM_FLAGS)
37 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
39-DEFINE GCC48_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_ARM_CC_FLAGS) -fstack-protector -mword-relocations
40+DEFINE GCC48_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_ARM_CC_FLAGS) -mword-relocations
41 DEFINE GCC48_ARM_CC_XIPFLAGS = DEF(GCC_ARM_CC_XIPFLAGS)
42 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)
44--
452.28.0
46
diff --git a/meta/recipes-core/ovmf/ovmf/0004-reproducible.patch b/meta/recipes-core/ovmf/ovmf/0004-reproducible.patch
new file mode 100644
index 0000000000..c3fdc3d863
--- /dev/null
+++ b/meta/recipes-core/ovmf/ovmf/0004-reproducible.patch
@@ -0,0 +1,180 @@
1From c59850367a190d70dec43e0a66f399a4d8a5ffed 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 4/4] reproducible
5
6This patch fixes various things which make the build more reproducible. Some changes
7here only change intermediate artefacts but that means when you have two build trees
8giving differing results, the differences can be isolated more easily. The issues here
9usually become apparent with longer paths.
10
11This was all debugged with:
12TMPDIR = "${TOPDIR}/tmp"
13vs.
14TMPDIR = "${TOPDIR}/tmp-inital-mylongpath-mylongpath-mylongpath-mylongpath-mylongpath-mylongpath-mylongpath-mylongpath-mylongpath"
15
16The patch specifically:
17
18 * Sorts output in GNUmakefile
19 * Always generates indirect flags files used to avoid pathlength issues else the
20 compile commands suddenly change when using longer paths
21 * Sorts the AutoGenTimeStamp file contents
22 * Makes the TargetDescBlock objects from BuildEngine sortable to allow the makefile fix
23 * Fix ElfConvert within GenFw so that only the basename of the binary being converted
24 is used, else the output from "GenFw XXX.bin" differs from "GenFw /long/path/XXX.bin"
25 with sufficiently long paths
26
27Upstream-Status: Submitted [https://github.com/tianocore/edk2/pull/2176]
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(-)
36
37diff --git a/BaseTools/Source/C/GenFw/Elf64Convert.c b/BaseTools/Source/C/GenFw/Elf64Convert.c
38index 9c17c90b16..fcc7864141 100644
39--- a/BaseTools/Source/C/GenFw/Elf64Convert.c
40+++ b/BaseTools/Source/C/GenFw/Elf64Convert.c
41@@ -15,6 +15,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@@ -990,7 +992,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 //
58 // Add more space in the .debug data region for the DllCharacteristicsEx
59@@ -2261,7 +2263,7 @@ WriteDebug64 (
60 EFI_IMAGE_DEBUG_CODEVIEW_NB10_ENTRY *Nb10;
61 EFI_IMAGE_DEBUG_EX_DLLCHARACTERISTICS_ENTRY *DllEntry;
62
63- Len = strlen(mInImageName) + 1;
64+ Len = strlen(basename(mInImageName)) + 1;
65
66 NtHdr = (EFI_IMAGE_OPTIONAL_HEADER_UNION *)(mCoffFile + mNtHdrOffset);
67 DataDir = &NtHdr->Pe32Plus.OptionalHeader.DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_DEBUG];
68@@ -2294,7 +2296,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 STATIC
77diff --git a/BaseTools/Source/Python/AutoGen/BuildEngine.py b/BaseTools/Source/Python/AutoGen/BuildEngine.py
78index 752a1a1f6a..02054cccf8 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 daec9c6d54..0e8cc20efe 100755
93--- a/BaseTools/Source/Python/AutoGen/GenMake.py
94+++ b/BaseTools/Source/Python/AutoGen/GenMake.py
95@@ -575,7 +575,7 @@ cleanlib:
96 os.remove(RespFileList)
97
98 # convert source files and binary files to build targets
99- self.ResultFileList = [str(T.Target) for T in MyAgo.CodaTargetList]
100+ self.ResultFileList = sorted([str(T.Target) for T in MyAgo.CodaTargetList])
101 if len(self.ResultFileList) == 0 and len(MyAgo.SourceFileList) != 0:
102 EdkLogger.error("build", AUTOGEN_ERROR, "Nothing to build",
103 ExtraData="[%s]" % str(MyAgo))
104@@ -726,7 +726,7 @@ cleanlib:
105 OutputFile = ''
106 DepsFileList = []
107
108- for Cmd in self.GenFfsList:
109+ for Cmd in sorted(self.GenFfsList):
110 if Cmd[2]:
111 for CopyCmd in Cmd[2]:
112 Src, Dst = CopyCmd
113@@ -759,7 +759,7 @@ cleanlib:
114 self.BuildTargetList.append('\t%s' % CmdString)
115
116 self.ParseSecCmd(DepsFileList, Cmd[1])
117- for SecOutputFile, SecDepsFile, SecCmd in self.FfsOutputFileList :
118+ for SecOutputFile, SecDepsFile, SecCmd in sorted(self.FfsOutputFileList):
119 self.BuildTargetList.append('%s : %s' % (self.ReplaceMacro(SecOutputFile), self.ReplaceMacro(SecDepsFile)))
120 self.BuildTargetList.append('\t%s' % self.ReplaceMacro(SecCmd))
121 self.FfsOutputFileList = []
122@@ -798,13 +798,13 @@ cleanlib:
123
124 def CommandExceedLimit(self):
125 FlagDict = {
126- 'CC' : { 'Macro' : '$(CC_FLAGS)', 'Value' : False},
127- 'PP' : { 'Macro' : '$(PP_FLAGS)', 'Value' : False},
128- 'APP' : { 'Macro' : '$(APP_FLAGS)', 'Value' : False},
129- 'ASLPP' : { 'Macro' : '$(ASLPP_FLAGS)', 'Value' : False},
130- 'VFRPP' : { 'Macro' : '$(VFRPP_FLAGS)', 'Value' : False},
131- 'ASM' : { 'Macro' : '$(ASM_FLAGS)', 'Value' : False},
132- 'ASLCC' : { 'Macro' : '$(ASLCC_FLAGS)', 'Value' : False},
133+ 'CC' : { 'Macro' : '$(CC_FLAGS)', 'Value' : True},
134+ 'PP' : { 'Macro' : '$(PP_FLAGS)', 'Value' : True},
135+ 'APP' : { 'Macro' : '$(APP_FLAGS)', 'Value' : True},
136+ 'ASLPP' : { 'Macro' : '$(ASLPP_FLAGS)', 'Value' : True},
137+ 'VFRPP' : { 'Macro' : '$(VFRPP_FLAGS)', 'Value' : True},
138+ 'ASM' : { 'Macro' : '$(ASM_FLAGS)', 'Value' : True},
139+ 'ASLCC' : { 'Macro' : '$(ASLCC_FLAGS)', 'Value' : True},
140 }
141
142 RespDict = {}
143@@ -1007,9 +1007,9 @@ cleanlib:
144 if not self.ObjTargetDict.get(T.Target.SubDir):
145 self.ObjTargetDict[T.Target.SubDir] = set()
146 self.ObjTargetDict[T.Target.SubDir].add(NewFile)
147- for Type in self._AutoGenObject.Targets:
148+ for Type in sorted(self._AutoGenObject.Targets):
149 resp_file_number = 0
150- for T in self._AutoGenObject.Targets[Type]:
151+ for T in sorted(self._AutoGenObject.Targets[Type]):
152 # Generate related macros if needed
153 if T.GenFileListMacro and T.FileListMacro not in self.FileListMacros:
154 self.FileListMacros[T.FileListMacro] = []
155diff --git a/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py b/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py
156index d05410b329..99b3f64aba 100755
157--- a/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py
158+++ b/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py
159@@ -1474,6 +1474,9 @@ class ModuleAutoGen(AutoGen):
160 for File in Files:
161 if File.lower().endswith('.pdb'):
162 AsBuiltInfDict['binary_item'].append('DISPOSABLE|' + File)
163+
164+ AsBuiltInfDict['binary_item'] = sorted(AsBuiltInfDict['binary_item'])
165+
166 HeaderComments = self.Module.HeaderComments
167 StartPos = 0
168 for Index in range(len(HeaderComments)):
169@@ -1749,7 +1752,7 @@ class ModuleAutoGen(AutoGen):
170 if os.path.exists (self.TimeStampPath):
171 os.remove (self.TimeStampPath)
172
173- SaveFileOnChange(self.TimeStampPath, "\n".join(FileSet), False)
174+ SaveFileOnChange(self.TimeStampPath, "\n".join(sorted(FileSet)), False)
175
176 # Ignore generating makefile when it is a binary module
177 if self.IsBinaryModule:
178--
1792.30.2
180