summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/recipes-bsp/grub/files/gcc8.patch74
-rw-r--r--meta/recipes-bsp/grub/grub2.inc1
2 files changed, 75 insertions, 0 deletions
diff --git a/meta/recipes-bsp/grub/files/gcc8.patch b/meta/recipes-bsp/grub/files/gcc8.patch
new file mode 100644
index 0000000000..fa7331f1b3
--- /dev/null
+++ b/meta/recipes-bsp/grub/files/gcc8.patch
@@ -0,0 +1,74 @@
1From 563b1da6e6ae7af46cc8354cadb5dab416989f0a Mon Sep 17 00:00:00 2001
2From: Michael Chang <mchang@suse.com>
3Date: Mon, 26 Mar 2018 16:52:34 +0800
4Subject: Fix packed-not-aligned error on GCC 8
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9When building with GCC 8, there are several errors regarding packed-not-aligned.
10
11./include/grub/gpt_partition.h:79:1: error: alignment 1 of ‘struct grub_gpt_partentry’ is less than 8 [-Werror=packed-not-aligned]
12
13This patch fixes the build error by cleaning up the ambiguity of placing
14aligned structure in a packed one. In "struct grub_btrfs_time" and "struct
15grub_gpt_part_type", the aligned attribute seems to be superfluous, and also
16has to be packed, to ensure the structure is bit-to-bit mapped to the format
17laid on disk. I think we could blame to copy and paste error here for the
18mistake. In "struct efi_variable", we have to use grub_efi_packed_guid_t, as
19the name suggests. :)
20
21Signed-off-by: Michael Chang <mchang@suse.com>
22Tested-by: Michael Chang <mchang@suse.com>
23Tested-by: Paul Menzel <paulepanter@users.sourceforge.net>
24Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
25
26Upstream-Status: Backport http://git.savannah.gnu.org/cgit/grub.git/commit/?id=563b1da6e6ae7af46cc8354cadb5dab416989f0a
27---
28 grub-core/fs/btrfs.c | 2 +-
29 include/grub/efiemu/runtime.h | 2 +-
30 include/grub/gpt_partition.h | 2 +-
31 3 files changed, 3 insertions(+), 3 deletions(-)
32
33diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c
34index 4849c1c..be19544 100644
35--- a/grub-core/fs/btrfs.c
36+++ b/grub-core/fs/btrfs.c
37@@ -175,7 +175,7 @@ struct grub_btrfs_time
38 {
39 grub_int64_t sec;
40 grub_uint32_t nanosec;
41-} __attribute__ ((aligned (4)));
42+} GRUB_PACKED;
43
44 struct grub_btrfs_inode
45 {
46diff --git a/include/grub/efiemu/runtime.h b/include/grub/efiemu/runtime.h
47index 9b6b729..36d2ded 100644
48--- a/include/grub/efiemu/runtime.h
49+++ b/include/grub/efiemu/runtime.h
50@@ -29,7 +29,7 @@ struct grub_efiemu_ptv_rel
51
52 struct efi_variable
53 {
54- grub_efi_guid_t guid;
55+ grub_efi_packed_guid_t guid;
56 grub_uint32_t namelen;
57 grub_uint32_t size;
58 grub_efi_uint32_t attributes;
59diff --git a/include/grub/gpt_partition.h b/include/grub/gpt_partition.h
60index 1b32f67..9668a68 100644
61--- a/include/grub/gpt_partition.h
62+++ b/include/grub/gpt_partition.h
63@@ -28,7 +28,7 @@ struct grub_gpt_part_type
64 grub_uint16_t data2;
65 grub_uint16_t data3;
66 grub_uint8_t data4[8];
67-} __attribute__ ((aligned(8)));
68+} GRUB_PACKED;
69 typedef struct grub_gpt_part_type grub_gpt_part_type_t;
70
71 #define GRUB_GPT_PARTITION_TYPE_EMPTY \
72--
73cgit v1.0-41-gc330
74
diff --git a/meta/recipes-bsp/grub/grub2.inc b/meta/recipes-bsp/grub/grub2.inc
index 2ea31f6420..a8f335e1f8 100644
--- a/meta/recipes-bsp/grub/grub2.inc
+++ b/meta/recipes-bsp/grub/grub2.inc
@@ -18,6 +18,7 @@ SRC_URI = "https://ftp.gnu.org/gnu/grub/grub-${PV}.tar.gz \
18 file://grub-module-explicitly-keeps-symbole-.module_license.patch \ 18 file://grub-module-explicitly-keeps-symbole-.module_license.patch \
19 file://0001-grub.d-10_linux.in-add-oe-s-kernel-name.patch \ 19 file://0001-grub.d-10_linux.in-add-oe-s-kernel-name.patch \
20 file://fix.build.with.gcc-7.patch \ 20 file://fix.build.with.gcc-7.patch \
21 file://gcc8.patch \
21" 22"
22SRC_URI[md5sum] = "1116d1f60c840e6dbd67abbc99acb45d" 23SRC_URI[md5sum] = "1116d1f60c840e6dbd67abbc99acb45d"
23SRC_URI[sha256sum] = "660ee136fbcee08858516ed4de2ad87068bfe1b6b8b37896ce3529ff054a726d" 24SRC_URI[sha256sum] = "660ee136fbcee08858516ed4de2ad87068bfe1b6b8b37896ce3529ff054a726d"