diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2018-12-18 07:00:01 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2018-12-18 07:00:01 +0000 |
commit | 479ed7b5e60e3be1adf3b2db3c775b0915097696 (patch) | |
tree | 1698be5fbf09d782e3e13c36a0104e859432e735 /main/grub | |
parent | e8785cd30cbfb35a072ddee57a01c458c30e9e80 (diff) | |
download | aports-479ed7b5e60e3be1adf3b2db3c775b0915097696.tar.bz2 aports-479ed7b5e60e3be1adf3b2db3c775b0915097696.tar.xz |
main/grub: fix build with gcc8
Diffstat (limited to 'main/grub')
-rw-r--r-- | main/grub/0008-Fix-packed-not-aligned-error-on-GCC-8.patch | 72 | ||||
-rw-r--r-- | main/grub/APKBUILD | 4 |
2 files changed, 75 insertions, 1 deletions
diff --git a/main/grub/0008-Fix-packed-not-aligned-error-on-GCC-8.patch b/main/grub/0008-Fix-packed-not-aligned-error-on-GCC-8.patch new file mode 100644 index 0000000000..2d09149f72 --- /dev/null +++ b/main/grub/0008-Fix-packed-not-aligned-error-on-GCC-8.patch @@ -0,0 +1,72 @@ +From 563b1da6e6ae7af46cc8354cadb5dab416989f0a Mon Sep 17 00:00:00 2001 +From: Michael Chang <mchang@suse.com> +Date: Mon, 26 Mar 2018 16:52:34 +0800 +Subject: Fix packed-not-aligned error on GCC 8 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +When building with GCC 8, there are several errors regarding packed-not-aligned. + +./include/grub/gpt_partition.h:79:1: error: alignment 1 of ‘struct grub_gpt_partentry’ is less than 8 [-Werror=packed-not-aligned] + +This patch fixes the build error by cleaning up the ambiguity of placing +aligned structure in a packed one. In "struct grub_btrfs_time" and "struct +grub_gpt_part_type", the aligned attribute seems to be superfluous, and also +has to be packed, to ensure the structure is bit-to-bit mapped to the format +laid on disk. I think we could blame to copy and paste error here for the +mistake. In "struct efi_variable", we have to use grub_efi_packed_guid_t, as +the name suggests. :) + +Signed-off-by: Michael Chang <mchang@suse.com> +Tested-by: Michael Chang <mchang@suse.com> +Tested-by: Paul Menzel <paulepanter@users.sourceforge.net> +Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com> +--- + grub-core/fs/btrfs.c | 2 +- + include/grub/efiemu/runtime.h | 2 +- + include/grub/gpt_partition.h | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/grub-core/fs/btrfs.c b/grub-core/fs/btrfs.c +index 4849c1ceb..be195448d 100644 +--- a/grub-core/fs/btrfs.c ++++ b/grub-core/fs/btrfs.c +@@ -175,7 +175,7 @@ struct grub_btrfs_time + { + grub_int64_t sec; + grub_uint32_t nanosec; +-} __attribute__ ((aligned (4))); ++} GRUB_PACKED; + + struct grub_btrfs_inode + { +diff --git a/include/grub/efiemu/runtime.h b/include/grub/efiemu/runtime.h +index 9b6b729f4..36d2dedf4 100644 +--- a/include/grub/efiemu/runtime.h ++++ b/include/grub/efiemu/runtime.h +@@ -29,7 +29,7 @@ struct grub_efiemu_ptv_rel + + struct efi_variable + { +- grub_efi_guid_t guid; ++ grub_efi_packed_guid_t guid; + grub_uint32_t namelen; + grub_uint32_t size; + grub_efi_uint32_t attributes; +diff --git a/include/grub/gpt_partition.h b/include/grub/gpt_partition.h +index 1b32f6725..9668a68c3 100644 +--- a/include/grub/gpt_partition.h ++++ b/include/grub/gpt_partition.h +@@ -28,7 +28,7 @@ struct grub_gpt_part_type + grub_uint16_t data2; + grub_uint16_t data3; + grub_uint8_t data4[8]; +-} __attribute__ ((aligned(8))); ++} GRUB_PACKED; + typedef struct grub_gpt_part_type grub_gpt_part_type_t; + + #define GRUB_GPT_PARTITION_TYPE_EMPTY \ +-- +cgit v1.1-33-g03f6 + diff --git a/main/grub/APKBUILD b/main/grub/APKBUILD index 4e2a0e2741..8d0a307f10 100644 --- a/main/grub/APKBUILD +++ b/main/grub/APKBUILD @@ -2,7 +2,7 @@ # Maintainer: Timo Teräs <timo.teras@iki.fi> pkgname=grub pkgver=2.02 -pkgrel=7 +pkgrel=8 pkgdesc="Bootloader with support for Linux, Multiboot and more" url="https://www.gnu.org/software/grub/" arch="all !s390x" @@ -35,6 +35,7 @@ source="https://ftp.gnu.org/gnu/grub/grub-$pkgver.tar.xz grub2-accept-empty-module.patch grub-xen-host_grub.cfg 2.02_beta3-mkconfig-alpine.patch + 0008-Fix-packed-not-aligned-error-on-GCC-8.patch 0009-xfs-Accept-filesystem-with-sparse-inodes.patch x86-64-Treat-R_X86_64_PLT32-as-R_X86_64_PC32.patch " @@ -162,5 +163,6 @@ f2a7d9ab6c445f4e402e790db56378cecd6631b5c367451aa6ce5c01cd95b95c83c3dd24d6d4b857 098a1742aef131c85d63b934a9815879b991f2e73030cb90ac4b5dcd07d249fa0dd0a281e52ada0e10f05d59223493bd416eb47543242bf0ba336a0ebc9b2a1a grub2-accept-empty-module.patch 4e7394e0fff6772c89683039ccf81099ebbfe4f498e6df408977a1488fd59389b6e19afdbf0860ec271e2b2aea0df7216243dcc8235d1ca3af0e7f4d0a9d60a4 grub-xen-host_grub.cfg 5de7c1cc11640a3892447f0daa1e3fd1f67b0c474c8aec555e4e6315b5e6c00491ba02c88b420cec221da0640c6961d639f148746df14a0b2c15bda7989cd25c 2.02_beta3-mkconfig-alpine.patch +088455205f2f397d60e43eab19ed73994880ea1f442661f7975846cceaf2b112d92fd1341119d7dbfad3af2174dfd4d4721f31dead1ac35f4a3cb7c0d92f8a04 0008-Fix-packed-not-aligned-error-on-GCC-8.patch 4723c5dd9fd6e9b6c8677e32e4906c7995d695c7e85e834b1b29eb1d9a024678f8fa75846c7b929d1db9b5911b604c69c1b0379cb3b9adc98d5bb6d6719eb2c4 0009-xfs-Accept-filesystem-with-sparse-inodes.patch e11f62b5012ecc8abf9d4912db12a263470887671b05ccb4de54981fb3b32a52d4557439a160e69e0654e35a57fdb0afd5fe801709b8037a6ea4a50d8b8455ec x86-64-Treat-R_X86_64_PLT32-as-R_X86_64_PC32.patch" |