diff options
| author | Nitin A Kamble <nitin.a.kamble@intel.com> | 2012-04-14 01:59:07 -0700 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-04-14 13:26:01 +0100 |
| commit | 3d23afdc7a7f79ebdb324fd97d45420ca62dd869 (patch) | |
| tree | 8cde9d06f1aa9b1b2e74e0fc622dbb545cb98caa | |
| parent | 53d629496f344d07e7ab261d789918cd80308b45 (diff) | |
| download | poky-3d23afdc7a7f79ebdb324fd97d45420ca62dd869.tar.gz | |
grub-efi-native, grub: fix build with gcc 4.7
This fixes bug [YOCTO #2293]
These build failure caused by gcc4.7 is fixed with a backport of a
grub-1.99 patch from fedora 17 alpha plus two more new patches
| gcc -DHAVE_CONFIG_H -I. -I.. -Wall -W -I../include -I../include
-DGRUB_MACHINE_EFI=1 -DGRUB_MACHINE=I386_EFI -nostdinc -isystem
/usr/lib/gcc/x86_64-redhat-linux/4.7.0/include
-DGRUB_FILE=\"commands/efi/acpi.c\" -I. -I. -I.. -I.. -I../include
-I../include
-isystem/home/nitin/builds/build0/tmp/sysroots/x86_64-linux/usr/include
-O2 -pipe -g -feliminate-unused-debug-types -Wall -W -Wshadow
-Wpointer-arith -Wmissing-prototypes -Wundef -Wstrict-prototypes -g
-falign-jumps=1 -falign-loops=1 -falign-functions=1 -mno-mmx -mno-sse
-mno-sse2 -mno-3dnow -fno-dwarf2-cfi-asm -m32 -fno-stack-protector
-mno-stack-arg-probe -Werror -Wno-trampolines -ffreestanding
-isystem/home/nitin/builds/build0/tmp/sysroots/x86_64-linux/usr/include
-O2 -pipe -c -o commands/efi/acpi_module-acpi.o `test -f
'commands/efi/acpi.c' || echo './'`commands/efi/acpi.c
| gcc: error: unrecognized command line option '-melf_i386'
| make[3]: *** [trig.module] Error 1
| make[3]: Entering directory
`/home/nitin/builds/build0/tmp/work/x86_64-linux/grub-efi-i586-native-1.99-r7/grub-1.99/grub-core'
| gcc -DHAVE_CONFIG_H -I. -I.. -Wall -W -I../include -I../include
-DGRUB_MACHINE_EFI=1 -DGRUB_MACHINE=I386_EFI -nostdinc -isystem
/usr/lib/gcc/x86_64-redhat-linux/4.7.0/include
-DGRUB_FILE=\"fs/btrfs.c\" -I.
-I. -I.. -I.. -I../include -I../include
-isystem/home/nitin/builds/build0/tmp/sysroots/x86_64-linux/usr/include
-O2
-pipe -g -feliminate-unused-debug-types -Wall -W -Wshadow
-Wpointer-arith
-Wmissing-prototypes -Wundef -Wstrict-prototypes -g -falign-jumps=1
-falign-loops=1 -falign-functions=1 -mno-mmx -mno-sse -mno-sse2
-mno-3dnow
-fno-dwarf2-cfi-asm -m32 -fno-stack-protector -mno-stack-arg-probe
-Werror
-Wno-trampolines -ffreestanding
-isystem/home/nitin/builds/build0/tmp/sysroots/x86_64-linux/usr/include
-O2
-pipe -c -o fs/btrfs_module-btrfs.o `test -f 'fs/btrfs.c' || echo
'./'`fs/btrfs.c
| fs/btrfs.c: In function 'grub_btrfs_read_logical':
| fs/btrfs.c:791:5: error: 'err' may be used uninitialized in this
function
[-Werror=maybe-uninitialized]
| fs/btrfs.c:592:18: note: 'err' was declared here
| cc1: all warnings being treated as errors
| make[3]: *** [fs/btrfs_module-btrfs.o] Error 1
| gcc -DHAVE_CONFIG_H -I. -I.. -Wall -W -I../include -I../include
-DGRUB_MACHINE_EFI=1 -DGRUB_MACHINE=I386_EFI -nostdinc -isystem
/usr/lib/gcc/x86_64-redhat-linux/4.7.0/include
-DGRUB_FILE=\"fs/zfs/zfs.c\" -I. -I. -I.. -I.. -I../include -I../include
-isystem/home/nitin/builds/build0/tmp/sysroots/x86_64-linux/usr/include
-O2 -pipe -g -feliminate-unused-debug-types -Wall -W -Wshadow
-Wpointer-arith -Wmissing-prototypes -Wundef -Wstrict-prototypes -g
-falign-jumps=1 -falign-loops=1 -falign-functions=1 -mno-mmx -mno-sse
-mno-sse2 -mno-3dnow -fno-dwarf2-cfi-asm -m32 -fno-stack-protector
-mno-stack-arg-probe -Werror -Wno-trampolines -ffreestanding
-isystem/home/nitin/builds/build0/tmp/sysroots/x86_64-linux/usr/include
-O2 -pipe -c -o fs/zfs/zfs_module-zfs.o `test -f 'fs/zfs/zfs.c' || echo
'./'`fs/zfs/zfs.c
| fs/zfs/zfs.c: In function 'get_filesystem_dnode':
| fs/zfs/zfs.c:1449:7: error: dereferencing type-punned pointer will
break strict-aliasing rules [-Werror=strict-aliasing]
| fs/zfs/zfs.c:1449:7: error: dereferencing type-punned pointer will
break strict-aliasing rules [-Werror=strict-aliasing]
| fs/zfs/zfs.c: In function 'make_mdn':
| fs/zfs/zfs.c:1478:3: error: dereferencing type-punned pointer will
break strict-alERROR: Function failed: do_compile (see
/home/nitin/builds/build0/tmp/work/x86_64-linux/grub-efi-i586-native-1.99-r7/temp/log.do_compile.9293
for further information)
| iasing rules [-Werror=strict-aliasing]
| fs/zfs/zfs.c: In function 'dnode_get_fullpath':
| fs/zfs/zfs.c:1554:3: error: dereferencing type-punned pointer will
break strict-aliasing rules [-Werror=strict-aliasing]
| fs/zfs/zfs.c:1554:3: error: dereferencing type-punned pointer will
break strict-aliasing rules [-Werror=strict-aliasing]
| fs/zfs/zfs.c:1571:7: error: dereferencing type-punned pointer will
break strict-aliasing rules [-Werror=strict-aliasing]
| fs/zfs/zfs.c:1571:7: error: dereferencing type-punned pointer will
break strict-aliasing rules [-Werror=strict-aliasing]
| fs/zfs/zfs.c: In function 'grub_zfs_open':
| fs/zfs/zfs.c:2234:7: error: dereferencing type-punned pointer will
break strict-aliasing rules [-Werror=strict-aliasing]
| fs/zfs/zfs.c:2234:7: error: dereferencing type-punned pointer will
break strict-aliasing rules [-Werror=strict-aliasing]
| fs/zfs/zfs.c: In function 'fill_fs_info':
| fs/zfs/zfs.c:2362:7: error: dereferencing type-punned pointer will
break strict-aliasing rules [-Werror=strict-aliasing]
| fs/zfs/zfs.c:2362:7: error: dereferencing type-punned pointer will
break strict-aliasing rules [-Werror=strict-aliasing]
| fs/zfs/zfs.c:2395:3: error: dereferencing type-punned pointer will
break strict-aliasing rules [-Werror=strict-aliasing]
| fs/zfs/zfs.c:2395:3: error: dereferencing type-punned pointer will
break strict-aliasing rules [-Werror=strict-aliasing]
| fs/zfs/zfs.c: In function 'iterate_zap':
| fs/zfs/zfs.c:2420:5: error: dereferencing type-punned pointer will
break strict-aliasing rules [-Werror=strict-aliasing]
| fs/zfs/zfs.c:2420:5: error: dereferencing type-punned pointer will
break strict-aliasing rules [-Werror=strict-aliasing]
| fs/zfs/zfs.c: In function 'grub_zfs_dir':
| fs/zfs/zfs.c:2483:7: error: dereferencing type-punned pointer will
break strict-aliasing rules [-Werror=strict-aliasing]
| fs/zfs/zfs.c:2483:7: error: dereferencing type-punned pointer will
break strict-aliasing rules [-Werror=strict-aliasing]
| fs/zfs/zfs.c:2484:7: error: dereferencing type-punned pointer will
break strict-aliasing rules [-Werror=strict-aliasing]
| fs/zfs/zfs.c:2484:7: error: dereferencing type-punned pointer will
break strict-aliasing rules [-Werror=strict-aliasing]
| fs/zfs/zfs.c:2502:7: error: dereferencing type-punned pointer will
break strict-aliasing rules [-Werror=strict-aliasing]
| fs/zfs/zfs.c:2502:7: error: dereferencing type-punned pointer will
break strict-aliasing rules [-Werror=strict-aliasing]
| cc1: all warnings being treated as errors
| make[3]: *** [fs/zfs/zfs_module-zfs.o] Error 1
(From OE-Core rev: b0f6dc60c926c2a653485e0016fbdc2ac5eb0cb4)
Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
5 files changed, 232 insertions, 3 deletions
diff --git a/meta/recipes-bsp/grub/files/grub-1.99-gcc-4.7.0-strict-aliasing-errors.patch b/meta/recipes-bsp/grub/files/grub-1.99-gcc-4.7.0-strict-aliasing-errors.patch new file mode 100644 index 0000000000..9d81050e43 --- /dev/null +++ b/meta/recipes-bsp/grub/files/grub-1.99-gcc-4.7.0-strict-aliasing-errors.patch | |||
| @@ -0,0 +1,147 @@ | |||
| 1 | Upstream-Status: Pending | ||
| 2 | |||
| 3 | This patch fixes these strick-aliasing errors with gcc 4.7 | ||
| 4 | |||
| 5 | |||
| 6 | | gcc -DHAVE_CONFIG_H -I. -I.. -Wall -W -I../include -I../include -DGRUB_MACHINE_EFI=1 -DGRUB_MACHINE=I386_EFI -nostdinc -isystem /usr/lib/gcc/x86_64-redhat-linux/4.7.0/include -DGRUB_FILE=\"fs/zfs/zfs.c\" -I. -I. -I.. -I.. -I../include -I../include -isystem/home/nitin/builds/build0/tmp/sysroots/x86_64-linux/usr/include -O2 -pipe -g -feliminate-unused-debug-types -Wall -W -Wshadow -Wpointer-arith -Wmissing-prototypes -Wundef -Wstrict-prototypes -g -falign-jumps=1 -falign-loops=1 -falign-functions=1 -mno-mmx -mno-sse -mno-sse2 -mno-3dnow -fno-dwarf2-cfi-asm -m32 -fno-stack-protector -mno-stack-arg-probe -Werror -Wno-trampolines -ffreestanding -isystem/home/nitin/builds/build0/tmp/sysroots/x86_64-linux/usr/include -O2 -pipe -c -o fs/zfs/zfs_module-zfs.o `test -f 'fs/zfs/zfs.c' || echo './'`fs/zfs/zfs.c | ||
| 7 | | fs/zfs/zfs.c: In function 'get_filesystem_dnode': | ||
| 8 | | fs/zfs/zfs.c:1449:7: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] | ||
| 9 | | fs/zfs/zfs.c:1449:7: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] | ||
| 10 | | fs/zfs/zfs.c: In function 'make_mdn': | ||
| 11 | | fs/zfs/zfs.c:1478:3: error: dereferencing type-punned pointer will break strict-alERROR: Function failed: do_compile (see /home/nitin/builds/build0/tmp/work/x86_64-linux/grub-efi-i586-native-1.99-r7/temp/log.do_compile.9293 for further information) | ||
| 12 | | iasing rules [-Werror=strict-aliasing] | ||
| 13 | | fs/zfs/zfs.c: In function 'dnode_get_fullpath': | ||
| 14 | | fs/zfs/zfs.c:1554:3: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] | ||
| 15 | | fs/zfs/zfs.c:1554:3: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] | ||
| 16 | | fs/zfs/zfs.c:1571:7: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] | ||
| 17 | | fs/zfs/zfs.c:1571:7: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] | ||
| 18 | | fs/zfs/zfs.c: In function 'grub_zfs_open': | ||
| 19 | | fs/zfs/zfs.c:2234:7: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] | ||
| 20 | | fs/zfs/zfs.c:2234:7: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] | ||
| 21 | | fs/zfs/zfs.c: In function 'fill_fs_info': | ||
| 22 | | fs/zfs/zfs.c:2362:7: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] | ||
| 23 | | fs/zfs/zfs.c:2362:7: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] | ||
| 24 | | fs/zfs/zfs.c:2395:3: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] | ||
| 25 | | fs/zfs/zfs.c:2395:3: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] | ||
| 26 | | fs/zfs/zfs.c: In function 'iterate_zap': | ||
| 27 | | fs/zfs/zfs.c:2420:5: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] | ||
| 28 | | fs/zfs/zfs.c:2420:5: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] | ||
| 29 | | fs/zfs/zfs.c: In function 'grub_zfs_dir': | ||
| 30 | | fs/zfs/zfs.c:2483:7: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] | ||
| 31 | | fs/zfs/zfs.c:2483:7: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] | ||
| 32 | | fs/zfs/zfs.c:2484:7: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] | ||
| 33 | | fs/zfs/zfs.c:2484:7: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] | ||
| 34 | | fs/zfs/zfs.c:2502:7: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] | ||
| 35 | | fs/zfs/zfs.c:2502:7: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] | ||
| 36 | | cc1: all warnings being treated as errors | ||
| 37 | | make[3]: *** [fs/zfs/zfs_module-zfs.o] Error 1 | ||
| 38 | |||
| 39 | Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com> | ||
| 40 | 2012/04/13 | ||
| 41 | |||
| 42 | Index: grub-1.99/grub-core/fs/zfs/zfs.c | ||
| 43 | =================================================================== | ||
| 44 | --- grub-1.99.orig/grub-core/fs/zfs/zfs.c | ||
| 45 | +++ grub-1.99/grub-core/fs/zfs/zfs.c | ||
| 46 | @@ -1446,7 +1446,8 @@ get_filesystem_dnode (dnode_end_t * mosm | ||
| 47 | ch = *fsname; | ||
| 48 | *fsname = 0; | ||
| 49 | |||
| 50 | - childobj = grub_zfs_to_cpu64 ((((dsl_dir_phys_t *) DN_BONUS (&mdn->dn)))->dd_child_dir_zapobj, mdn->endian); | ||
| 51 | + dsl_dir_phys_t * tmp = DN_BONUS (&mdn->dn); | ||
| 52 | + childobj = grub_zfs_to_cpu64 (tmp->dd_child_dir_zapobj, mdn->endian); | ||
| 53 | err = dnode_get (mosmdn, childobj, | ||
| 54 | DMU_OT_DSL_DIR_CHILD_MAP, mdn, data); | ||
| 55 | if (err) | ||
| 56 | @@ -1475,7 +1476,8 @@ make_mdn (dnode_end_t * mdn, struct grub | ||
| 57 | |||
| 58 | grub_dprintf ("zfs", "endian = %d\n", mdn->endian); | ||
| 59 | |||
| 60 | - bp = &(((dsl_dataset_phys_t *) DN_BONUS (&mdn->dn))->ds_bp); | ||
| 61 | + dsl_dataset_phys_t * tmp = DN_BONUS(&mdn->dn); | ||
| 62 | + bp = &(tmp->ds_bp); | ||
| 63 | err = zio_read (bp, mdn->endian, &osp, &ospsize, data); | ||
| 64 | if (err) | ||
| 65 | return err; | ||
| 66 | @@ -1551,7 +1553,8 @@ dnode_get_fullpath (const char *fullpath | ||
| 67 | |||
| 68 | grub_dprintf ("zfs", "alive\n"); | ||
| 69 | |||
| 70 | - headobj = grub_zfs_to_cpu64 (((dsl_dir_phys_t *) DN_BONUS (&dn->dn))->dd_head_dataset_obj, dn->endian); | ||
| 71 | + dsl_dir_phys_t * tmp1 = DN_BONUS (&dn->dn); | ||
| 72 | + headobj = grub_zfs_to_cpu64 (tmp1->dd_head_dataset_obj, dn->endian); | ||
| 73 | |||
| 74 | grub_dprintf ("zfs", "endian = %d\n", mdn->endian); | ||
| 75 | |||
| 76 | @@ -1568,7 +1571,8 @@ dnode_get_fullpath (const char *fullpath | ||
| 77 | { | ||
| 78 | grub_uint64_t snapobj; | ||
| 79 | |||
| 80 | - snapobj = grub_zfs_to_cpu64 (((dsl_dataset_phys_t *) DN_BONUS (&mdn->dn))->ds_snapnames_zapobj, mdn->endian); | ||
| 81 | + dsl_dataset_phys_t * tmp2 = DN_BONUS (&mdn->dn); | ||
| 82 | + snapobj = grub_zfs_to_cpu64 (tmp2->ds_snapnames_zapobj, mdn->endian); | ||
| 83 | |||
| 84 | err = dnode_get (&(data->mos), snapobj, | ||
| 85 | DMU_OT_DSL_DS_SNAP_MAP, mdn, data); | ||
| 86 | @@ -2231,7 +2235,8 @@ grub_zfs_open (struct grub_file *file, c | ||
| 87 | } | ||
| 88 | else | ||
| 89 | { | ||
| 90 | - file->size = grub_zfs_to_cpu64 (((znode_phys_t *) DN_BONUS (&data->dnode.dn))->zp_size, data->dnode.endian); | ||
| 91 | + znode_phys_t * tmp = DN_BONUS (&data->dnode.dn); | ||
| 92 | + file->size = grub_zfs_to_cpu64 (tmp->zp_size, data->dnode.endian); | ||
| 93 | } | ||
| 94 | |||
| 95 | file->data = data; | ||
| 96 | @@ -2359,7 +2364,8 @@ fill_fs_info (struct grub_dirhook_info * | ||
| 97 | |||
| 98 | if (mdn.dn.dn_type == DMU_OT_DSL_DIR) | ||
| 99 | { | ||
| 100 | - headobj = grub_zfs_to_cpu64 (((dsl_dir_phys_t *) DN_BONUS (&mdn.dn))->dd_head_dataset_obj, mdn.endian); | ||
| 101 | + dsl_dir_phys_t * tmp1 = DN_BONUS (&mdn.dn); | ||
| 102 | + headobj = grub_zfs_to_cpu64 (tmp1->dd_head_dataset_obj, mdn.endian); | ||
| 103 | |||
| 104 | err = dnode_get (&(data->mos), headobj, DMU_OT_DSL_DATASET, &mdn, data); | ||
| 105 | if (err) | ||
| 106 | @@ -2392,7 +2398,8 @@ fill_fs_info (struct grub_dirhook_info * | ||
| 107 | } | ||
| 108 | |||
| 109 | info->mtimeset = 1; | ||
| 110 | - info->mtime = grub_zfs_to_cpu64 (((znode_phys_t *) DN_BONUS (&dn.dn))->zp_mtime[0], dn.endian); | ||
| 111 | + znode_phys_t * tmp2 = DN_BONUS (&dn.dn); | ||
| 112 | + info->mtime = grub_zfs_to_cpu64 (tmp2->zp_mtime[0], dn.endian); | ||
| 113 | return; | ||
| 114 | } | ||
| 115 | |||
| 116 | @@ -2417,7 +2424,8 @@ grub_zfs_dir (grub_device_t device, cons | ||
| 117 | |||
| 118 | dnode_get (&(data->mdn), val, 0, &dn, data); | ||
| 119 | info.mtimeset = 1; | ||
| 120 | - info.mtime = grub_zfs_to_cpu64 (((znode_phys_t *) DN_BONUS (&dn.dn))->zp_mtime[0], dn.endian); | ||
| 121 | + znode_phys_t * tmp1 = DN_BONUS (&dn.dn); | ||
| 122 | + info.mtime = grub_zfs_to_cpu64 (tmp1->zp_mtime[0], dn.endian); | ||
| 123 | info.dir = (dn.dn.dn_type == DMU_OT_DIRECTORY_CONTENTS); | ||
| 124 | grub_dprintf ("zfs", "type=%d, name=%s\n", | ||
| 125 | (int)dn.dn.dn_type, (char *)name); | ||
| 126 | @@ -2480,8 +2488,9 @@ grub_zfs_dir (grub_device_t device, cons | ||
| 127 | fill_fs_info (&info, data->dnode, data); | ||
| 128 | hook ("@", &info); | ||
| 129 | |||
| 130 | - childobj = grub_zfs_to_cpu64 (((dsl_dir_phys_t *) DN_BONUS (&data->dnode.dn))->dd_child_dir_zapobj, data->dnode.endian); | ||
| 131 | - headobj = grub_zfs_to_cpu64 (((dsl_dir_phys_t *) DN_BONUS (&data->dnode.dn))->dd_head_dataset_obj, data->dnode.endian); | ||
| 132 | + dsl_dir_phys_t * tmp2 = DN_BONUS (&data->dnode.dn); | ||
| 133 | + childobj = grub_zfs_to_cpu64 (tmp2->dd_child_dir_zapobj, data->dnode.endian); | ||
| 134 | + headobj = grub_zfs_to_cpu64 (tmp2->dd_head_dataset_obj, data->dnode.endian); | ||
| 135 | err = dnode_get (&(data->mos), childobj, | ||
| 136 | DMU_OT_DSL_DIR_CHILD_MAP, &dn, data); | ||
| 137 | if (err) | ||
| 138 | @@ -2499,7 +2508,8 @@ grub_zfs_dir (grub_device_t device, cons | ||
| 139 | return err; | ||
| 140 | } | ||
| 141 | |||
| 142 | - snapobj = grub_zfs_to_cpu64 (((dsl_dataset_phys_t *) DN_BONUS (&dn.dn))->ds_snapnames_zapobj, dn.endian); | ||
| 143 | + dsl_dataset_phys_t * tmp3 = DN_BONUS (&dn.dn); | ||
| 144 | + snapobj = grub_zfs_to_cpu64 (tmp3->ds_snapnames_zapobj, dn.endian); | ||
| 145 | |||
| 146 | err = dnode_get (&(data->mos), snapobj, | ||
| 147 | DMU_OT_DSL_DS_SNAP_MAP, &dn, data); | ||
diff --git a/meta/recipes-bsp/grub/files/grub-1.99-gcc-4.7.0-uninitialized-var-errors.patch b/meta/recipes-bsp/grub/files/grub-1.99-gcc-4.7.0-uninitialized-var-errors.patch new file mode 100644 index 0000000000..397d11f452 --- /dev/null +++ b/meta/recipes-bsp/grub/files/grub-1.99-gcc-4.7.0-uninitialized-var-errors.patch | |||
| @@ -0,0 +1,41 @@ | |||
| 1 | UpstreamStatus: Pending | ||
| 2 | |||
| 3 | This patch quitens this error: | ||
| 4 | |||
| 5 | | make[3]: Entering directory | ||
| 6 | `/home/nitin/builds/build0/tmp/work/x86_64-linux/grub-efi-i586-native-1.99-r7/grub-1.99/grub-core' | ||
| 7 | | gcc -DHAVE_CONFIG_H -I. -I.. -Wall -W -I../include -I../include | ||
| 8 | -DGRUB_MACHINE_EFI=1 -DGRUB_MACHINE=I386_EFI -nostdinc -isystem | ||
| 9 | /usr/lib/gcc/x86_64-redhat-linux/4.7.0/include -DGRUB_FILE=\"fs/btrfs.c\" -I. | ||
| 10 | -I. -I.. -I.. -I../include -I../include | ||
| 11 | -isystem/home/nitin/builds/build0/tmp/sysroots/x86_64-linux/usr/include -O2 | ||
| 12 | -pipe -g -feliminate-unused-debug-types -Wall -W -Wshadow -Wpointer-arith | ||
| 13 | -Wmissing-prototypes -Wundef -Wstrict-prototypes -g -falign-jumps=1 | ||
| 14 | -falign-loops=1 -falign-functions=1 -mno-mmx -mno-sse -mno-sse2 -mno-3dnow | ||
| 15 | -fno-dwarf2-cfi-asm -m32 -fno-stack-protector -mno-stack-arg-probe -Werror | ||
| 16 | -Wno-trampolines -ffreestanding | ||
| 17 | -isystem/home/nitin/builds/build0/tmp/sysroots/x86_64-linux/usr/include -O2 | ||
| 18 | -pipe -c -o fs/btrfs_module-btrfs.o `test -f 'fs/btrfs.c' || echo | ||
| 19 | './'`fs/btrfs.c | ||
| 20 | | fs/btrfs.c: In function 'grub_btrfs_read_logical': | ||
| 21 | | fs/btrfs.c:791:5: error: 'err' may be used uninitialized in this function | ||
| 22 | [-Werror=maybe-uninitialized] | ||
| 23 | | fs/btrfs.c:592:18: note: 'err' was declared here | ||
| 24 | | cc1: all warnings being treated as errors | ||
| 25 | | make[3]: *** [fs/btrfs_module-btrfs.o] Error 1 | ||
| 26 | |||
| 27 | Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com> | ||
| 28 | 2012/04/13 | ||
| 29 | Index: grub-1.99/grub-core/fs/btrfs.c | ||
| 30 | =================================================================== | ||
| 31 | --- grub-1.99.orig/grub-core/fs/btrfs.c | ||
| 32 | +++ grub-1.99/grub-core/fs/btrfs.c | ||
| 33 | @@ -589,7 +589,7 @@ grub_btrfs_read_logical (struct grub_btr | ||
| 34 | struct grub_btrfs_key *key; | ||
| 35 | struct grub_btrfs_chunk_item *chunk; | ||
| 36 | grub_uint64_t csize; | ||
| 37 | - grub_err_t err; | ||
| 38 | + grub_err_t err = 0; | ||
| 39 | struct grub_btrfs_key key_out; | ||
| 40 | int challoc = 0; | ||
| 41 | grub_device_t dev; | ||
diff --git a/meta/recipes-bsp/grub/files/grub-1.99-gcc-4.7.0.patch b/meta/recipes-bsp/grub/files/grub-1.99-gcc-4.7.0.patch new file mode 100644 index 0000000000..545954a307 --- /dev/null +++ b/meta/recipes-bsp/grub/files/grub-1.99-gcc-4.7.0.patch | |||
| @@ -0,0 +1,34 @@ | |||
| 1 | Upstream-Status: backport from fedora | ||
| 2 | |||
| 3 | 2012/04/13 | ||
| 4 | Signed-Off-by: Nitin A Kamble <nitin.a.kamble@intel.com> | ||
| 5 | |||
| 6 | From b0f4ef523b69a497d69820c09bbb07484a6b09cc Mon Sep 17 00:00:00 2001 | ||
| 7 | From: Peter Jones <pjones@redhat.com> | ||
| 8 | Date: Wed, 7 Mar 2012 09:53:50 -0500 | ||
| 9 | Subject: [PATCH] Fix gcc error that kills build. | ||
| 10 | |||
| 11 | --- | ||
| 12 | conf/Makefile.common | 4 ++-- | ||
| 13 | 1 files changed, 2 insertions(+), 2 deletions(-) | ||
| 14 | |||
| 15 | diff --git a/conf/Makefile.common b/conf/Makefile.common | ||
| 16 | index 2040a2e..b3ba765 100644 | ||
| 17 | --- a/conf/Makefile.common | ||
| 18 | +++ b/conf/Makefile.common | ||
| 19 | @@ -11,10 +11,10 @@ if COND_i386_pc | ||
| 20 | CFLAGS_PLATFORM += -mrtd -mregparm=3 | ||
| 21 | endif | ||
| 22 | if COND_i386_efi | ||
| 23 | - LDFLAGS_PLATFORM = -melf_i386 | ||
| 24 | + LDFLAGS_PLATFORM = -m32 | ||
| 25 | endif | ||
| 26 | if COND_x86_64_efi | ||
| 27 | - LDFLAGS_PLATFORM = -melf_x86_64 | ||
| 28 | + LDFLAGS_PLATFORM = -m64 | ||
| 29 | endif | ||
| 30 | if COND_i386_qemu | ||
| 31 | CFLAGS_PLATFORM += -mrtd -mregparm=3 | ||
| 32 | -- | ||
| 33 | 1.7.7.6 | ||
| 34 | |||
diff --git a/meta/recipes-bsp/grub/grub-efi-native_1.99.bb b/meta/recipes-bsp/grub/grub-efi-native_1.99.bb index 4f8a4bcc5d..30e9c74d39 100644 --- a/meta/recipes-bsp/grub/grub-efi-native_1.99.bb +++ b/meta/recipes-bsp/grub/grub-efi-native_1.99.bb | |||
| @@ -16,7 +16,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504" | |||
| 16 | # FIXME: We should be able to optionally drop freetype as a dependency | 16 | # FIXME: We should be able to optionally drop freetype as a dependency |
| 17 | DEPENDS = "help2man-native autogen-native" | 17 | DEPENDS = "help2man-native autogen-native" |
| 18 | RDEPENDS_${PN} = "diffutils freetype" | 18 | RDEPENDS_${PN} = "diffutils freetype" |
| 19 | PR = "r7" | 19 | PR = "r8" |
| 20 | 20 | ||
| 21 | # Native packages do not normally rebuild when the target changes. | 21 | # Native packages do not normally rebuild when the target changes. |
| 22 | # Ensure this is built once per HOST-TARGET pair. | 22 | # Ensure this is built once per HOST-TARGET pair. |
| @@ -24,7 +24,11 @@ PN := "grub-efi-${TRANSLATED_TARGET_ARCH}-native" | |||
| 24 | 24 | ||
| 25 | SRC_URI = "ftp://ftp.gnu.org/gnu/grub/grub-${PV}.tar.gz \ | 25 | SRC_URI = "ftp://ftp.gnu.org/gnu/grub/grub-${PV}.tar.gz \ |
| 26 | file://grub-1.99_fix_for_automake_1.11.2.patch \ | 26 | file://grub-1.99_fix_for_automake_1.11.2.patch \ |
| 27 | file://grub-1.99-fpmath-sse-387-fix.patch" | 27 | file://grub-1.99-fpmath-sse-387-fix.patch \ |
| 28 | file://grub-1.99-gcc-4.7.0.patch \ | ||
| 29 | file://grub-1.99-gcc-4.7.0-uninitialized-var-errors.patch \ | ||
| 30 | file://grub-1.99-gcc-4.7.0-strict-aliasing-errors.patch \ | ||
| 31 | " | ||
| 28 | 32 | ||
| 29 | SRC_URI[md5sum] = "ca9f2a2d571b57fc5c53212d1d22e2b5" | 33 | SRC_URI[md5sum] = "ca9f2a2d571b57fc5c53212d1d22e2b5" |
| 30 | SRC_URI[sha256sum] = "b91f420f2c51f6155e088e34ff99bea09cc1fb89585cf7c0179644e57abd28ff" | 34 | SRC_URI[sha256sum] = "b91f420f2c51f6155e088e34ff99bea09cc1fb89585cf7c0179644e57abd28ff" |
diff --git a/meta/recipes-bsp/grub/grub_1.99.bb b/meta/recipes-bsp/grub/grub_1.99.bb index e61147f26e..b08fa560bb 100644 --- a/meta/recipes-bsp/grub/grub_1.99.bb +++ b/meta/recipes-bsp/grub/grub_1.99.bb | |||
| @@ -12,11 +12,14 @@ LICENSE = "GPLv3" | |||
| 12 | LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504" | 12 | LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504" |
| 13 | 13 | ||
| 14 | RDEPENDS_${PN} = "diffutils freetype" | 14 | RDEPENDS_${PN} = "diffutils freetype" |
| 15 | PR = "r5" | 15 | PR = "r6" |
| 16 | 16 | ||
| 17 | SRC_URI = "ftp://ftp.gnu.org/gnu/grub/grub-${PV}.tar.gz \ | 17 | SRC_URI = "ftp://ftp.gnu.org/gnu/grub/grub-${PV}.tar.gz \ |
| 18 | file://grub-install.in.patch \ | 18 | file://grub-install.in.patch \ |
| 19 | file://grub-1.99-fpmath-sse-387-fix.patch \ | 19 | file://grub-1.99-fpmath-sse-387-fix.patch \ |
| 20 | file://grub-1.99-gcc-4.7.0.patch \ | ||
| 21 | file://grub-1.99-gcc-4.7.0-uninitialized-var-errors.patch \ | ||
| 22 | file://grub-1.99-gcc-4.7.0-strict-aliasing-errors.patch \ | ||
| 20 | file://40_custom" | 23 | file://40_custom" |
| 21 | 24 | ||
| 22 | SRC_URI[md5sum] = "ca9f2a2d571b57fc5c53212d1d22e2b5" | 25 | SRC_URI[md5sum] = "ca9f2a2d571b57fc5c53212d1d22e2b5" |
