diff options
5 files changed, 72 insertions, 60 deletions
diff --git a/meta/recipes-core/ovmf/ovmf/0001-MdeModulePkg-UefiHiiLib-Fix-incorrect-comparison-exp.patch b/meta/recipes-core/ovmf/ovmf/0001-MdeModulePkg-UefiHiiLib-Fix-incorrect-comparison-exp.patch deleted file mode 100644 index 0529a27b16..0000000000 --- a/meta/recipes-core/ovmf/ovmf/0001-MdeModulePkg-UefiHiiLib-Fix-incorrect-comparison-exp.patch +++ /dev/null | |||
@@ -1,45 +0,0 @@ | |||
1 | From 73692710d50da1f421b0e6ddff784ca3135389b3 Mon Sep 17 00:00:00 2001 | ||
2 | From: Dandan Bi <dandan.bi@intel.com> | ||
3 | Date: Sat, 1 Apr 2017 10:31:14 +0800 | ||
4 | Subject: [PATCH] MdeModulePkg/UefiHiiLib:Fix incorrect comparison expression | ||
5 | |||
6 | Fix the incorrect comparison between pointer and constant zero character. | ||
7 | |||
8 | https://bugzilla.tianocore.org/show_bug.cgi?id=416 | ||
9 | |||
10 | V2: The pointer StringPtr points to a string returned | ||
11 | by ExtractConfig/ExportConfig, if it is NULL, function | ||
12 | InternalHiiIfrValueAction will return FALSE. So in | ||
13 | current usage model, the StringPtr can not be NULL before | ||
14 | using it, so we can add ASSERT here. | ||
15 | |||
16 | Cc: Eric Dong <eric.dong@intel.com> | ||
17 | Cc: Liming Gao <liming.gao@intel.com> | ||
18 | Contributed-under: TianoCore Contribution Agreement 1.0 | ||
19 | Signed-off-by: Dandan Bi <dandan.bi@intel.com> | ||
20 | Reviewed-by: Eric Dong <eric.dong@intel.com> | ||
21 | --- | ||
22 | Upstream-Status: Backport | ||
23 | |||
24 | MdeModulePkg/Library/UefiHiiLib/HiiLib.c | 5 +++-- | ||
25 | 1 file changed, 3 insertions(+), 2 deletions(-) | ||
26 | |||
27 | diff --git a/MdeModulePkg/Library/UefiHiiLib/HiiLib.c b/MdeModulePkg/Library/UefiHiiLib/HiiLib.c | ||
28 | index 8579501..46ca7bc 100644 | ||
29 | --- a/MdeModulePkg/Library/UefiHiiLib/HiiLib.c | ||
30 | +++ b/MdeModulePkg/Library/UefiHiiLib/HiiLib.c | ||
31 | @@ -2180,8 +2180,9 @@ InternalHiiIfrValueAction ( | ||
32 | } | ||
33 | |||
34 | StringPtr = ConfigAltResp; | ||
35 | - | ||
36 | - while (StringPtr != L'\0') { | ||
37 | + ASSERT (StringPtr != NULL); | ||
38 | + | ||
39 | + while (*StringPtr != L'\0') { | ||
40 | // | ||
41 | // 1. Find <ConfigHdr> GUID=...&NAME=...&PATH=... | ||
42 | // | ||
43 | -- | ||
44 | 1.9.1 | ||
45 | |||
diff --git a/meta/recipes-core/ovmf/ovmf/0001-ia32-Dont-use-pie.patch b/meta/recipes-core/ovmf/ovmf/0001-ia32-Dont-use-pie.patch new file mode 100644 index 0000000000..7ce20be54c --- /dev/null +++ b/meta/recipes-core/ovmf/ovmf/0001-ia32-Dont-use-pie.patch | |||
@@ -0,0 +1,37 @@ | |||
1 | From f65e9cc025278387b494c2383c5d9ff3bed98687 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Sun, 11 Jun 2017 00:47:24 -0700 | ||
4 | Subject: [PATCH] ia32: Dont use -pie | ||
5 | |||
6 | Upstream-Status: Pending | ||
7 | |||
8 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
9 | --- | ||
10 | BaseTools/Conf/tools_def.template | 4 ++-- | ||
11 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
12 | |||
13 | diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template | ||
14 | index 04a1bcb210..84c5f84f93 100755 | ||
15 | --- a/BaseTools/Conf/tools_def.template | ||
16 | +++ b/BaseTools/Conf/tools_def.template | ||
17 | @@ -4336,7 +4336,7 @@ RELEASE_*_*_OBJCOPY_ADDDEBUGFLAG = | ||
18 | NOOPT_*_*_OBJCOPY_ADDDEBUGFLAG = --add-gnu-debuglink=$(DEBUG_DIR)/$(MODULE_NAME).debug | ||
19 | |||
20 | DEFINE GCC_ALL_CC_FLAGS = -g -Os -fshort-wchar -fno-builtin -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -include AutoGen.h -fno-common | ||
21 | -DEFINE GCC_IA32_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -m32 -malign-double -freorder-blocks -freorder-blocks-and-partition -O2 -mno-stack-arg-probe | ||
22 | +DEFINE GCC_IA32_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -m32 -malign-double -freorder-blocks -freorder-blocks-and-partition -O2 -mno-stack-arg-probe -fno-PIE -no-pie | ||
23 | DEFINE GCC_X64_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -mno-red-zone -Wno-address -mno-stack-arg-probe | ||
24 | DEFINE GCC_IPF_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -minline-int-divide-min-latency | ||
25 | 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 | ||
26 | @@ -4369,7 +4369,7 @@ DEFINE GCC_ARM_RC_FLAGS = -I binary -O elf32-littlearm -B arm | ||
27 | DEFINE GCC_AARCH64_RC_FLAGS = -I binary -O elf64-littleaarch64 -B aarch64 --rename-section .data=.hii | ||
28 | |||
29 | DEFINE GCC44_ALL_CC_FLAGS = -g -fshort-wchar -fno-builtin -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -ffunction-sections -fdata-sections -include AutoGen.h -fno-common -DSTRING_ARRAY_NAME=$(BASE_NAME)Strings | ||
30 | -DEFINE GCC44_IA32_CC_FLAGS = DEF(GCC44_ALL_CC_FLAGS) -m32 -march=i586 -malign-double -fno-stack-protector -D EFI32 -fno-asynchronous-unwind-tables | ||
31 | +DEFINE GCC44_IA32_CC_FLAGS = DEF(GCC44_ALL_CC_FLAGS) -m32 -march=i586 -malign-double -fno-stack-protector -D EFI32 -fno-asynchronous-unwind-tables -fno-PIE -no-pie | ||
32 | DEFINE GCC44_X64_CC_FLAGS = DEF(GCC44_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 | ||
33 | DEFINE GCC44_IA32_X64_DLINK_COMMON = -nostdlib -Wl,-n,-q,--gc-sections -z common-page-size=0x20 | ||
34 | DEFINE GCC44_IA32_X64_ASLDLINK_FLAGS = DEF(GCC44_IA32_X64_DLINK_COMMON) -Wl,--entry,ReferenceAcpiTable -u ReferenceAcpiTable | ||
35 | -- | ||
36 | 2.13.1 | ||
37 | |||
diff --git a/meta/recipes-core/ovmf/ovmf/0003-BaseTools-makefile-adjust-to-build-in-under-bitbake.patch b/meta/recipes-core/ovmf/ovmf/0003-BaseTools-makefile-adjust-to-build-in-under-bitbake.patch index 0fdc278ce2..1f8332ef56 100644 --- a/meta/recipes-core/ovmf/ovmf/0003-BaseTools-makefile-adjust-to-build-in-under-bitbake.patch +++ b/meta/recipes-core/ovmf/ovmf/0003-BaseTools-makefile-adjust-to-build-in-under-bitbake.patch | |||
@@ -11,29 +11,28 @@ Signed-off-by: Ricardo Neri <ricardo.neri@linux.intel.com> | |||
11 | BaseTools/Source/C/Makefiles/header.makefile | 8 ++++---- | 11 | BaseTools/Source/C/Makefiles/header.makefile | 8 ++++---- |
12 | 1 file changed, 4 insertions(+), 4 deletions(-) | 12 | 1 file changed, 4 insertions(+), 4 deletions(-) |
13 | 13 | ||
14 | diff --git a/BaseTools/Source/C/Makefiles/header.makefile b/BaseTools/Source/C/Makefiles/header.makefile | 14 | Index: git/BaseTools/Source/C/Makefiles/header.makefile |
15 | index 821d114..fe0f08b 100644 | 15 | =================================================================== |
16 | --- a/BaseTools/Source/C/Makefiles/header.makefile | 16 | --- git.orig/BaseTools/Source/C/Makefiles/header.makefile |
17 | +++ b/BaseTools/Source/C/Makefiles/header.makefile | 17 | +++ git/BaseTools/Source/C/Makefiles/header.makefile |
18 | @@ -44,14 +44,14 @@ ARCH_INCLUDE = -I $(MAKEROOT)/Include/AArch64/ | 18 | @@ -44,15 +44,15 @@ ARCH_INCLUDE = -I $(MAKEROOT)/Include/AA |
19 | endif | 19 | endif |
20 | 20 | ||
21 | INCLUDE = $(TOOL_INCLUDE) -I $(MAKEROOT) -I $(MAKEROOT)/Include/Common -I $(MAKEROOT)/Include/ -I $(MAKEROOT)/Include/IndustryStandard -I $(MAKEROOT)/Common/ -I .. -I . $(ARCH_INCLUDE) | 21 | INCLUDE = $(TOOL_INCLUDE) -I $(MAKEROOT) -I $(MAKEROOT)/Include/Common -I $(MAKEROOT)/Include/ -I $(MAKEROOT)/Include/IndustryStandard -I $(MAKEROOT)/Common/ -I .. -I . $(ARCH_INCLUDE) |
22 | -BUILD_CPPFLAGS = $(INCLUDE) -O2 | 22 | -BUILD_CPPFLAGS = $(INCLUDE) -O2 |
23 | +BUILD_CPPFLAGS := $(BUILD_CPPFLAGS) $(INCLUDE) -O2 | 23 | +BUILD_CPPFLAGS += $(INCLUDE) -O2 |
24 | ifeq ($(DARWIN),Darwin) | 24 | ifeq ($(DARWIN),Darwin) |
25 | # assume clang or clang compatible flags on OS X | 25 | # assume clang or clang compatible flags on OS X |
26 | -BUILD_CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-self-assign -Wno-unused-result -nostdlib -c -g | 26 | -BUILD_CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-self-assign -Wno-unused-result -nostdlib -c -g |
27 | +BUILD_CFLAGS := $(BUILD_CFLAGS) -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-self-assign -Wno-unused-result -nostdlib -c -g | 27 | +BUILD_CFLAGS += -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-self-assign -Wno-unused-result -nostdlib -c -g |
28 | else | 28 | else |
29 | -BUILD_CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g | 29 | -BUILD_CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g |
30 | +BUILD_CFLAGS := $(BUILD_CFLAGS) -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g | 30 | +BUILD_CFLAGS += -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-unused-result -nostdlib -c -g |
31 | endif | 31 | endif |
32 | -BUILD_LFLAGS = | 32 | -BUILD_LFLAGS = |
33 | +BUILD_LFLAGS := $(LDFLAGS) | 33 | -BUILD_CXXFLAGS = -Wno-unused-result |
34 | BUILD_CXXFLAGS = | 34 | +BUILD_LFLAGS = $(LDFLAGS) |
35 | +BUILD_CXXFLAGS += -Wno-unused-result | ||
35 | 36 | ||
36 | ifeq ($(ARCH), IA32) | 37 | ifeq ($(ARCH), IA32) |
37 | -- | 38 | # |
38 | 2.9.3 | ||
39 | |||
diff --git a/meta/recipes-core/ovmf/ovmf/no-stack-protector-all-archs.patch b/meta/recipes-core/ovmf/ovmf/no-stack-protector-all-archs.patch new file mode 100644 index 0000000000..25a09c5ce3 --- /dev/null +++ b/meta/recipes-core/ovmf/ovmf/no-stack-protector-all-archs.patch | |||
@@ -0,0 +1,19 @@ | |||
1 | Author: Steve Langasek <steve.langasek@ubuntu.com> | ||
2 | Description: pass -fno-stack-protector to all GCC toolchains | ||
3 | The upstream build rules inexplicably pass -fno-stack-protector only | ||
4 | when building for i386 and amd64. Add this essential argument to the | ||
5 | generic rules for gcc 4.4 and later. | ||
6 | Last-Updated: 2016-04-12 | ||
7 | Index: git/BaseTools/Conf/tools_def.template | ||
8 | =================================================================== | ||
9 | --- git.orig/BaseTools/Conf/tools_def.template | ||
10 | +++ git/BaseTools/Conf/tools_def.template | ||
11 | @@ -4368,7 +4368,7 @@ DEFINE GCC_IPF_RC_FLAGS = -I | ||
12 | DEFINE GCC_ARM_RC_FLAGS = -I binary -O elf32-littlearm -B arm --rename-section .data=.hii | ||
13 | DEFINE GCC_AARCH64_RC_FLAGS = -I binary -O elf64-littleaarch64 -B aarch64 --rename-section .data=.hii | ||
14 | |||
15 | -DEFINE GCC44_ALL_CC_FLAGS = -g -fshort-wchar -fno-builtin -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -ffunction-sections -fdata-sections -include AutoGen.h -fno-common -DSTRING_ARRAY_NAME=$(BASE_NAME)Strings | ||
16 | +DEFINE GCC44_ALL_CC_FLAGS = -g -fshort-wchar -fno-builtin -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -ffunction-sections -fdata-sections -fno-stack-protector -include AutoGen.h -fno-common -DSTRING_ARRAY_NAME=$(BASE_NAME)Strings | ||
17 | DEFINE GCC44_IA32_CC_FLAGS = DEF(GCC44_ALL_CC_FLAGS) -m32 -march=i586 -malign-double -fno-stack-protector -D EFI32 -fno-asynchronous-unwind-tables -fno-PIE -no-pie | ||
18 | DEFINE GCC44_X64_CC_FLAGS = DEF(GCC44_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 | ||
19 | DEFINE GCC44_IA32_X64_DLINK_COMMON = -nostdlib -Wl,-n,-q,--gc-sections -z common-page-size=0x20 | ||
diff --git a/meta/recipes-core/ovmf/ovmf_git.bb b/meta/recipes-core/ovmf/ovmf_git.bb index 9d988e9d41..5d7216e80e 100644 --- a/meta/recipes-core/ovmf/ovmf_git.bb +++ b/meta/recipes-core/ovmf/ovmf_git.bb | |||
@@ -14,7 +14,8 @@ SRC_URI = "git://github.com/tianocore/edk2.git;branch=master \ | |||
14 | file://0002-ovmf-update-path-to-native-BaseTools.patch \ | 14 | file://0002-ovmf-update-path-to-native-BaseTools.patch \ |
15 | file://0003-BaseTools-makefile-adjust-to-build-in-under-bitbake.patch \ | 15 | file://0003-BaseTools-makefile-adjust-to-build-in-under-bitbake.patch \ |
16 | file://VfrCompile-increase-path-length-limit.patch \ | 16 | file://VfrCompile-increase-path-length-limit.patch \ |
17 | file://0001-MdeModulePkg-UefiHiiLib-Fix-incorrect-comparison-exp.patch \ | 17 | file://0001-ia32-Dont-use-pie.patch \ |
18 | file://no-stack-protector-all-archs.patch \ | ||
18 | " | 19 | " |
19 | 20 | ||
20 | SRC_URI_append_class-target = " \ | 21 | SRC_URI_append_class-target = " \ |
@@ -22,7 +23,7 @@ SRC_URI_append_class-target = " \ | |||
22 | file://0007-OvmfPkg-EnrollDefaultKeys-application-for-enrolling-.patch \ | 23 | file://0007-OvmfPkg-EnrollDefaultKeys-application-for-enrolling-.patch \ |
23 | " | 24 | " |
24 | 25 | ||
25 | SRCREV="4575a602ca6072ee9d04150b38bfb143cbff8588" | 26 | SRCREV="ec4910cd3336565fdb61dafdd9ec4ae7a6160ba3" |
26 | SRC_URI[openssl.md5sum] = "96322138f0b69e61b7212bc53d5e912b" | 27 | SRC_URI[openssl.md5sum] = "96322138f0b69e61b7212bc53d5e912b" |
27 | SRC_URI[openssl.sha256sum] = "e7aff292be21c259c6af26469c7a9b3ba26e9abaaffd325e3dccc9785256c431" | 28 | SRC_URI[openssl.sha256sum] = "e7aff292be21c259c6af26469c7a9b3ba26e9abaaffd325e3dccc9785256c431" |
28 | 29 | ||
@@ -241,3 +242,4 @@ do_deploy_class-target() { | |||
241 | addtask do_deploy after do_compile before do_build | 242 | addtask do_deploy after do_compile before do_build |
242 | 243 | ||
243 | BBCLASSEXTEND = "native" | 244 | BBCLASSEXTEND = "native" |
245 | TOOLCHAIN = "gcc" | ||