diff options
| author | Nitin A Kamble <nitin.a.kamble@intel.com> | 2011-05-06 10:23:21 -0700 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-05-11 17:14:25 +0100 |
| commit | b6e4c1a9a964a8bb68587c083557bbe81d2d503d (patch) | |
| tree | faaaa34ab5c3efcc2b8a26d927b935d0e0dc394b | |
| parent | 64a47c3d0afa14a4fb34695d9e84e530921791d5 (diff) | |
| download | poky-b6e4c1a9a964a8bb68587c083557bbe81d2d503d.tar.gz | |
mdadm: compilation fix for gcc 4.6.0
(From OE-Core rev: 74fd7ecef8887c66607726d285bf8f49cee11e67)
Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | meta/recipes-extended/mdadm/mdadm/fix_for_compilation_with_gcc-4.6.0.patch | 174 | ||||
| -rw-r--r-- | meta/recipes-extended/mdadm/mdadm_3.2.1.bb | 5 |
2 files changed, 177 insertions, 2 deletions
diff --git a/meta/recipes-extended/mdadm/mdadm/fix_for_compilation_with_gcc-4.6.0.patch b/meta/recipes-extended/mdadm/mdadm/fix_for_compilation_with_gcc-4.6.0.patch new file mode 100644 index 0000000000..f79511b42c --- /dev/null +++ b/meta/recipes-extended/mdadm/mdadm/fix_for_compilation_with_gcc-4.6.0.patch | |||
| @@ -0,0 +1,174 @@ | |||
| 1 | Upstream-Status: Pending | ||
| 2 | |||
| 3 | Nitin A Kamble <nitin.a.kamble@intel.com> 2011/05/06 | ||
| 4 | |||
| 5 | Fix these compilation errors with gcc 4.6.0 | ||
| 6 | |||
| 7 | | super1.c: In function 'calc_sb_1_csum': | ||
| 8 | | super1.c:114:6: error: variable 'i' set but not used [-Werror=unused-but-set-variable] | ||
| 9 | | Query.c: In function 'Query': | ||
| 10 | | Query.c:38:16: error: variable 'superrno' set but not used [-Werror=unused-but-set-variable] | ||
| 11 | | super1.c: In function 'examine_super1': | ||
| 12 | | super1.c:390:7: error: variable 'me' set but not used [-Werror=unused-but-set-variable] | ||
| 13 | | cc1: all warnings being treated as errors | ||
| 14 | | | ||
| 15 | | make: *** [Query.o] Error 1 | ||
| 16 | | make: *** Waiting for unfinished jobs.... | ||
| 17 | | mdadm.c: In function 'main': | ||
| 18 | | mdadm.c:106:6: error: variable 'auto_update_home' set but not used [-Werror=unused-but-set-variable] | ||
| 19 | | mdmon.c: In function 'mdmon': | ||
| 20 | | mdmon.c:354:6: error: variable 'ignore' set but not used [-Werror=unused-but-set-variable] | ||
| 21 | | cc1: all warnings being treated as errors | ||
| 22 | | | ||
| 23 | | make: *** [mdmon.o] Error 1 | ||
| 24 | | cc1: all warnings being treated as errors | ||
| 25 | | | ||
| 26 | | sysfs.c: In function 'sysfs_uevent': | ||
| 27 | | sysfs.c:421:6: error: variable 'n' set but not used [-Werror=unused-but-set-variable] | ||
| 28 | | cc1: all warnings being treated as errors | ||
| 29 | | | ||
| 30 | | make: *** [mdadm.o] Error 1 | ||
| 31 | | make: *** [super1.o] Error 1 | ||
| 32 | | cc1: all warnings being treated as errors | ||
| 33 | | | ||
| 34 | | make: *** [sysfs.o] Error 1 | ||
| 35 | | Grow.c: In function 'Grow_reshape': | ||
| 36 | | Grow.c:1315:6: error: variable 'changed' set but not used [-Werror=unused-but-set-variable] | ||
| 37 | | cc1: all warnings being treated as errors | ||
| 38 | | | ||
| 39 | | make: *** [Grow.o] Error 1 | ||
| 40 | | ERROR: oe_runmake failed | ||
| 41 | |||
| 42 | Index: mdadm-3.2.1/Grow.c | ||
| 43 | =================================================================== | ||
| 44 | --- mdadm-3.2.1.orig/Grow.c | ||
| 45 | +++ mdadm-3.2.1/Grow.c | ||
| 46 | @@ -1312,7 +1312,6 @@ int Grow_reshape(char *devname, int fd, | ||
| 47 | char *subarray = NULL; | ||
| 48 | |||
| 49 | int frozen; | ||
| 50 | - int changed = 0; | ||
| 51 | char *container = NULL; | ||
| 52 | char container_buf[20]; | ||
| 53 | int cfd = -1; | ||
| 54 | @@ -1479,7 +1478,6 @@ int Grow_reshape(char *devname, int fd, | ||
| 55 | if (!quiet) | ||
| 56 | fprintf(stderr, Name ": component size of %s has been set to %lluK\n", | ||
| 57 | devname, size); | ||
| 58 | - changed = 1; | ||
| 59 | } else if (array.level != LEVEL_CONTAINER) { | ||
| 60 | size = get_component_size(fd)/2; | ||
| 61 | if (size == 0) | ||
| 62 | Index: mdadm-3.2.1/Query.c | ||
| 63 | =================================================================== | ||
| 64 | --- mdadm-3.2.1.orig/Query.c | ||
| 65 | +++ mdadm-3.2.1/Query.c | ||
| 66 | @@ -35,7 +35,7 @@ int Query(char *dev) | ||
| 67 | int fd = open(dev, O_RDONLY); | ||
| 68 | int vers; | ||
| 69 | int ioctlerr; | ||
| 70 | - int superror, superrno; | ||
| 71 | + int superror; | ||
| 72 | struct mdinfo info; | ||
| 73 | mdu_array_info_t array; | ||
| 74 | struct supertype *st = NULL; | ||
| 75 | @@ -84,7 +84,6 @@ int Query(char *dev) | ||
| 76 | st = guess_super(fd); | ||
| 77 | if (st) { | ||
| 78 | superror = st->ss->load_super(st, fd, dev); | ||
| 79 | - superrno = errno; | ||
| 80 | } else | ||
| 81 | superror = -1; | ||
| 82 | close(fd); | ||
| 83 | Index: mdadm-3.2.1/mdadm.c | ||
| 84 | =================================================================== | ||
| 85 | --- mdadm-3.2.1.orig/mdadm.c | ||
| 86 | +++ mdadm-3.2.1/mdadm.c | ||
| 87 | @@ -103,7 +103,7 @@ int main(int argc, char *argv[]) | ||
| 88 | char *shortopt = short_options; | ||
| 89 | int dosyslog = 0; | ||
| 90 | int rebuild_map = 0; | ||
| 91 | - int auto_update_home = 0; | ||
| 92 | + int __attribute__((__unused__)) auto_update_home = 0; | ||
| 93 | char *subarray = NULL; | ||
| 94 | char *remove_path = NULL; | ||
| 95 | char *udev_filename = NULL; | ||
| 96 | Index: mdadm-3.2.1/mdmon.c | ||
| 97 | =================================================================== | ||
| 98 | --- mdadm-3.2.1.orig/mdmon.c | ||
| 99 | +++ mdadm-3.2.1/mdmon.c | ||
| 100 | @@ -351,7 +351,6 @@ static int mdmon(char *devname, int devn | ||
| 101 | struct sigaction act; | ||
| 102 | int pfd[2]; | ||
| 103 | int status; | ||
| 104 | - int ignore; | ||
| 105 | pid_t victim = -1; | ||
| 106 | int victim_sock = -1; | ||
| 107 | |||
| 108 | @@ -459,7 +458,6 @@ static int mdmon(char *devname, int devn | ||
| 109 | if (victim >= 0) | ||
| 110 | victim_sock = connect_monitor(container->devname); | ||
| 111 | |||
| 112 | - ignore = chdir("/"); | ||
| 113 | if (!takeover && victim > 0 && victim_sock >= 0) { | ||
| 114 | if (fping_monitor(victim_sock) == 0) { | ||
| 115 | fprintf(stderr, "mdmon: %s already managed\n", | ||
| 116 | @@ -507,10 +505,8 @@ static int mdmon(char *devname, int devn | ||
| 117 | close(0); | ||
| 118 | open("/dev/null", O_RDWR); | ||
| 119 | close(1); | ||
| 120 | - ignore = dup(0); | ||
| 121 | #ifndef DEBUG | ||
| 122 | close(2); | ||
| 123 | - ignore = dup(0); | ||
| 124 | #endif | ||
| 125 | |||
| 126 | do_manager(container); | ||
| 127 | Index: mdadm-3.2.1/super1.c | ||
| 128 | =================================================================== | ||
| 129 | --- mdadm-3.2.1.orig/super1.c | ||
| 130 | +++ mdadm-3.2.1/super1.c | ||
| 131 | @@ -111,7 +111,6 @@ static unsigned int calc_sb_1_csum(struc | ||
| 132 | unsigned long long newcsum; | ||
| 133 | int size = sizeof(*sb) + __le32_to_cpu(sb->max_dev)*2; | ||
| 134 | unsigned int *isuper = (unsigned int*)sb; | ||
| 135 | - int i; | ||
| 136 | |||
| 137 | /* make sure I can count... */ | ||
| 138 | if (offsetof(struct mdp_superblock_1,data_offset) != 128 || | ||
| 139 | @@ -123,7 +122,7 @@ static unsigned int calc_sb_1_csum(struc | ||
| 140 | disk_csum = sb->sb_csum; | ||
| 141 | sb->sb_csum = 0; | ||
| 142 | newcsum = 0; | ||
| 143 | - for (i=0; size>=4; size -= 4 ) { | ||
| 144 | + for (; size>=4; size -= 4 ) { | ||
| 145 | newcsum += __le32_to_cpu(*isuper); | ||
| 146 | isuper++; | ||
| 147 | } | ||
| 148 | @@ -387,13 +386,10 @@ static void examine_super1(struct supert | ||
| 149 | printf(" Array State : "); | ||
| 150 | for (d=0; d<__le32_to_cpu(sb->raid_disks) + delta_extra; d++) { | ||
| 151 | int cnt = 0; | ||
| 152 | - int me = 0; | ||
| 153 | unsigned int i; | ||
| 154 | for (i=0; i< __le32_to_cpu(sb->max_dev); i++) { | ||
| 155 | unsigned int role = __le16_to_cpu(sb->dev_roles[i]); | ||
| 156 | if (role == d) { | ||
| 157 | - if (i == __le32_to_cpu(sb->dev_number)) | ||
| 158 | - me = 1; | ||
| 159 | cnt++; | ||
| 160 | } | ||
| 161 | } | ||
| 162 | Index: mdadm-3.2.1/sysfs.c | ||
| 163 | =================================================================== | ||
| 164 | --- mdadm-3.2.1.orig/sysfs.c | ||
| 165 | +++ mdadm-3.2.1/sysfs.c | ||
| 166 | @@ -418,7 +418,7 @@ int sysfs_set_num(struct mdinfo *sra, st | ||
| 167 | int sysfs_uevent(struct mdinfo *sra, char *event) | ||
| 168 | { | ||
| 169 | char fname[50]; | ||
| 170 | - int n; | ||
| 171 | + int __attribute__((__unused__)) n; | ||
| 172 | int fd; | ||
| 173 | |||
| 174 | sprintf(fname, "/sys/block/%s/uevent", | ||
diff --git a/meta/recipes-extended/mdadm/mdadm_3.2.1.bb b/meta/recipes-extended/mdadm/mdadm_3.2.1.bb index 937abad845..80fe520293 100644 --- a/meta/recipes-extended/mdadm/mdadm_3.2.1.bb +++ b/meta/recipes-extended/mdadm/mdadm_3.2.1.bb | |||
| @@ -8,9 +8,10 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3 \ | |||
| 8 | file://mdmon.c;beginline=4;endline=18;md5=af7d8444d9c4d3e5c7caac0d9d34039d \ | 8 | file://mdmon.c;beginline=4;endline=18;md5=af7d8444d9c4d3e5c7caac0d9d34039d \ |
| 9 | file://mdadm.h;beglinlne=4;endline=22;md5=462bc9936ac0d3da110191a3f9994161" | 9 | file://mdadm.h;beglinlne=4;endline=22;md5=462bc9936ac0d3da110191a3f9994161" |
| 10 | 10 | ||
| 11 | PR = "r0" | 11 | PR = "r1" |
| 12 | 12 | ||
| 13 | SRC_URI = "${KERNELORG_MIRROR}/linux/utils/raid/mdadm/${BPN}-${PV}.tar.bz2" | 13 | SRC_URI = "${KERNELORG_MIRROR}/linux/utils/raid/mdadm/${BPN}-${PV}.tar.bz2 \ |
| 14 | file://fix_for_compilation_with_gcc-4.6.0.patch" | ||
| 14 | 15 | ||
| 15 | SRC_URI[md5sum] = "d1e2549202bd79d9e99f1498d1109530" | 16 | SRC_URI[md5sum] = "d1e2549202bd79d9e99f1498d1109530" |
| 16 | SRC_URI[sha256sum] = "7f68f149c6c0e8893d0b9220ac255b46af08e6a6b81223cab57ed54d628ae125" | 17 | SRC_URI[sha256sum] = "7f68f149c6c0e8893d0b9220ac255b46af08e6a6b81223cab57ed54d628ae125" |
