diff options
3 files changed, 163 insertions, 0 deletions
diff --git a/meta/recipes-extended/mdadm/files/0001-Disable-gcc8-warnings.patch b/meta/recipes-extended/mdadm/files/0001-Disable-gcc8-warnings.patch new file mode 100644 index 0000000000..8cf52406c4 --- /dev/null +++ b/meta/recipes-extended/mdadm/files/0001-Disable-gcc8-warnings.patch | |||
| @@ -0,0 +1,130 @@ | |||
| 1 | From b83218de2623c0bbe9af355a81ae8385d7f30cfc Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Wed, 9 May 2018 12:56:41 -0700 | ||
| 4 | Subject: [PATCH] Disable gcc8 warnings | ||
| 5 | |||
| 6 | This is needed until | ||
| 7 | https://bugzilla.redhat.com/show_bug.cgi?id=1553958 | ||
| 8 | |||
| 9 | Upstream-Status: Inappropriate [Workaround] | ||
| 10 | |||
| 11 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 12 | |||
| 13 | --- | ||
| 14 | Monitor.c | 4 +++- | ||
| 15 | mdopen.c | 4 ++++ | ||
| 16 | super-ddf.c | 4 ++++ | ||
| 17 | super-intel.c | 6 ++++++ | ||
| 18 | super1.c | 5 +++++ | ||
| 19 | 5 files changed, 22 insertions(+), 1 deletion(-) | ||
| 20 | |||
| 21 | diff --git a/Monitor.c b/Monitor.c | ||
| 22 | index 802a9d9..23b246b 100644 | ||
| 23 | --- a/Monitor.c | ||
| 24 | +++ b/Monitor.c | ||
| 25 | @@ -441,7 +441,8 @@ static void alert(char *event, char *dev, char *disc, struct alert_info *info) | ||
| 26 | event, dev); | ||
| 27 | } | ||
| 28 | } | ||
| 29 | - | ||
| 30 | +#pragma GCC diagnostic push | ||
| 31 | +#pragma GCC diagnostic ignored "-Wformat-truncation" | ||
| 32 | static int check_array(struct state *st, struct mdstat_ent *mdstat, | ||
| 33 | int test, struct alert_info *ainfo, | ||
| 34 | int increments, char *prefer) | ||
| 35 | @@ -683,6 +684,7 @@ static int check_array(struct state *st, struct mdstat_ent *mdstat, | ||
| 36 | return 1; | ||
| 37 | return 0; | ||
| 38 | } | ||
| 39 | +#pragma GCC diagnostic pop | ||
| 40 | |||
| 41 | static int add_new_arrays(struct mdstat_ent *mdstat, struct state **statelist, | ||
| 42 | int test, struct alert_info *info) | ||
| 43 | diff --git a/mdopen.c b/mdopen.c | ||
| 44 | index 685ca32..406aba4 100644 | ||
| 45 | --- a/mdopen.c | ||
| 46 | +++ b/mdopen.c | ||
| 47 | @@ -26,6 +26,9 @@ | ||
| 48 | #include "md_p.h" | ||
| 49 | #include <ctype.h> | ||
| 50 | |||
| 51 | +#pragma GCC diagnostic push | ||
| 52 | +#pragma GCC diagnostic ignored "-Wformat-truncation" | ||
| 53 | + | ||
| 54 | void make_parts(char *dev, int cnt) | ||
| 55 | { | ||
| 56 | /* make 'cnt' partition devices for 'dev' | ||
| 57 | @@ -99,6 +102,7 @@ void make_parts(char *dev, int cnt) | ||
| 58 | } | ||
| 59 | free(name); | ||
| 60 | } | ||
| 61 | +#pragma GCC diagnostic pop | ||
| 62 | |||
| 63 | /* | ||
| 64 | * We need a new md device to assemble/build/create an array. | ||
| 65 | diff --git a/super-ddf.c b/super-ddf.c | ||
| 66 | index 1707ad1..e08d289 100644 | ||
| 67 | --- a/super-ddf.c | ||
| 68 | +++ b/super-ddf.c | ||
| 69 | @@ -2846,6 +2846,9 @@ static void _set_config_size(struct phys_disk_entry *pde, const struct dl *dl) | ||
| 70 | (unsigned long long)cfs, (unsigned long long)(dl->size-cfs)); | ||
| 71 | } | ||
| 72 | |||
| 73 | +#pragma GCC diagnostic push | ||
| 74 | +#pragma GCC diagnostic ignored "-Wformat-overflow" | ||
| 75 | + | ||
| 76 | /* Add a device to a container, either while creating it or while | ||
| 77 | * expanding a pre-existing container | ||
| 78 | */ | ||
| 79 | @@ -2981,6 +2984,7 @@ static int add_to_super_ddf(struct supertype *st, | ||
| 80 | |||
| 81 | return 0; | ||
| 82 | } | ||
| 83 | +#pragma GCC diagnostic pop | ||
| 84 | |||
| 85 | static int remove_from_super_ddf(struct supertype *st, mdu_disk_info_t *dk) | ||
| 86 | { | ||
| 87 | diff --git a/super-intel.c b/super-intel.c | ||
| 88 | index 00a2925..44fbead 100644 | ||
| 89 | --- a/super-intel.c | ||
| 90 | +++ b/super-intel.c | ||
| 91 | @@ -298,6 +298,11 @@ struct md_list { | ||
| 92 | }; | ||
| 93 | |||
| 94 | #define pr_vrb(fmt, arg...) (void) (verbose && pr_err(fmt, ##arg)) | ||
| 95 | +#pragma GCC diagnostic push | ||
| 96 | +# if __GNUC__ == 8 | ||
| 97 | +# pragma GCC diagnostic ignored "-Wstringop-truncation" | ||
| 98 | +# endif | ||
| 99 | +#pragma GCC diagnostic ignored "-Wformat-truncation" | ||
| 100 | |||
| 101 | static __u8 migr_type(struct imsm_dev *dev) | ||
| 102 | { | ||
| 103 | @@ -11618,3 +11623,4 @@ struct superswitch super_imsm = { | ||
| 104 | .get_bad_blocks = imsm_get_badblocks, | ||
| 105 | #endif /* MDASSEMBLE */ | ||
| 106 | }; | ||
| 107 | +#pragma GCC diagnostic pop | ||
| 108 | diff --git a/super1.c b/super1.c | ||
| 109 | index 87a74cb..71c515f 100644 | ||
| 110 | --- a/super1.c | ||
| 111 | +++ b/super1.c | ||
| 112 | @@ -1091,6 +1091,10 @@ static struct mdinfo *container_content1(struct supertype *st, char *subarray) | ||
| 113 | return info; | ||
| 114 | } | ||
| 115 | |||
| 116 | +#pragma GCC diagnostic push | ||
| 117 | +# if __GNUC__ == 8 | ||
| 118 | +# pragma GCC diagnostic ignored "-Wstringop-truncation" | ||
| 119 | +#endif | ||
| 120 | static int update_super1(struct supertype *st, struct mdinfo *info, | ||
| 121 | char *update, | ||
| 122 | char *devname, int verbose, | ||
| 123 | @@ -1473,6 +1477,7 @@ static int init_super1(struct supertype *st, mdu_array_info_t *info, | ||
| 124 | |||
| 125 | return 1; | ||
| 126 | } | ||
| 127 | +#pragma GCC diagnostic pop | ||
| 128 | |||
| 129 | struct devinfo { | ||
| 130 | int fd; | ||
diff --git a/meta/recipes-extended/mdadm/files/0001-use-memmove-instead-of-memcpy-on-overlapping-region.patch b/meta/recipes-extended/mdadm/files/0001-use-memmove-instead-of-memcpy-on-overlapping-region.patch new file mode 100644 index 0000000000..44351b6569 --- /dev/null +++ b/meta/recipes-extended/mdadm/files/0001-use-memmove-instead-of-memcpy-on-overlapping-region.patch | |||
| @@ -0,0 +1,31 @@ | |||
| 1 | From ab18f04cf89ef4e8521c81c50477e1363b2d333b Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Sat, 28 Apr 2018 09:46:12 -0700 | ||
| 4 | Subject: [PATCH] use memmove instead of memcpy on overlapping region | ||
| 5 | |||
| 6 | Fixes | ||
| 7 | super0.c:526:3: error: 'memcpy' accessing 3936 bytes at offsets 156 and 160 overlaps 3932 bytes at offset 160 [-Werror=restrict] | ||
| 8 | |||
| 9 | Upstream-Status: Pending | ||
| 10 | |||
| 11 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 12 | --- | ||
| 13 | super0.c | 2 +- | ||
| 14 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 15 | |||
| 16 | diff --git a/super0.c b/super0.c | ||
| 17 | index f5b4507..264b598 100644 | ||
| 18 | --- a/super0.c | ||
| 19 | +++ b/super0.c | ||
| 20 | @@ -523,7 +523,7 @@ static int update_super0(struct supertype *st, struct mdinfo *info, | ||
| 21 | * up 4 bytes before continuing | ||
| 22 | */ | ||
| 23 | __u32 *sb32 = (__u32*)sb; | ||
| 24 | - memcpy(sb32+MD_SB_GENERIC_CONSTANT_WORDS+7, | ||
| 25 | + memmove(sb32+MD_SB_GENERIC_CONSTANT_WORDS+7, | ||
| 26 | sb32+MD_SB_GENERIC_CONSTANT_WORDS+7+1, | ||
| 27 | (MD_SB_WORDS - (MD_SB_GENERIC_CONSTANT_WORDS+7+1))*4); | ||
| 28 | if (verbose >= 0) | ||
| 29 | -- | ||
| 30 | 2.17.0 | ||
| 31 | |||
diff --git a/meta/recipes-extended/mdadm/mdadm_4.0.bb b/meta/recipes-extended/mdadm/mdadm_4.0.bb index dc098f19b6..226b974352 100644 --- a/meta/recipes-extended/mdadm/mdadm_4.0.bb +++ b/meta/recipes-extended/mdadm/mdadm_4.0.bb | |||
| @@ -22,6 +22,8 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/raid/mdadm/${BPN}-${PV}.tar.xz \ | |||
| 22 | file://0004-mdadm-Forced-type-conversion-to-avoid-truncation.patch \ | 22 | file://0004-mdadm-Forced-type-conversion-to-avoid-truncation.patch \ |
| 23 | file://0005-Add-a-comment-to-indicate-valid-fallthrough.patch \ | 23 | file://0005-Add-a-comment-to-indicate-valid-fallthrough.patch \ |
| 24 | file://0001-Use-CC-to-check-for-implicit-fallthrough-warning-sup.patch \ | 24 | file://0001-Use-CC-to-check-for-implicit-fallthrough-warning-sup.patch \ |
| 25 | file://0001-use-memmove-instead-of-memcpy-on-overlapping-region.patch \ | ||
| 26 | file://0001-Disable-gcc8-warnings.patch \ | ||
| 25 | " | 27 | " |
| 26 | SRC_URI[md5sum] = "2cb4feffea9167ba71b5f346a0c0a40d" | 28 | SRC_URI[md5sum] = "2cb4feffea9167ba71b5f346a0c0a40d" |
| 27 | SRC_URI[sha256sum] = "1d6ae7f24ced3a0fa7b5613b32f4a589bb4881e3946a5a2c3724056254ada3a9" | 29 | SRC_URI[sha256sum] = "1d6ae7f24ced3a0fa7b5613b32f4a589bb4881e3946a5a2c3724056254ada3a9" |
