From 4187da9ac949be6b9a933adc8f4bb567f85c7fc5562d0f6633b6255028975c93 Mon Sep 17 00:00:00 2001 From: Raymund Will Date: Wed, 10 Oct 2018 15:05:09 +0000 Subject: [PATCH 1/2] Accepting request 640482 from home:gary_lin:branches:Base:System Update to gnu-efi 3.0.8 OBS-URL: https://build.opensuse.org/request/show/640482 OBS-URL: https://build.opensuse.org/package/show/Base:System/gnu-efi?expand=0&rev=32 --- gnu-efi-3.0.5.tar.bz2 | 3 -- gnu-efi-3.0.8.tar.bz2 | 3 ++ gnu-efi-ar-stable-order.patch | 34 ------------------- gnu-efi-fix-armv6-and-armv7-detection.patch | 16 --------- gnu-efi-fix-efi-pxe-base-code.patch | 37 --------------------- gnu-efi-fix-switch-warning.patch | 29 ---------------- gnu-efi.changes | 32 ++++++++++++++++++ gnu-efi.spec | 12 ++----- 8 files changed, 37 insertions(+), 129 deletions(-) delete mode 100644 gnu-efi-3.0.5.tar.bz2 create mode 100644 gnu-efi-3.0.8.tar.bz2 delete mode 100644 gnu-efi-ar-stable-order.patch delete mode 100644 gnu-efi-fix-armv6-and-armv7-detection.patch delete mode 100644 gnu-efi-fix-efi-pxe-base-code.patch delete mode 100644 gnu-efi-fix-switch-warning.patch diff --git a/gnu-efi-3.0.5.tar.bz2 b/gnu-efi-3.0.5.tar.bz2 deleted file mode 100644 index 76af9b5..0000000 --- a/gnu-efi-3.0.5.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:bd8fcd5914f18fc0e4ba948ab03b00013e528504f529c60739b748f6ef130b22 -size 151844 diff --git a/gnu-efi-3.0.8.tar.bz2 b/gnu-efi-3.0.8.tar.bz2 new file mode 100644 index 0000000..eb1532c --- /dev/null +++ b/gnu-efi-3.0.8.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:76006d8ea8d67bcf72f35d09d43e9ef6a69400d6d5d4bf64baf1ab7434e2b722 +size 154397 diff --git a/gnu-efi-ar-stable-order.patch b/gnu-efi-ar-stable-order.patch deleted file mode 100644 index e7685ab..0000000 --- a/gnu-efi-ar-stable-order.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 61859152d807ff7f6afabc0bb6072399e6396f8a Mon Sep 17 00:00:00 2001 -From: Nigel Croxon -Date: Thu, 1 Jun 2017 07:47:37 -0400 -Subject: [PATCH] This commit inserts the libefi.a objects in a stable order. - -When building libefi.a with "make -jN", the object files in libefi.a -will be inserted in a random order. Although it won't hurt the functionality, -it could make the EFI image irreproducible and invalidate the detached -signature after rebuilding libefi.a without any change in the source -code. - -Signed-off-by: Gary Lin -Signed-off-by: Nigel Croxon ---- - lib/Makefile | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/lib/Makefile b/lib/Makefile -index a687495..b8d1ce7 100644 ---- a/lib/Makefile -+++ b/lib/Makefile -@@ -74,7 +74,8 @@ all: libsubdirs libefi.a - libsubdirs: - for sdir in $(SUBDIRS); do mkdir -p $$sdir; done - --libefi.a: $(patsubst %,libefi.a(%),$(OBJS)) -+libefi.a: $(OBJS) -+ $(AR) rv -U $@ $^ - - clean: - rm -f libefi.a *~ $(OBJS) */*.o --- -2.13.0 - diff --git a/gnu-efi-fix-armv6-and-armv7-detection.patch b/gnu-efi-fix-armv6-and-armv7-detection.patch deleted file mode 100644 index 2944f2b..0000000 --- a/gnu-efi-fix-armv6-and-armv7-detection.patch +++ /dev/null @@ -1,16 +0,0 @@ ---- Make.defaults.orig 2018-03-13 21:33:01.937164183 +0100 -+++ Make.defaults 2018-03-13 21:35:29.487916123 +0100 -@@ -75,6 +75,13 @@ ifeq ($(ARCH),amd64) - override ARCH := x86_64 - endif - -+ifeq ($(ARCH),armv6hl) -+ override ARCH := arm -+endif -+ifeq ($(ARCH),armv7hl) -+ override ARCH := arm -+endif -+ - # - # Where to build the package - # diff --git a/gnu-efi-fix-efi-pxe-base-code.patch b/gnu-efi-fix-efi-pxe-base-code.patch deleted file mode 100644 index 958d6f2..0000000 --- a/gnu-efi-fix-efi-pxe-base-code.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 97fe9c9eddb753c4e44accc0656822ff6a60bcb9 Mon Sep 17 00:00:00 2001 -From: Gary Lin -Date: Tue, 13 Jun 2017 16:39:17 +0800 -Subject: [PATCH] Fix EFI_PXE_BASE_CODE declaration - -Declare EFI_PXE_BASE_CODE correctly - -EFI_PXE_BASE_CODE was redefined in the early commit(*) to match the -definition in EDK2. However, EFI_PXE_BASE_CODE wasn't declared -correctly. Since EFI_PXE_BASE_CODE_PROTOCOL is already an alias of -"struct _EFI_PXE_BASE_CODE_PROTOCOL", the additional struct in front of -EFI_PXE_BASE_CODE_PROTOCOL actually confused the compiler and caused -build fail. Remove the redundant struct to avoid confusion. - -*751cbce3f640c7 Update global protocol GUIDs definitions to match EDK2 - -Signed-off-by: Gary Lin ---- - inc/efipxebc.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/inc/efipxebc.h b/inc/efipxebc.h -index 580a6ef..035a853 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 EFI_PXE_BASE_CODE_PROTOCOL EFI_PXE_BASE_CODE; - - // - // Call Back Definitions --- -2.13.1 - diff --git a/gnu-efi-fix-switch-warning.patch b/gnu-efi-fix-switch-warning.patch deleted file mode 100644 index 6df7e86..0000000 --- a/gnu-efi-fix-switch-warning.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 8d8a3b5dfff1b7ee09673ffb6be764f29ede9d60 Mon Sep 17 00:00:00 2001 -From: Nigel Croxon -Date: Wed, 31 May 2017 06:53:49 -0400 -Subject: [PATCH] Add the fallthrough attribute to notify gcc7 that it's on - purpose. - -Signed-off-by: Gary Lin -Signed-off-by: Nigel Croxon ---- - lib/print.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/lib/print.c b/lib/print.c -index b8a9d38..ed79c43 100644 ---- a/lib/print.c -+++ b/lib/print.c -@@ -1131,6 +1131,9 @@ Returns: - case 'X': - Item.Width = Item.Long ? 16 : 8; - Item.Pad = '0'; -+#if __GNUC__ >= 7 -+ __attribute__ ((fallthrough)); -+#endif - case 'x': - ValueToHex ( - Item.Scratch, --- -2.13.0 - diff --git a/gnu-efi.changes b/gnu-efi.changes index cbf9be6..69302b6 100644 --- a/gnu-efi.changes +++ b/gnu-efi.changes @@ -1,3 +1,35 @@ +------------------------------------------------------------------- +Fri Oct 5 09:19:44 UTC 2018 - Gary Ching-Pang Lin + +- Update to gnu-efi 3.0.8 + + Add debug helper applications + + Call ar in deterministic mode + + Nerf -Werror=pragma away + + Make ARCH overrideable on the command line + + Add %D to print device paths + + gnu-efi: add some more common string functions + + Fix typedef of EFI_PXE_BASE_CODE + + Work around -Werror=maybe-uninitialized not being very bright + + Fix arm build paths in the makefile + + Fix some types gcc doesn't like + + Move memcpy/memset definition to global init.c + + Use ARFLAGS when invoking ar + + Disable AVX instruction set on IA32 and x86_64 platforms + + Declare EFI_PXE_BASE_CODE correctly + + inserts the libefi.a objects in a stable order + + fallthrough attribute to notify gcc7 + + x86-64/efibind: sanitize ms-abi cpp conditionals + + Add Exit() library function which calls BS->Exit() + + don't expect non-x86 compilers to compile x86 asm. also remove + what looks like garbage inside an #if 0 block + + For compatibility with an upcoming EDK2 feature +- Drop upstreamed patches + + gnu-efi-ar-stable-order.patch + + gnu-efi-fix-efi-pxe-base-code.patch + + gnu-efi-fix-switch-warning.patch +- Drop gnu-efi-fix-armv6-and-armv7-detection.patch since upstream + supports ARM officially + ------------------------------------------------------------------- Tue Mar 13 22:06:59 UTC 2018 - kasimir_@outlook.de diff --git a/gnu-efi.spec b/gnu-efi.spec index 14c7e29..586c921 100644 --- a/gnu-efi.spec +++ b/gnu-efi.spec @@ -17,18 +17,14 @@ Name: gnu-efi -Version: 3.0.5 +Version: 3.0.8 Release: 0 Summary: Library for EFI Applications -License: BSD-3-Clause and GPL-2.0+ +License: BSD-3-Clause AND GPL-2.0-or-later Group: Development/Libraries/Other Url: http://sourceforge.net/projects/gnu-efi Source: http://sourceforge.net/projects/gnu-efi/files/gnu-efi-%{version}.tar.bz2 Source1: %{name}-rpmlintrc -Patch1: gnu-efi-fix-switch-warning.patch -Patch2: gnu-efi-ar-stable-order.patch -Patch3: gnu-efi-fix-efi-pxe-base-code.patch -Patch4: gnu-efi-fix-armv6-and-armv7-detection.patch BuildRequires: kernel-source BuildRoot: %{_tmppath}/%{name}-%{version}-build ExclusiveArch: ia64 %ix86 x86_64 aarch64 %arm @@ -40,10 +36,6 @@ environment. %prep %setup -q -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 -%patch4 -p0 %build ########################## From fad3c2e199c690d6aa8c249e42b2babd0d250af56191d92185da536744a6d8b1 Mon Sep 17 00:00:00 2001 From: Raymund Will Date: Thu, 11 Oct 2018 12:54:46 +0000 Subject: [PATCH 2/2] Accepting request 641192 from home:gary_lin:branches:Base:System fix StrnCpy(), StpnCpy(), and StrnCat() OBS-URL: https://build.opensuse.org/request/show/641192 OBS-URL: https://build.opensuse.org/package/show/Base:System/gnu-efi?expand=0&rev=33 --- gnu-efi-fix-strncpy-stpncpy-strncat.patch | 151 ++++++++++++++++++++++ gnu-efi.changes | 6 + gnu-efi.spec | 2 + 3 files changed, 159 insertions(+) create mode 100644 gnu-efi-fix-strncpy-stpncpy-strncat.patch diff --git a/gnu-efi-fix-strncpy-stpncpy-strncat.patch b/gnu-efi-fix-strncpy-stpncpy-strncat.patch new file mode 100644 index 0000000..ef88bcf --- /dev/null +++ b/gnu-efi-fix-strncpy-stpncpy-strncat.patch @@ -0,0 +1,151 @@ +From 85f1c797f6935223205159dd108e4871b2e55500 Mon Sep 17 00:00:00 2001 +From: Pete Batard +Date: Tue, 24 Apr 2018 13:45:11 +0100 +Subject: [PATCH 1/4] Fix conversion from 'UINTN' to 'UINT8' warnings + +* MSVC generates two of the following in rtstr.c: + warning C4244: 'function': conversion from 'UINTN' to 'UINT8', possible loss of data +--- + lib/runtime/rtstr.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/lib/runtime/rtstr.c b/lib/runtime/rtstr.c +index 80ff489..dcc1a2a 100644 +--- a/lib/runtime/rtstr.c ++++ b/lib/runtime/rtstr.c +@@ -71,7 +71,7 @@ RtStrnCpy ( + { + UINTN Size = RtStrnLen(Src, Len); + if (Size != Len) +- RtSetMem(Dest + Len, '\0', (Len - Size) * sizeof(CHAR16)); ++ RtSetMem(Dest + Len, '\0', (UINT8)((Len - Size) * sizeof(CHAR16))); + RtCopyMem(Dest, Src, Size * sizeof(CHAR16)); + } + +@@ -107,7 +107,7 @@ RtStpnCpy ( + { + UINTN Size = RtStrnLen(Src, Len); + if (Size != Len) +- RtSetMem(Dest + Len, '\0', (Len - Size) * sizeof(CHAR16)); ++ RtSetMem(Dest + Len, '\0', (UINT8)((Len - Size) * sizeof(CHAR16))); + RtCopyMem(Dest, Src, Size * sizeof(CHAR16)); + return Dest + Size; + } +-- +2.19.0 + + +From 4889dc561f905406f3d0a648321589bd47703fdc Mon Sep 17 00:00:00 2001 +From: Gary Lin +Date: Tue, 9 Oct 2018 18:35:21 +0800 +Subject: [PATCH 2/4] Set '\0' properly in StrnCpy() + +The arguments to SetMem() were wrong. Besides, SetMem() should start at +"Dest + Size" since "Size" will be smaller than "Len" if they are not +equal. + +Signed-off-by: Gary Lin +--- + lib/runtime/rtstr.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/runtime/rtstr.c b/lib/runtime/rtstr.c +index dcc1a2a..949f938 100644 +--- a/lib/runtime/rtstr.c ++++ b/lib/runtime/rtstr.c +@@ -71,7 +71,7 @@ RtStrnCpy ( + { + UINTN Size = RtStrnLen(Src, Len); + if (Size != Len) +- RtSetMem(Dest + Len, '\0', (UINT8)((Len - Size) * sizeof(CHAR16))); ++ RtSetMem(Dest + Size, (Len - Size) * sizeof(CHAR16), '\0'); + RtCopyMem(Dest, Src, Size * sizeof(CHAR16)); + } + +-- +2.19.0 + + +From 38a9921bc39fea25b0ca62d6eb1595bf15d05839 Mon Sep 17 00:00:00 2001 +From: Gary Lin +Date: Thu, 11 Oct 2018 12:02:27 +0800 +Subject: [PATCH 3/4] Implement StrnCat() without StrnCpy() + +StrnCpy() doesn't guarantee the dest string will be null-terminated, so +we shouldn't use StrnCpy(). + +Signed-off-by: Gary Lin +--- + lib/runtime/rtstr.c | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/lib/runtime/rtstr.c b/lib/runtime/rtstr.c +index 949f938..fe65d96 100644 +--- a/lib/runtime/rtstr.c ++++ b/lib/runtime/rtstr.c +@@ -126,7 +126,7 @@ RtStrCat ( + } + + #ifndef __GNUC__ +-#pragma RUNTIME_CODE(RtStrCat) ++#pragma RUNTIME_CODE(RtStrnCat) + #endif + VOID + RUNTIMEFUNCTION +@@ -136,7 +136,12 @@ RtStrnCat ( + IN UINTN Len + ) + { +- RtStrnCpy(Dest+StrLen(Dest), Src, Len); ++ UINTN DestSize, Size; ++ ++ DestSize = StrLen(Dest); ++ Size = RtStrnLen(Src, Len); ++ RtCopyMem(Dest + DestSize, Src, Size * sizeof(CHAR16)); ++ Dest[DestSize + Size] = '\0'; + } + + #ifndef __GNUC__ +-- +2.19.0 + + +From 134587ea094a4974e5773bf228f6436535f50f1a Mon Sep 17 00:00:00 2001 +From: Gary Lin +Date: Thu, 11 Oct 2018 16:10:26 +0800 +Subject: [PATCH 4/4] Set '\0' properly in StpnCpy() + +The arguments to SetMem() were wrong. Besides, SetMem() should start at +"Dest + Size" since "Size" will be smaller than "Len" if they are not +equal. + +Signed-off-by: Gary Lin +--- + lib/runtime/rtstr.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/lib/runtime/rtstr.c b/lib/runtime/rtstr.c +index fe65d96..73965ca 100644 +--- a/lib/runtime/rtstr.c ++++ b/lib/runtime/rtstr.c +@@ -94,7 +94,7 @@ RtStpCpy ( + } + + #ifndef __GNUC__ +-#pragma RUNTIME_CODE(RtStrnCpy) ++#pragma RUNTIME_CODE(RtStpnCpy) + #endif + CHAR16 * + RUNTIMEFUNCTION +@@ -107,7 +107,7 @@ RtStpnCpy ( + { + UINTN Size = RtStrnLen(Src, Len); + if (Size != Len) +- RtSetMem(Dest + Len, '\0', (UINT8)((Len - Size) * sizeof(CHAR16))); ++ RtSetMem(Dest + Size, (Len - Size) * sizeof(CHAR16), '\0'); + RtCopyMem(Dest, Src, Size * sizeof(CHAR16)); + return Dest + Size; + } +-- +2.19.0 + diff --git a/gnu-efi.changes b/gnu-efi.changes index 69302b6..07e6f27 100644 --- a/gnu-efi.changes +++ b/gnu-efi.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Oct 11 08:15:40 UTC 2018 - Gary Ching-Pang Lin + +- Add gnu-efi-fix-strncpy-stpncpy-strncat.patch to fix StrnCpy(), + StpnCpy(), and StrnCat() + ------------------------------------------------------------------- Fri Oct 5 09:19:44 UTC 2018 - Gary Ching-Pang Lin diff --git a/gnu-efi.spec b/gnu-efi.spec index 586c921..62d71d7 100644 --- a/gnu-efi.spec +++ b/gnu-efi.spec @@ -25,6 +25,7 @@ Group: Development/Libraries/Other Url: http://sourceforge.net/projects/gnu-efi Source: http://sourceforge.net/projects/gnu-efi/files/gnu-efi-%{version}.tar.bz2 Source1: %{name}-rpmlintrc +Patch1: %{name}-fix-strncpy-stpncpy-strncat.patch BuildRequires: kernel-source BuildRoot: %{_tmppath}/%{name}-%{version}-build ExclusiveArch: ia64 %ix86 x86_64 aarch64 %arm @@ -36,6 +37,7 @@ environment. %prep %setup -q +%patch1 -p1 %build ##########################