Fix grub2 for gcc 4.7.

"-melf_x86_64" is a linker option, prefix it with "-Wl".

Gcc prior to 4.7 seems to pass this option to ld, but 4.7 doesn't.

TEST=Built using gcc 4.7
BUG=None

Change-Id: I5908d34fd0f9dc939581a2eaed5cd20d282c6d3a
Reviewed-on: https://gerrit.chromium.org/gerrit/30486
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Han Shen <shenhan@chromium.org>
Tested-by: Han Shen <shenhan@chromium.org>
diff --git a/conf/x86_64-efi.mk b/conf/x86_64-efi.mk
index 4b15c31..fb2bcfe 100644
--- a/conf/x86_64-efi.mk
+++ b/conf/x86_64-efi.mk
@@ -3,7 +3,7 @@
 
 COMMON_ASFLAGS = -nostdinc -fno-builtin -m64
 COMMON_CFLAGS = -fno-builtin -m64
-COMMON_LDFLAGS = -melf_x86_64 -nostdlib
+COMMON_LDFLAGS = -Wl,-melf_x86_64 -nostdlib
 
 # Used by various components.  These rules need to precede them.
 script/sh/lexer.c_DEPENDENCIES = grub_script.tab.h
@@ -3116,4 +3116,3 @@
 
 grub-mkdevicemap: $(grub_mkdevicemap_DEPENDENCIES) $(grub_mkdevicemap_OBJECTS)
 	$(CC) -o $@ $(grub_mkdevicemap_OBJECTS) $(LDFLAGS) $(grub_mkdevicemap_LDFLAGS)
-
diff --git a/conf/x86_64-efi.rmk b/conf/x86_64-efi.rmk
index 5be1b40..ed6a467 100644
--- a/conf/x86_64-efi.rmk
+++ b/conf/x86_64-efi.rmk
@@ -2,7 +2,7 @@
 
 COMMON_ASFLAGS = -nostdinc -fno-builtin -m64
 COMMON_CFLAGS = -fno-builtin -m64
-COMMON_LDFLAGS = -melf_x86_64 -nostdlib
+COMMON_LDFLAGS = -Wl,-melf_x86_64 -nostdlib
 
 # Used by various components.  These rules need to precede them.
 script/sh/lexer.c_DEPENDENCIES = grub_script.tab.h