From 8f0baaac381c0d743dbe281521e1b766ccb17c9e Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Thu, 22 Aug 2013 19:00:25 +0200 Subject: [PATCH] * configure.ac: Add -Wl,-melf_i386 and -Wl,-melf_x86_64 systematically when on x86 and not cygwin. * conf/Makefile.common: Remove unsystematic -Wl,-melf_i386 and -Wl,-melf_x86_64. --- ChangeLog | 7 +++++++ conf/Makefile.common | 6 ------ configure.ac | 9 +++++++++ 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 361faaa14..a9a3db909 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2013-08-22 Vladimir Serbinenko + + * configure.ac: Add -Wl,-melf_i386 and -Wl,-melf_x86_64 systematically + when on x86 and not cygwin. + * conf/Makefile.common: Remove unsystematic -Wl,-melf_i386 and + -Wl,-melf_x86_64. + 2013-08-22 Vladimir Serbinenko * configure.ac: Set CPP to build one when checkoing for freetype for diff --git a/conf/Makefile.common b/conf/Makefile.common index 2320ad053..465fd7424 100644 --- a/conf/Makefile.common +++ b/conf/Makefile.common @@ -10,12 +10,6 @@ unexport LC_ALL if COND_i386_pc CFLAGS_PLATFORM += -mrtd -mregparm=3 endif -if COND_i386_efi - LDFLAGS_PLATFORM = -Wl,-melf_i386 -endif -if COND_x86_64_efi - LDFLAGS_PLATFORM = -Wl,-melf_x86_64 -endif if COND_i386_qemu CFLAGS_PLATFORM += -mrtd -mregparm=3 endif diff --git a/configure.ac b/configure.ac index de9cb24a5..58dd2b872 100644 --- a/configure.ac +++ b/configure.ac @@ -617,6 +617,15 @@ if test "x$target_m64" = x1; then TARGET_MODULE_FORMAT="elf64" fi +if test x"$target_os" != xcygwin; then + if test x"$target_cpu" = xi386; then + TARGET_LDFLAGS="$TARGET_LDFLAGS -Wl,-melf_i386" + fi + if test x"$target_cpu" = xx86_64; then + TARGET_LDFLAGS="$TARGET_LDFLAGS -Wl,-melf_x86_64" + fi +fi + if test "$target_cpu" = x86_64; then # Use large model to support 4G memory AC_CACHE_CHECK([whether option -mcmodel=large works], grub_cv_cc_mcmodel, [