]> code.ossystems Code Review - openembedded-core.git/commitdiff
ovmf: update 2021.02 -> 2021.05
authorAlexander Kanavin <alex.kanavin@gmail.com>
Tue, 15 Jun 2021 08:12:17 +0000 (10:12 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 16 Jun 2021 23:02:50 +0000 (00:02 +0100)
Reformat patches using git, so that rebasing them to newer versions is easier.

Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-core/ovmf/ovmf/0001-ovmf-update-path-to-native-BaseTools.patch
meta/recipes-core/ovmf/ovmf/0002-BaseTools-makefile-adjust-to-build-in-under-bitbake.patch
meta/recipes-core/ovmf/ovmf/0003-ovmf-Update-to-latest.patch [moved from meta/recipes-core/ovmf/ovmf/0004-ovmf-Update-to-latest.patch with 91% similarity]
meta/recipes-core/ovmf/ovmf/0004-Strip-build-paths.patch [new file with mode: 0644]
meta/recipes-core/ovmf/ovmf/0005-debug-prefix-map.patch [moved from meta/recipes-core/ovmf/ovmf/debug_prefix_map.patch with 78% similarity]
meta/recipes-core/ovmf/ovmf/0006-reproducible.patch [moved from meta/recipes-core/ovmf/ovmf/reproducible.patch with 76% similarity]
meta/recipes-core/ovmf/ovmf/zero.patch [deleted file]
meta/recipes-core/ovmf/ovmf_git.bb

index c32963a807b38ddd1077f84c4c24442fed322714..89d9ffab5e60f46cf9e5d4014416e2f0769c354e 100644 (file)
@@ -1,7 +1,7 @@
-From 200ff35c6545b4ab85f5ea7a6096fbaec3d82f6d Mon Sep 17 00:00:00 2001
+From 1125f5a02c2f327aeffe2d6b66a9d816ad2eeec0 Mon Sep 17 00:00:00 2001
 From: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
 Date: Thu, 9 Jun 2016 02:23:01 -0700
-Subject: [PATCH 1/4] ovmf: update path to native BaseTools
+Subject: [PATCH 1/6] ovmf: update path to native BaseTools
 
 BaseTools is a set of utilities to build EDK-based firmware. These utilities
 are used during the build process. Thus, they need to be built natively.
@@ -11,7 +11,6 @@ with the appropriate location before building.
 
 Signed-off-by: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
 Upstream-Status: Pending
-
 ---
  OvmfPkg/build.sh | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
@@ -30,5 +29,5 @@ index 91b1442ade..1858dae31a 100755
    source edksetup.sh BaseTools
  else
 -- 
-2.28.0
+2.32.0
 
index c61a08f022f2f852882181cbaa8414d72e82a130..f6141c8af51cd3bc574c765ee05d318db358e569 100644 (file)
@@ -1,23 +1,22 @@
-From 667c0cf97dadc4f5994d26ec3984f559a05ec406 Mon Sep 17 00:00:00 2001
+From 19d4c7f9812062a683b3ba60b35aac0461190456 Mon Sep 17 00:00:00 2001
 From: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
 Date: Fri, 26 Jul 2019 17:34:26 -0400
-Subject: [PATCH 2/4] BaseTools: makefile: adjust to build in under bitbake
+Subject: [PATCH 2/6] BaseTools: makefile: adjust to build in under bitbake
 
 Prepend the build flags with those of bitbake. This is to build
 using the bitbake native sysroot include and library directories.
 
 Signed-off-by: Ricardo Neri <ricardo.neri@linux.intel.com>
 Upstream-Status: Pending
-
 ---
  BaseTools/Source/C/Makefiles/header.makefile | 17 +++++++++--------
  1 file changed, 9 insertions(+), 8 deletions(-)
 
 diff --git a/BaseTools/Source/C/Makefiles/header.makefile b/BaseTools/Source/C/Makefiles/header.makefile
-index 1c105ee7d4..d5eea3864e 100644
+index 0df728f327..1299d47c87 100644
 --- a/BaseTools/Source/C/Makefiles/header.makefile
 +++ b/BaseTools/Source/C/Makefiles/header.makefile
-@@ -69,35 +69,36 @@ $(error Bad HOST_ARCH)
+@@ -75,35 +75,36 @@ $(error Bad HOST_ARCH)
  endif\r
  \r
  INCLUDE = $(TOOL_INCLUDE) -I $(MAKEROOT) -I $(MAKEROOT)/Include/Common -I $(MAKEROOT)/Include/ -I $(MAKEROOT)/Include/IndustryStandard -I $(MAKEROOT)/Common/ -I .. -I . $(ARCH_INCLUDE)\r
@@ -63,5 +62,5 @@ index 1c105ee7d4..d5eea3864e 100644
  #\r
  # Snow Leopard  is a 32-bit and 64-bit environment. uname -m returns i386, but gcc defaults\r
 -- 
-2.28.0
+2.32.0
 
similarity index 91%
rename from meta/recipes-core/ovmf/ovmf/0004-ovmf-Update-to-latest.patch
rename to meta/recipes-core/ovmf/ovmf/0003-ovmf-Update-to-latest.patch
index 128438b201e00b2f027985f8679020fdfe459335..d710429899b8f3b0eed402e51f34f5547aeaae09 100644 (file)
@@ -1,7 +1,7 @@
-From ad06fcf1e08736e79221cd6863ff2e3c9254f261 Mon Sep 17 00:00:00 2001
+From 67267d8cc31df16a3608cad1a17c5f1470ef8bbd Mon Sep 17 00:00:00 2001
 From: Steve Langasek <steve.langasek@ubuntu.com>
 Date: Sat, 10 Jun 2017 01:39:36 -0700
-Subject: [PATCH 4/4] ovmf: Update to latest
+Subject: [PATCH 3/6] ovmf: Update to latest
 
 Description: pass -fno-stack-protector to all GCC toolchains
  The upstream build rules inexplicably pass -fno-stack-protector only
@@ -9,16 +9,15 @@ Description: pass -fno-stack-protector to all GCC toolchains
  generic rules for gcc 4.4 and later.
 Last-Updated: 2016-04-12
 Upstream-Status: Pending
-
 ---
  BaseTools/Conf/tools_def.template | 8 ++++----
  1 file changed, 4 insertions(+), 4 deletions(-)
 
 diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template
-index 933b3160fd..c2fbbf0c38 100755
+index 498696e583..36241b6ede 100755
 --- a/BaseTools/Conf/tools_def.template
 +++ b/BaseTools/Conf/tools_def.template
-@@ -1952,10 +1952,10 @@ DEFINE GCC_RISCV64_RC_FLAGS        = -I binary -O elf64-littleriscv   -B riscv
+@@ -1897,10 +1897,10 @@ DEFINE GCC_RISCV64_RC_FLAGS        = -I binary -O elf64-littleriscv   -B riscv
  # GCC Build Flag for included header file list generation\r
  DEFINE GCC_DEPS_FLAGS              = -MMD -MF $@.deps\r
  \r
@@ -32,7 +31,7 @@ index 933b3160fd..c2fbbf0c38 100755
  DEFINE GCC48_IA32_X64_ASLDLINK_FLAGS = DEF(GCC48_IA32_X64_DLINK_COMMON) -Wl,--entry,ReferenceAcpiTable -u ReferenceAcpiTable\r
  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\r
  DEFINE GCC48_IA32_DLINK2_FLAGS       = -Wl,--defsym=PECOFF_HEADER_SIZE=0x220 DEF(GCC_DLINK2_FLAGS_COMMON)\r
-@@ -1964,7 +1964,7 @@ DEFINE GCC48_X64_DLINK2_FLAGS        = -Wl,--defsym=PECOFF_HEADER_SIZE=0x228 DEF
+@@ -1909,7 +1909,7 @@ DEFINE GCC48_X64_DLINK2_FLAGS        = -Wl,--defsym=PECOFF_HEADER_SIZE=0x228 DEF
  DEFINE GCC48_ASM_FLAGS               = DEF(GCC_ASM_FLAGS)\r
  DEFINE GCC48_ARM_ASM_FLAGS           = $(ARCHASM_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_ASM_FLAGS) -mlittle-endian\r
  DEFINE GCC48_AARCH64_ASM_FLAGS       = $(ARCHASM_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_ASM_FLAGS) -mlittle-endian\r
@@ -42,5 +41,5 @@ index 933b3160fd..c2fbbf0c38 100755
  DEFINE GCC48_AARCH64_CC_FLAGS        = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -mcmodel=large DEF(GCC_AARCH64_CC_FLAGS)\r
  DEFINE GCC48_AARCH64_CC_XIPFLAGS     = DEF(GCC_AARCH64_CC_XIPFLAGS)\r
 -- 
-2.28.0
+2.32.0
 
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 (file)
index 0000000..dfb8a73
--- /dev/null
@@ -0,0 +1,32 @@
+From b7cfe97895e0586d14403ba98e62a0cd9373da96 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Mon, 14 Jun 2021 19:55:08 +0200
+Subject: [PATCH 4/6] Strip build paths
+
+Pass --zero to GenFw in release builds so that the sections that link back to
+the intermediate binaries (containing build paths) are removed.
+
+Upstream-Status: Pending (discussion at https://bugzilla.tianocore.org/show_bug.cgi?id=3256)
+Signed-off-by: Ross Burton <ross.burton@arm.com>
+
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ OvmfPkg/OvmfPkgIa32.dsc | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc
+index 33fbd76790..06c6d5ce60 100644
+--- a/OvmfPkg/OvmfPkgIa32.dsc
++++ b/OvmfPkg/OvmfPkgIa32.dsc
+@@ -91,6 +91,8 @@
\r
+ !include NetworkPkg/NetworkBuildOptions.dsc.inc\r
\r
++  RELEASE_*_*_GENFW_FLAGS = --zero\r
++\r
+ [BuildOptions.common.EDKII.DXE_RUNTIME_DRIVER]\r
+   GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000\r
+   XCODE:*_*_*_DLINK_FLAGS = -seg1addr 0x1000 -segalign 0x1000\r
+-- 
+2.32.0
+
similarity index 78%
rename from meta/recipes-core/ovmf/ovmf/debug_prefix_map.patch
rename to meta/recipes-core/ovmf/ovmf/0005-debug-prefix-map.patch
index 0165fae7ce234fa649b6ea86cb08d17efa214f3b..e467d6f1528a28efddae6e9d6fc6555af73020b1 100644 (file)
@@ -1,23 +1,31 @@
+From 860bb1979f3578bb83257076fe0f3bd33f9d68bf Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Mon, 14 Jun 2021 19:56:28 +0200
+Subject: [PATCH 5/6] debug prefix map
+
 We want to pass ${DEBUG_PREFIX_MAP} to gcc commands and also pass in
  --debug-prefix-map to nasm (we carry a patch to nasm for this). The
 tools definitions file is built by ovmf-native so we need to pass this in
 at target build time when we know the right values so we use the environment.
 
-By using determininistc file paths during the ovmf build, it removes the 
-opportunitity for gcc/ld to change the output binaries due to path lengths 
-overflowing section sizes and causing small changes in the binary output. 
+By using determininistc file paths during the ovmf build, it removes the
+opportunitity for gcc/ld to change the output binaries due to path lengths
+overflowing section sizes and causing small changes in the binary output.
 Previously we relied on the stripped output being the same which isn't always
 the case if the size of the debug symbols varies.
 
 Upstream-Status: Pending [gcc parts may be upstreamable, nasm patch isn't upstream yet]
 Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ BaseTools/Conf/tools_def.template | 18 +++++++++---------
+ 1 file changed, 9 insertions(+), 9 deletions(-)
 
-
-Index: git/BaseTools/Conf/tools_def.template
-===================================================================
---- git.orig/BaseTools/Conf/tools_def.template
-+++ git/BaseTools/Conf/tools_def.template
-@@ -1918,7 +1918,7 @@ NOOPT_*_*_OBJCOPY_ADDDEBUGFLAG     = --a
+diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template
+index 36241b6ede..947fbf2e8d 100755
+--- a/BaseTools/Conf/tools_def.template
++++ b/BaseTools/Conf/tools_def.template
+@@ -1863,7 +1863,7 @@ NOOPT_*_*_OBJCOPY_ADDDEBUGFLAG     = --add-gnu-debuglink=$(DEBUG_DIR)/$(MODULE_N
  *_*_*_DTCPP_PATH                   = DEF(DTCPP_BIN)\r
  *_*_*_DTC_PATH                     = DEF(DTC_BIN)\r
  \r
@@ -26,7 +34,7 @@ Index: git/BaseTools/Conf/tools_def.template
  DEFINE GCC_IA32_CC_FLAGS           = DEF(GCC_ALL_CC_FLAGS) -m32 -malign-double -freorder-blocks -freorder-blocks-and-partition -O2 -mno-stack-arg-probe\r
  DEFINE GCC_X64_CC_FLAGS            = DEF(GCC_ALL_CC_FLAGS) -mno-red-zone -Wno-address -mno-stack-arg-probe\r
  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\r
-@@ -1936,8 +1936,8 @@ DEFINE GCC_IA32_X64_ASLDLINK_FLAGS = -fu
+@@ -1881,8 +1881,8 @@ DEFINE GCC_IA32_X64_ASLDLINK_FLAGS = DEF(GCC_IA32_X64_DLINK_COMMON) --entry _Ref
  DEFINE GCC_ARM_ASLDLINK_FLAGS      = DEF(GCC_ARM_DLINK_FLAGS) -Wl,--entry,ReferenceAcpiTable -u $(IMAGE_ENTRY_POINT) DEF(GCC_ARM_AARCH64_ASLDLINK_FLAGS)\r
  DEFINE GCC_AARCH64_ASLDLINK_FLAGS  = DEF(GCC_AARCH64_DLINK_FLAGS) -Wl,--entry,ReferenceAcpiTable -u $(IMAGE_ENTRY_POINT) DEF(GCC_ARM_AARCH64_ASLDLINK_FLAGS)\r
  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\r
@@ -37,7 +45,7 @@ Index: git/BaseTools/Conf/tools_def.template
  DEFINE GCC_VFRPP_FLAGS             = -x c -E -P -DVFRCOMPILE --include $(MODULE_NAME)StrDefs.h\r
  DEFINE GCC_ASLPP_FLAGS             = -x c -E -include AutoGen.h\r
  DEFINE GCC_ASLCC_FLAGS             = -x c\r
-@@ -2082,7 +2082,7 @@ DEFINE GCC_PP_FLAGS
+@@ -2027,7 +2027,7 @@ DEFINE GCC_PP_FLAGS                        = -E -x assembler-with-cpp -include A
  *_GCC48_IA32_DLINK2_FLAGS         = DEF(GCC48_IA32_DLINK2_FLAGS)\r
  *_GCC48_IA32_RC_FLAGS             = DEF(GCC_IA32_RC_FLAGS)\r
  *_GCC48_IA32_OBJCOPY_FLAGS        =\r
@@ -46,7 +54,7 @@ Index: git/BaseTools/Conf/tools_def.template
  \r
    DEBUG_GCC48_IA32_CC_FLAGS       = DEF(GCC48_IA32_CC_FLAGS) -Os\r
  RELEASE_GCC48_IA32_CC_FLAGS       = DEF(GCC48_IA32_CC_FLAGS) -Os -Wno-unused-but-set-variable\r
-@@ -2110,7 +2110,7 @@ RELEASE_GCC48_IA32_CC_FLAGS       = DEF(
+@@ -2055,7 +2055,7 @@ RELEASE_GCC48_IA32_CC_FLAGS       = DEF(GCC48_IA32_CC_FLAGS) -Os -Wno-unused-but
  *_GCC48_X64_DLINK2_FLAGS         = DEF(GCC48_X64_DLINK2_FLAGS)\r
  *_GCC48_X64_RC_FLAGS             = DEF(GCC_X64_RC_FLAGS)\r
  *_GCC48_X64_OBJCOPY_FLAGS        =\r
@@ -55,7 +63,7 @@ Index: git/BaseTools/Conf/tools_def.template
  \r
    DEBUG_GCC48_X64_CC_FLAGS       = DEF(GCC48_X64_CC_FLAGS) -Os\r
  RELEASE_GCC48_X64_CC_FLAGS       = DEF(GCC48_X64_CC_FLAGS) -Os -Wno-unused-but-set-variable\r
-@@ -2222,7 +2222,7 @@ RELEASE_GCC48_AARCH64_CC_FLAGS   = DEF(G
+@@ -2167,7 +2167,7 @@ RELEASE_GCC48_AARCH64_CC_FLAGS   = DEF(GCC48_AARCH64_CC_FLAGS) -Wno-unused-but-s
  *_GCC49_IA32_DLINK2_FLAGS         = DEF(GCC49_IA32_DLINK2_FLAGS)\r
  *_GCC49_IA32_RC_FLAGS             = DEF(GCC_IA32_RC_FLAGS)\r
  *_GCC49_IA32_OBJCOPY_FLAGS        =\r
@@ -64,7 +72,7 @@ Index: git/BaseTools/Conf/tools_def.template
  \r
    DEBUG_GCC49_IA32_CC_FLAGS       = DEF(GCC49_IA32_CC_FLAGS) -Os\r
  RELEASE_GCC49_IA32_CC_FLAGS       = DEF(GCC49_IA32_CC_FLAGS) -Os -Wno-unused-but-set-variable -Wno-unused-const-variable\r
-@@ -2250,7 +2250,7 @@ RELEASE_GCC49_IA32_CC_FLAGS       = DEF(
+@@ -2195,7 +2195,7 @@ RELEASE_GCC49_IA32_CC_FLAGS       = DEF(GCC49_IA32_CC_FLAGS) -Os -Wno-unused-but
  *_GCC49_X64_DLINK2_FLAGS         = DEF(GCC49_X64_DLINK2_FLAGS)\r
  *_GCC49_X64_RC_FLAGS             = DEF(GCC_X64_RC_FLAGS)\r
  *_GCC49_X64_OBJCOPY_FLAGS        =\r
@@ -73,7 +81,7 @@ Index: git/BaseTools/Conf/tools_def.template
  \r
    DEBUG_GCC49_X64_CC_FLAGS       = DEF(GCC49_X64_CC_FLAGS) -Os\r
  RELEASE_GCC49_X64_CC_FLAGS       = DEF(GCC49_X64_CC_FLAGS) -Os -Wno-unused-but-set-variable -Wno-unused-const-variable\r
-@@ -2368,7 +2368,7 @@ RELEASE_GCC49_AARCH64_DLINK_XIPFLAGS = -
+@@ -2313,7 +2313,7 @@ RELEASE_GCC49_AARCH64_DLINK_XIPFLAGS = -z common-page-size=0x20
  *_GCC5_IA32_DLINK2_FLAGS         = DEF(GCC5_IA32_DLINK2_FLAGS) -no-pie\r
  *_GCC5_IA32_RC_FLAGS             = DEF(GCC_IA32_RC_FLAGS)\r
  *_GCC5_IA32_OBJCOPY_FLAGS        =\r
@@ -82,7 +90,7 @@ Index: git/BaseTools/Conf/tools_def.template
  \r
    DEBUG_GCC5_IA32_CC_FLAGS       = DEF(GCC5_IA32_CC_FLAGS) -flto -Os\r
    DEBUG_GCC5_IA32_DLINK_FLAGS    = DEF(GCC5_IA32_X64_DLINK_FLAGS) -flto -Os -Wl,-m,elf_i386,--oformat=elf32-i386\r
-@@ -2400,7 +2400,7 @@ RELEASE_GCC5_IA32_DLINK_FLAGS    = DEF(G
+@@ -2345,7 +2345,7 @@ RELEASE_GCC5_IA32_DLINK_FLAGS    = DEF(GCC5_IA32_X64_DLINK_FLAGS) -flto -Os -Wl,
  *_GCC5_X64_DLINK2_FLAGS          = DEF(GCC5_X64_DLINK2_FLAGS)\r
  *_GCC5_X64_RC_FLAGS              = DEF(GCC_X64_RC_FLAGS)\r
  *_GCC5_X64_OBJCOPY_FLAGS         =\r
@@ -91,3 +99,6 @@ Index: git/BaseTools/Conf/tools_def.template
  \r
    DEBUG_GCC5_X64_CC_FLAGS        = DEF(GCC5_X64_CC_FLAGS) -flto -DUSING_LTO -Os\r
    DEBUG_GCC5_X64_DLINK_FLAGS     = DEF(GCC5_X64_DLINK_FLAGS) -flto -Os\r
+-- 
+2.32.0
+
similarity index 76%
rename from meta/recipes-core/ovmf/ovmf/reproducible.patch
rename to meta/recipes-core/ovmf/ovmf/0006-reproducible.patch
index 5d2aeaacfe5640e673cf3bae110eef3e28c30b42..343c21b541c14d951448f47f2e3d9d6b6667c25b 100644 (file)
@@ -1,3 +1,8 @@
+From 27ed9962f5cb3afcc44d6c96c53277132a999712 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Mon, 14 Jun 2021 19:57:30 +0200
+Subject: [PATCH 6/6] reproducible
+
 This patch fixes various things which make the build more reproducible. Some changes
 here only change intermediate artefacts but that means when you have two build trees
 giving 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
 The patch specifically:
 
  * Sorts output in GNUmakefile
- * Always generates indirect flags files used to avoid pathlength issues else the 
+ * Always generates indirect flags files used to avoid pathlength issues else the
    compile commands suddenly change when using longer paths
  * Sorts the AutoGenTimeStamp file contents
  * Makes the TargetDescBlock objects from BuildEngine sortable to allow the makefile fix
- * Fix ElfConvert within GenFw so that only the basename of the binary being converted 
+ * Fix ElfConvert within GenFw so that only the basename of the binary being converted
    is used, else the output from "GenFw XXX.bin" differs from "GenFw /long/path/XXX.bin"
    with sufficiently long paths
 
 Upstream-Status: Pending [At least some of this might be interesting to upstream]
 Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ BaseTools/Source/C/GenFw/Elf64Convert.c       |  8 ++++---
+ .../Source/Python/AutoGen/BuildEngine.py      |  3 +++
+ BaseTools/Source/Python/AutoGen/GenMake.py    | 24 +++++++++----------
+ .../Source/Python/AutoGen/ModuleAutoGen.py    |  5 +++-
+ 4 files changed, 24 insertions(+), 16 deletions(-)
 
-Index: git/BaseTools/Source/Python/AutoGen/GenMake.py
-===================================================================
---- git.orig/BaseTools/Source/Python/AutoGen/GenMake.py
-+++ git/BaseTools/Source/Python/AutoGen/GenMake.py
-@@ -571,7 +571,7 @@ cleanlib:
+diff --git a/BaseTools/Source/C/GenFw/Elf64Convert.c b/BaseTools/Source/C/GenFw/Elf64Convert.c
+index d097db8632..a87ae6f3d0 100644
+--- a/BaseTools/Source/C/GenFw/Elf64Convert.c
++++ b/BaseTools/Source/C/GenFw/Elf64Convert.c
+@@ -14,6 +14,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
+ #ifndef __GNUC__\r
+ #include <windows.h>\r
+ #include <io.h>\r
++#else\r
++#define _GNU_SOURCE\r
+ #endif\r
+ #include <assert.h>\r
+ #include <stdio.h>\r
+@@ -769,7 +771,7 @@ ScanSections64 (
+   }\r
+   mCoffOffset = mDebugOffset + sizeof(EFI_IMAGE_DEBUG_DIRECTORY_ENTRY) +\r
+                 sizeof(EFI_IMAGE_DEBUG_CODEVIEW_NB10_ENTRY) +\r
+-                strlen(mInImageName) + 1;\r
++                strlen(basename(mInImageName)) + 1;\r
\r
+   mCoffOffset = CoffAlign(mCoffOffset);\r
+   if (SectionCount == 0) {\r
+@@ -1608,7 +1610,7 @@ WriteDebug64 (
+   EFI_IMAGE_DEBUG_DIRECTORY_ENTRY     *Dir;\r
+   EFI_IMAGE_DEBUG_CODEVIEW_NB10_ENTRY *Nb10;\r
\r
+-  Len = strlen(mInImageName) + 1;\r
++  Len = strlen(basename(mInImageName)) + 1;\r
\r
+   Dir = (EFI_IMAGE_DEBUG_DIRECTORY_ENTRY*)(mCoffFile + mDebugOffset);\r
+   Dir->Type = EFI_IMAGE_DEBUG_TYPE_CODEVIEW;\r
+@@ -1618,7 +1620,7 @@ WriteDebug64 (
\r
+   Nb10 = (EFI_IMAGE_DEBUG_CODEVIEW_NB10_ENTRY*)(Dir + 1);\r
+   Nb10->Signature = CODEVIEW_SIGNATURE_NB10;\r
+-  strcpy ((char *)(Nb10 + 1), mInImageName);\r
++  strcpy ((char *)(Nb10 + 1), basename(mInImageName));\r
\r
\r
+   NtHdr = (EFI_IMAGE_OPTIONAL_HEADER_UNION *)(mCoffFile + mNtHdrOffset);\r
+diff --git a/BaseTools/Source/Python/AutoGen/BuildEngine.py b/BaseTools/Source/Python/AutoGen/BuildEngine.py
+index 722fead75a..8f1c236970 100644
+--- a/BaseTools/Source/Python/AutoGen/BuildEngine.py
++++ b/BaseTools/Source/Python/AutoGen/BuildEngine.py
+@@ -70,6 +70,9 @@ class TargetDescBlock(object):
+         else:\r
+             return str(Other) == self.Target.Path\r
\r
++    def __lt__(self, other):\r
++        return str(self) < str(other)\r
++\r
+     def AddInput(self, Input):\r
+         if Input not in self.Inputs:\r
+             self.Inputs.append(Input)\r
+diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py b/BaseTools/Source/Python/AutoGen/GenMake.py
+index 961b2ab1c3..23c1592025 100755
+--- a/BaseTools/Source/Python/AutoGen/GenMake.py
++++ b/BaseTools/Source/Python/AutoGen/GenMake.py
+@@ -575,7 +575,7 @@ cleanlib:
                  os.remove(RespFileList)\r
  \r
          # convert source files and binary files to build targets\r
@@ -35,7 +101,7 @@ Index: git/BaseTools/Source/Python/AutoGen/GenMake.py
          if len(self.ResultFileList) == 0 and len(MyAgo.SourceFileList) != 0:\r
              EdkLogger.error("build", AUTOGEN_ERROR, "Nothing to build",\r
                              ExtraData="[%s]" % str(MyAgo))\r
-@@ -722,7 +722,7 @@ cleanlib:
+@@ -726,7 +726,7 @@ cleanlib:
          OutputFile = ''\r
          DepsFileList = []\r
  \r
@@ -44,7 +110,7 @@ Index: git/BaseTools/Source/Python/AutoGen/GenMake.py
              if Cmd[2]:\r
                  for CopyCmd in Cmd[2]:\r
                      Src, Dst = CopyCmd\r
-@@ -755,7 +755,7 @@ cleanlib:
+@@ -759,7 +759,7 @@ cleanlib:
              self.BuildTargetList.append('\t%s' % CmdString)\r
  \r
              self.ParseSecCmd(DepsFileList, Cmd[1])\r
@@ -53,7 +119,7 @@ Index: git/BaseTools/Source/Python/AutoGen/GenMake.py
                  self.BuildTargetList.append('%s : %s' % (self.ReplaceMacro(SecOutputFile), self.ReplaceMacro(SecDepsFile)))\r
                  self.BuildTargetList.append('\t%s' % self.ReplaceMacro(SecCmd))\r
              self.FfsOutputFileList = []\r
-@@ -794,13 +794,13 @@ cleanlib:
+@@ -798,13 +798,13 @@ cleanlib:
  \r
      def CommandExceedLimit(self):\r
          FlagDict = {\r
@@ -74,7 +140,7 @@ Index: git/BaseTools/Source/Python/AutoGen/GenMake.py
                     }\r
  \r
          RespDict = {}\r
-@@ -1003,9 +1003,9 @@ cleanlib:
+@@ -1007,9 +1007,9 @@ cleanlib:
                  if not self.ObjTargetDict.get(T.Target.SubDir):\r
                      self.ObjTargetDict[T.Target.SubDir] = set()\r
                  self.ObjTargetDict[T.Target.SubDir].add(NewFile)\r
@@ -86,10 +152,10 @@ Index: git/BaseTools/Source/Python/AutoGen/GenMake.py
                  # Generate related macros if needed\r
                  if T.GenFileListMacro and T.FileListMacro not in self.FileListMacros:\r
                      self.FileListMacros[T.FileListMacro] = []\r
-Index: git/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py
-===================================================================
---- git.orig/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py
-+++ git/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py
+diff --git a/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py b/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py
+index d70b0d7ae8..25dca9a6df 100755
+--- a/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py
++++ b/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py
 @@ -1484,6 +1484,9 @@ class ModuleAutoGen(AutoGen):
              for File in Files:\r
                  if File.lower().endswith('.pdb'):\r
@@ -109,57 +175,6 @@ Index: git/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py
  \r
          # Ignore generating makefile when it is a binary module\r
          if self.IsBinaryModule:\r
-Index: git/BaseTools/Source/Python/AutoGen/BuildEngine.py
-===================================================================
---- git.orig/BaseTools/Source/Python/AutoGen/BuildEngine.py
-+++ git/BaseTools/Source/Python/AutoGen/BuildEngine.py
-@@ -70,6 +70,9 @@ class TargetDescBlock(object):
-         else:\r
-             return str(Other) == self.Target.Path\r
\r
-+    def __lt__(self, other):\r
-+        return str(self) < str(other)\r
-+\r
-     def AddInput(self, Input):\r
-         if Input not in self.Inputs:\r
-             self.Inputs.append(Input)\r
-Index: git/BaseTools/Source/C/GenFw/Elf64Convert.c
-===================================================================
---- git.orig/BaseTools/Source/C/GenFw/Elf64Convert.c
-+++ git/BaseTools/Source/C/GenFw/Elf64Convert.c
-@@ -14,6 +14,8 @@ SPDX-License-Identifier: BSD-2-Clause-Pa
- #ifndef __GNUC__\r
- #include <windows.h>\r
- #include <io.h>\r
-+#else\r
-+#define _GNU_SOURCE\r
- #endif\r
- #include <assert.h>\r
- #include <stdio.h>\r
-@@ -770,7 +772,7 @@ ScanSections64 (
-   }\r
-   mCoffOffset = mDebugOffset + sizeof(EFI_IMAGE_DEBUG_DIRECTORY_ENTRY) +\r
-                 sizeof(EFI_IMAGE_DEBUG_CODEVIEW_NB10_ENTRY) +\r
--                strlen(mInImageName) + 1;\r
-+                strlen(basename(mInImageName)) + 1;\r
\r
-   mCoffOffset = CoffAlign(mCoffOffset);\r
-   if (SectionCount == 0) {\r
-@@ -1609,7 +1611,7 @@ WriteDebug64 (
-   EFI_IMAGE_DEBUG_DIRECTORY_ENTRY     *Dir;\r
-   EFI_IMAGE_DEBUG_CODEVIEW_NB10_ENTRY *Nb10;\r
\r
--  Len = strlen(mInImageName) + 1;\r
-+  Len = strlen(basename(mInImageName)) + 1;\r
\r
-   Dir = (EFI_IMAGE_DEBUG_DIRECTORY_ENTRY*)(mCoffFile + mDebugOffset);\r
-   Dir->Type = EFI_IMAGE_DEBUG_TYPE_CODEVIEW;\r
-@@ -1619,7 +1621,7 @@ WriteDebug64 (
\r
-   Nb10 = (EFI_IMAGE_DEBUG_CODEVIEW_NB10_ENTRY*)(Dir + 1);\r
-   Nb10->Signature = CODEVIEW_SIGNATURE_NB10;\r
--  strcpy ((char *)(Nb10 + 1), mInImageName);\r
-+  strcpy ((char *)(Nb10 + 1), basename(mInImageName));\r
\r
\r
-   NtHdr = (EFI_IMAGE_OPTIONAL_HEADER_UNION *)(mCoffFile + mNtHdrOffset);\r
+-- 
+2.32.0
+
diff --git a/meta/recipes-core/ovmf/ovmf/zero.patch b/meta/recipes-core/ovmf/ovmf/zero.patch
deleted file mode 100644 (file)
index af7a9d3..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-Pass --zero to GenFw in release builds so that the sections that link back to
-the intermediate binaries (containing build paths) are removed.
-
-Upstream-Status: Pending (discussion at https://bugzilla.tianocore.org/show_bug.cgi?id=3256)
-Signed-off-by: Ross Burton <ross.burton@arm.com>
-
-From 6303b065802c9427c718fda129360189b79316e7 Mon Sep 17 00:00:00 2001
-From: Ross Burton <ross.burton@arm.com>
-Date: Tue, 16 Mar 2021 16:49:49 +0000
-Subject: [PATCH] Strip build paths
-
----
- OvmfPkg/AmdSev/AmdSevX64.dsc | 1 +
- OvmfPkg/Bhyve/BhyveX64.dsc   | 1 +
- OvmfPkg/OvmfPkgIa32.dsc      | 2 ++
- OvmfPkg/OvmfPkgIa32X64.dsc   | 1 +
- OvmfPkg/OvmfPkgX64.dsc       | 1 +
- OvmfPkg/OvmfXen.dsc          | 1 +
- 6 files changed, 7 insertions(+)
-
-diff --git a/OvmfPkg/Bhyve/BhyveX64.dsc b/OvmfPkg/Bhyve/BhyveX64.dsc
-index 4a1cdf5aca..132f55cf69 100644
---- a/OvmfPkg/Bhyve/BhyveX64.dsc
-+++ b/OvmfPkg/Bhyve/BhyveX64.dsc
-@@ -76,6 +76,7 @@\r
-   GCC:*_*_X64_GENFW_FLAGS   = --keepexceptiontable\r
-   INTEL:*_*_X64_GENFW_FLAGS = --keepexceptiontable\r
- !endif\r
-+  RELEASE_*_*_GENFW_FLAGS = --zero\r
\r
-   #\r
-   # Disable deprecated APIs.\r
-diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc
-index 1eaf3e99c6..ce20f09df8 100644
---- a/OvmfPkg/OvmfPkgIa32.dsc
-+++ b/OvmfPkg/OvmfPkgIa32.dsc
-@@ -90,6 +90,8 @@\r
\r
- !include NetworkPkg/NetworkBuildOptions.dsc.inc\r
\r
-+  RELEASE_*_*_GENFW_FLAGS = --zero\r
-+\r
- [BuildOptions.common.EDKII.DXE_RUNTIME_DRIVER]\r
-   GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000\r
-   XCODE:*_*_*_DLINK_FLAGS = -seg1addr 0x1000 -segalign 0x1000\r
-diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc
-index 4a5a430147..97cc438250 100644
---- a/OvmfPkg/OvmfPkgIa32X64.dsc
-+++ b/OvmfPkg/OvmfPkgIa32X64.dsc
-@@ -84,6 +84,7 @@\r
-   GCC:*_*_X64_GENFW_FLAGS   = --keepexceptiontable\r
-   INTEL:*_*_X64_GENFW_FLAGS = --keepexceptiontable\r
- !endif\r
-+  RELEASE_*_*_GENFW_FLAGS = --zero\r
\r
-   #\r
-   # Disable deprecated APIs.\r
-diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc
-index d4d601b444..f544fb04bf 100644
---- a/OvmfPkg/OvmfPkgX64.dsc
-+++ b/OvmfPkg/OvmfPkgX64.dsc
-@@ -84,6 +84,7 @@\r
-   GCC:*_*_X64_GENFW_FLAGS   = --keepexceptiontable\r
-   INTEL:*_*_X64_GENFW_FLAGS = --keepexceptiontable\r
- !endif\r
-+  RELEASE_*_*_GENFW_FLAGS = --zero\r
\r
-   #\r
-   # Disable deprecated APIs.\r
-diff --git a/OvmfPkg/OvmfXen.dsc b/OvmfPkg/OvmfXen.dsc
-index 507029404f..fcaa35acf1 100644
---- a/OvmfPkg/OvmfXen.dsc
-+++ b/OvmfPkg/OvmfXen.dsc
-@@ -74,6 +74,7 @@\r
-   GCC:*_*_X64_GENFW_FLAGS   = --keepexceptiontable\r
-   INTEL:*_*_X64_GENFW_FLAGS = --keepexceptiontable\r
- !endif\r
-+  RELEASE_*_*_GENFW_FLAGS = --zero\r
\r
-   #\r
-   # Disable deprecated APIs.\r
--- 
-2.25.1
-
index 888ea082ecd1f1e51b7c700eed6534d680a9b4a1..90dae2aed032ae48f69bd6d86a671bd665b9fbc2 100644 (file)
@@ -15,15 +15,15 @@ PACKAGECONFIG[secureboot] = ",,,"
 SRC_URI = "gitsm://github.com/tianocore/edk2.git;branch=master;protocol=https \
            file://0001-ovmf-update-path-to-native-BaseTools.patch \
            file://0002-BaseTools-makefile-adjust-to-build-in-under-bitbake.patch \
-           file://0004-ovmf-Update-to-latest.patch \
-           file://zero.patch \
-           file://debug_prefix_map.patch \
-           file://reproducible.patch \
+           file://0003-ovmf-Update-to-latest.patch \
+           file://0004-Strip-build-paths.patch \
+           file://0005-debug-prefix-map.patch \
+           file://0006-reproducible.patch \
            file://0001-Fix-VLA-parameter-warning.patch \
            "
 
-PV = "edk2-stable202102"
-SRCREV = "ef91b07388e1c0a50c604e5350eeda98428ccea6"
+PV = "edk2-stable202105"
+SRCREV = "e1999b264f1f9d7230edf2448f757c73da567832"
 UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>edk2-stable.*)"
 
 inherit deploy