From 250175b1f4c39fb99e048e64c709326d199f8598 Mon Sep 17 00:00:00 2001 From: lei_ju <983277505@qq.com> Date: Wed, 3 Jun 2020 10:09:48 +0800 Subject: [PATCH] fix unaligned point value with GCC9 --- ...-fix-unaligned-point-value-with-GCC9.patch | 53 +++++++++++++++++++ vboot-utils.spec | 6 ++- 2 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 0001-fix-unaligned-point-value-with-GCC9.patch diff --git a/0001-fix-unaligned-point-value-with-GCC9.patch b/0001-fix-unaligned-point-value-with-GCC9.patch new file mode 100644 index 0000000..ea34658 --- /dev/null +++ b/0001-fix-unaligned-point-value-with-GCC9.patch @@ -0,0 +1,53 @@ +From 6e13a3b539105b2773e43055c2d44912cbba7a29 Mon Sep 17 00:00:00 2001 +From: lei_ju +Date: Wed, 3 Jun 2020 09:03:49 +0800 +Subject: [PATCH] fix unaligned point value with GCC9 + +--- + firmware/2lib/include/2struct.h | 2 +- + firmware/include/gpt.h | 2 +- + firmware/include/vboot_struct.h | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/firmware/2lib/include/2struct.h b/firmware/2lib/include/2struct.h +index 1d5b353..b045a0b 100644 +--- a/firmware/2lib/include/2struct.h ++++ b/firmware/2lib/include/2struct.h +@@ -213,7 +213,7 @@ struct vb2_shared_data { + uint32_t gbb_size; + + +-} __attribute__((packed)); ++} __attribute__((aligned)); + + /****************************************************************************/ + +diff --git a/firmware/include/gpt.h b/firmware/include/gpt.h +index 4570237..f1da14d 100644 +--- a/firmware/include/gpt.h ++++ b/firmware/include/gpt.h +@@ -120,7 +120,7 @@ typedef struct { + } attrs; + uint16_t name[36]; /* UTF-16 encoded partition name */ + /* Remainder of entry is reserved and should be 0 */ +-} __attribute__((packed)) GptEntry; ++} __attribute__((aligned)) GptEntry; + + #define GPTENTRY_EXPECTED_SIZE 128 + +diff --git a/firmware/include/vboot_struct.h b/firmware/include/vboot_struct.h +index fd5777a..a06d038 100644 +--- a/firmware/include/vboot_struct.h ++++ b/firmware/include/vboot_struct.h +@@ -478,7 +478,7 @@ typedef struct VbSharedDataHeader { + * all the fields it knows about are present. Newer firmware needs to + * use reasonable defaults when accessing older structs. + */ +-} __attribute__((packed)) VbSharedDataHeader; ++} __attribute__((aligned)) VbSharedDataHeader; + + /* + * Size of VbSharedDataheader for each version +-- +2.23.0 + diff --git a/vboot-utils.spec b/vboot-utils.spec index 4b034bc..ef9b319 100644 --- a/vboot-utils.spec +++ b/vboot-utils.spec @@ -2,7 +2,7 @@ Name: vboot-utils Version: 20180531 -Release: 3 +Release: 4 Summary: Chromium OS verified boot utility License: BSD URL: https://chromium.googlesource.com/chromiumos/platform/vboot_reference @@ -11,6 +11,7 @@ ExclusiveArch: aarch64 x86_64 Source0: %{name}-2cc35b0.tar.xz Patch0001: vboot-utils-00-disable-static-linking.patch Patch0002: vboot-utils-cflags.patch +Patch0003: 0001-fix-unaligned-point-value-with-GCC9.patch BuildRequires: gcc-c++ openssl-devel trousers-devel libyaml-devel xz-devel libuuid-devel python2 @@ -45,5 +46,8 @@ make runtests || true /usr/lib/pkgconfig/ %changelog +* Wed Jan 8 2020 leiju - 20180531-4 +- fix unaligned point value with GCC9 + * Wed Jan 8 2020 fengbing - 20180531-3 - Package init