grub-1.99: use gcc-cross for building the target binaries

It was using distro gcc to build binaries for target. This got detected
on fedora 17 alpha, on which it hit an gcc-4.7 issue.

This Fixes Bug: [Yocto #2291]

More information in the patch header

Thanks to Saul Wold for suggesting to remove the --target parameter from
EXTRA_OECONF var.

Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
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

Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
grub-1.99: fix configure error

This commit deals with this configure error.

configure:20306: checking whether `ccache i586-poky-linux-gcc  -m32
-march=core2 -msse3 -mtune=generic -mfpmath=sse
--sysroot=/builddisk/build/build0/tmp/sysroots/emenlow' generates calls
to `__enable_execute_stack()'
configure:20320: ccache i586-poky-linux-gcc  -m32    -march=core2 -msse3
-mtune=generic -mfpmath=sse
--sysroot=/builddisk/build/build0/tmp/sysroots/emenlow -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 -mfpmath=387 -fno-dwarf2-cfi-asm -m32 -fno-stack-protector
-mno-stack-arg-probe -Werror -Wno-trampolines -falign-loops=1 -S
conftest.c
conftest.c:308:6: error: no previous prototype for 'g'
[-Werror=missing-prototypes]
cc1: all warnings being treated as errors
configure:20323: $? = 1
configure:20327: error: ccache i586-poky-linux-gcc  -m32    -march=core2
-msse3 -mtune=generic -mfpmath=sse
--sysroot=/builddisk/build/build0/tmp/sysroots/emenlow failed to produce
assembly code

Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
eglibc: fix builds on fedora 17 alpha

Generally distros keep perl at /sur/bin/perl
Fedora 17 alpha also has /bin/perl

this causes eglibc build on such distros to put perl interpreter path in
the perl scripts as /bin/perl

But we set perl location for target as /usr/bin/perl

This mismatch of perl path causes failure of rootfs image creation
like this:

| error: Failed dependencies:
|       /bin/perl is needed by eglibc-utils-2.13-r23+svnr15508.i586
NOTE: package core-image-sato-1.0-r0: task do_rootfs: Failed
ERROR: Task 8
(/home/nitin/prj/poky.git/meta/recipes-sato/images/core-image-sato.bb,
do_rootfs) failed with exit code '1'

This Fixes bug : [YOCTO #2286]

RP: Updated to better account for -nativesdk
Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>