Fix some bugs from the 3.0.5 release...

Signed-off-by: Peter Jones <pjones@redhat.com>
This commit is contained in:
Peter Jones 2017-02-28 11:55:01 -05:00
parent b13b99226a
commit 5e28aef030
11 changed files with 239 additions and 15 deletions

View File

@ -1,7 +1,8 @@
From f3d3ef07eb69072b8bd2b0c5d4e6243ea38ecec9 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Thu, 2 Feb 2017 13:51:27 -0500
Subject: [PATCH] Mark our explicit fall through so -Wextra will work in gcc 7
Subject: [PATCH 01/10] Mark our explicit fall through so -Wextra will work in
gcc 7
gcc 7 introduces detection of fall-through behavior in switch/case
statements, and will warn if -Wimplicit-fallthrough is present and there

View File

@ -1,7 +1,7 @@
From bbd65152010e04275825736f203a4bf929927a7f Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Thu, 2 Feb 2017 14:00:59 -0500
Subject: [PATCH] Fix some types gcc doesn't like
Subject: [PATCH 02/10] Fix some types gcc doesn't like
Most of these come from building on i386 with -Wextra, but they're still
incorrect everywhere else; they just happen to have identical typedefs

View File

@ -1,7 +1,12 @@
From 20ca4c5a0049aa6d2c647b8512cf1d33f3c1bc35 Mon Sep 17 00:00:00 2001
From fa85eb1b6ac4ceff1672c7152b6f842c2f2ff728 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Thu, 2 Feb 2017 14:31:25 -0500
Subject: [PATCH] Fix arm build paths in the makefile
Subject: [PATCH 03/10] Fix arm build paths in the makefile
Previous work was apparently done with arm-linux-gnueabi-gcc as a
cross-builder, but our armv7 builders have native gcc with the target as
armv7hl-linux-gnueabi, so we need to munge the arch there to get our arm
path.
Signed-off-by: Peter Jones <pjones@redhat.com>
---
@ -9,7 +14,7 @@ Signed-off-by: Peter Jones <pjones@redhat.com>
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Make.defaults b/Make.defaults
index 51bd7d8..5b6d179 100755
index 51bd7d8..e4d2ac1 100755
--- a/Make.defaults
+++ b/Make.defaults
@@ -62,12 +62,12 @@ OBJCOPY := $(prefix)$(CROSS_COMPILE)objcopy
@ -17,13 +22,13 @@ index 51bd7d8..5b6d179 100755
# Host/target identification
OS := $(shell uname -s)
-HOSTARCH := $(shell $(HOSTCC) -dumpmachine | cut -f1 -d- | sed s,i[3456789]86,ia32,)
+HOSTARCH := $(shell $(HOSTCC) -dumpmachine | cut -f1 -d- | sed -e s,i[3456789]86,ia32, -e s,armv7.*,arm, )
+HOSTARCH := $(shell $(HOSTCC) -dumpmachine | cut -f1 -d- | sed -e s,i[3456789]86,ia32, -e 's,armv7.*,arm,' )
ARCH := $(HOSTARCH)
# Get ARCH from the compiler if cross compiling
ifneq ($(CROSS_COMPILE),)
- override ARCH := $(shell $(CC) -dumpmachine | cut -f1 -d-| sed s,i[3456789]86,ia32,)
+ override ARCH := $(shell $(CC) -dumpmachine | cut -f1 -d-| sed -e s,i[3456789]86,ia32, -e s,armv7.*,arm, )
+ override ARCH := $(shell $(CC) -dumpmachine | cut -f1 -d-| sed -e s,i[3456789]86,ia32, -e 's,armv7.*,arm,' )
endif
# FreeBSD (and possibly others) reports amd64 instead of x86_64

View File

@ -1,9 +1,13 @@
From a031ddee7c78a7d66d214da8f5cd329641b1e6a8 Mon Sep 17 00:00:00 2001
From 6f5781e191cca6c20a75b82cc467c2256cbb5901 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Thu, 2 Feb 2017 15:23:55 -0500
Subject: [PATCH] Work around -Werror=maybe-uninitialized not being very
Subject: [PATCH 04/10] Work around -Werror=maybe-uninitialized not being very
bright.
The compiler doesn't believe the loop always executes at least once,
even though the data in the first array entry doesn't satisfy the exit
condition. So just initialize the thing to shut it up.
Signed-off-by: Peter Jones <pjones@redhat.com>
---
apps/route80h.c | 2 +-

View File

@ -1,17 +1,30 @@
From 82e20ab31675b5177e0e05ad26c12d84ff632bc0 Mon Sep 17 00:00:00 2001
From 397b06ff74f7fd8fc71f5991bdfbfa6ef6da98fd Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Thu, 2 Feb 2017 15:25:48 -0500
Subject: [PATCH] Fix a sign error in the debughook example app
Subject: [PATCH 05/10] Fix a sign error in the debughook example app
On ISO C90 on i386 4294967294 is a signed integer, and so x can't be
greater (or equal) to that. Make it an unsigned and choose a better type
for the variable.
Signed-off-by: Peter Jones <pjones@redhat.com>
---
apps/debughook.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
apps/debughook.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/apps/debughook.c b/apps/debughook.c
index fb6cdad..9888173 100644
index fb6cdad..e1d1c50 100644
--- a/apps/debughook.c
+++ b/apps/debughook.c
@@ -45,7 +45,7 @@ DebugHook(void)
UINT8 *data = NULL;
UINTN dataSize = 0;
EFI_STATUS efi_status;
- register volatile UINTN x = 0;
+ register volatile unsigned long long x = 0;
extern char _text, _data;
if (x)
@@ -66,7 +66,7 @@ DebugHook(void)
while (x++) {
/* Make this so it can't /totally/ DoS us. */

View File

@ -0,0 +1,49 @@
From e4ca94374c7ece8ec0100075710af8638e42c203 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Wed, 8 Feb 2017 15:28:18 -0500
Subject: [PATCH 06/10] Fix typedef of EFI_PXE_BASE_CODE
Commit 751cbce3 fixed up a bunch of types to better match the edk2
definitions and the names in the UEFI Spec, but while doing so
inadvertantly defined things thusly:
INTERFACE_DECL(_EFI_PXE_BASE_CODE_PROTOCOL);
...
typedef struct _EFI_PXE_BASE_CODE_PROTOCOL {
...
} EFI_PXE_BASE_CODE_PROTOCOL;
...
typedef struct _EFI_PXE_BASE_CODE_PROTOCOL _EFI_PXE_BASE_CODE;
typedef struct EFI_PXE_BASE_CODE_PROTOCOL EFI_PXE_BASE_CODE;
Because EFI_BASE_CODE_PROTOCOL is declared with a typedef, and is
therefore in the type namespace rather than the struct namespace, this
results in EFI_PXE_BASE_CODE being a forward declaration of an
incomplete type. The net result is that code which dereferences any
field in the struct, even with the correct names, will not correctly
build.
This patch changes both _EFI_PXE_BASE_CODE and EFI_PXE_BASE_CODE
typedefs to inherit from struct _EFI_PXE_BASE_CODE_PROTOCOL.
Signed-off-by: Peter Jones <pjones@redhat.com>
---
inc/efipxebc.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/inc/efipxebc.h b/inc/efipxebc.h
index 580a6ef..3760c7c 100644
--- a/inc/efipxebc.h
+++ b/inc/efipxebc.h
@@ -419,7 +419,7 @@ typedef struct _EFI_PXE_BASE_CODE_PROTOCOL {
// Use 'EFI_PXE_BASE_CODE_PROTOCOL_GUID' instead.
typedef struct _EFI_PXE_BASE_CODE_PROTOCOL _EFI_PXE_BASE_CODE;
-typedef struct EFI_PXE_BASE_CODE_PROTOCOL EFI_PXE_BASE_CODE;
+typedef struct _EFI_PXE_BASE_CODE_PROTOCOL EFI_PXE_BASE_CODE;
//
// Call Back Definitions
--
2.9.3

View File

@ -0,0 +1,28 @@
From a01463c5035d2bacefc1ef7673b6ba2cc9815920 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Fri, 10 Feb 2017 15:16:42 -0500
Subject: [PATCH 07/10] make clang not complain about -fno-merge-constants
---
Make.defaults | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/Make.defaults b/Make.defaults
index e4d2ac1..cc52195 100755
--- a/Make.defaults
+++ b/Make.defaults
@@ -159,8 +159,9 @@ CFLAGS += $(ARCH3264) -g -O2 -Wall -Wextra -Werror \
else
CFLAGS += $(ARCH3264) -g -O2 -Wall -Wextra -Werror \
-fshort-wchar -fno-strict-aliasing \
- -fno-merge-constants -ffreestanding -fno-stack-protector \
- -fno-stack-check
+ -ffreestanding -fno-stack-protector \
+ -fno-stack-check \
+ $(if $(findstring gcc,$(CC)),-fno-merge-constants,)
endif
ARFLAGS += -U
--
2.9.3

View File

@ -0,0 +1,26 @@
From 0281df3c77fc4d8c67c0d23c656b4debed862989 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Fri, 10 Feb 2017 16:14:12 -0500
Subject: [PATCH 08/10] Fix another place clang complains about
Signed-off-by: Peter Jones <pjones@redhat.com>
---
lib/guid.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/guid.c b/lib/guid.c
index bd1f1a5..6498e90 100644
--- a/lib/guid.c
+++ b/lib/guid.c
@@ -97,7 +97,7 @@ static struct {
{ &SMapId, L"ShellDevPathMap" },
{ &SAliasId, L"ShellAlias" },
- { NULL }
+ { NULL, L"" }
};
//
--
2.9.3

View File

@ -0,0 +1,33 @@
From ba05cb606c6c3a4ec9f60c588abef52e355e5c1a Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Fri, 10 Feb 2017 16:14:55 -0500
Subject: [PATCH 09/10] route80h: remove some dead code
Signed-off-by: Peter Jones <pjones@redhat.com>
---
apps/route80h.c | 9 ---------
1 file changed, 9 deletions(-)
diff --git a/apps/route80h.c b/apps/route80h.c
index bf550a1..5272dd3 100644
--- a/apps/route80h.c
+++ b/apps/route80h.c
@@ -40,15 +40,6 @@ static inline void set_bit(volatile uint32_t *flag, int bit, int value)
Print(L"new value is 0x%2x\n", val);
}
-static inline int configspace_matches_ids(void *config, uint32_t vendor_id,
- uint32_t device_id)
-{
- uint32_t *cfg = config;
- if (cfg[0] == vendor_id && cfg[1] == device_id)
- return 1;
- return 0;
-}
-
static int is_device(EFI_PCI_IO *pciio, uint16_t vendor_id, uint16_t device_id)
{
lpcif_t lpcif;
--
2.9.3

View File

@ -0,0 +1,57 @@
From a94906bd487c1a2e6d7827f31d7eb46bc09f3b43 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Fri, 10 Feb 2017 16:18:14 -0500
Subject: [PATCH 10/10] Make clang not complain about the debughook's
optimization settings
... still won't work, of course, because nobody at clang takes compiler
compatibility seriously while they keep implying that you can pretend
it's gcc.
Signed-off-by: Peter Jones <pjones@redhat.com>
---
Make.defaults | 3 ++-
apps/debughook.c | 5 +++--
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/Make.defaults b/Make.defaults
index cc52195..a7778a7 100755
--- a/Make.defaults
+++ b/Make.defaults
@@ -161,7 +161,8 @@ CFLAGS += $(ARCH3264) -g -O2 -Wall -Wextra -Werror \
-fshort-wchar -fno-strict-aliasing \
-ffreestanding -fno-stack-protector \
-fno-stack-check \
- $(if $(findstring gcc,$(CC)),-fno-merge-constants,)
+ $(if $(findstring gcc,$(CC)),-fno-merge-constants,) \
+ $(if $(findstring clang,$(CC)),-Wno-unknown-pragmas,)
endif
ARFLAGS += -U
diff --git a/apps/debughook.c b/apps/debughook.c
index e1d1c50..fa36f62 100644
--- a/apps/debughook.c
+++ b/apps/debughook.c
@@ -37,8 +37,9 @@ GetVariable(CHAR16 *var, UINT8 **data, UINTN *len, EFI_GUID owner)
EFI_GUID DUMMY_GUID =
{0x55aad538, 0x8f82, 0x4e2a, {0xa4,0xf0,0xbe, 0x59, 0x13, 0xb6, 0x5f, 0x1e}};
+#pragma GCC push_options
+#pragma GCC optimize ("0")
static void
-__attribute__((__optimize__("0")))
DebugHook(void)
{
EFI_GUID guid = DUMMY_GUID;
@@ -81,7 +82,7 @@ DebugHook(void)
}
x = 1;
}
-
+#pragma GCC pop_options
EFI_STATUS
efi_main (EFI_HANDLE image, EFI_SYSTEM_TABLE *systab)
--
2.9.3

View File

@ -1,7 +1,7 @@
Summary: Development Libraries and headers for EFI
Name: gnu-efi
Version: 3.0.5
Release: 4%{?dist}
Release: 5%{?dist}
Epoch: 1
Group: Development/System
License: BSD
@ -16,6 +16,11 @@ Patch0002: 0002-Fix-some-types-gcc-doesn-t-like.patch
Patch0003: 0003-Fix-arm-build-paths-in-the-makefile.patch
Patch0004: 0004-Work-around-Werror-maybe-uninitialized-not-being-ver.patch
Patch0005: 0005-Fix-a-sign-error-in-the-debughook-example-app.patch
Patch0006: 0006-Fix-typedef-of-EFI_PXE_BASE_CODE.patch
Patch0007: 0007-make-clang-not-complain-about-fno-merge-constants.patch
Patch0008: 0008-Fix-another-place-clang-complains-about.patch
Patch0009: 0009-route80h-remove-some-dead-code.patch
Patch0010: 0010-Make-clang-not-complain-about-the-debughook-s-optimi.patch
%define debug_package %{nil}
@ -102,6 +107,9 @@ rm -rf %{buildroot}
%attr(0644,root,root) /boot/efi/EFI/%{efidir}/*.efi
%changelog
* Tue Feb 28 2017 Peter Jones <pjones@redhat.com> - 3.0.5-5
- Fix some bugs from the 3.0.5 release...
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1:3.0.5-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild