summaryrefslogtreecommitdiffstats
path: root/meta/recipes-bsp/grub/files/gcc8.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-bsp/grub/files/gcc8.patch')
-rw-r--r--meta/recipes-bsp/grub/files/gcc8.patch74
1 files changed, 74 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