]> git.proxmox.com Git - grub2.git/commitdiff
2009-03-04 Bean <bean123ch@gmail.com>
authorbean <bean@localhost>
Wed, 4 Mar 2009 05:56:31 +0000 (05:56 +0000)
committerbean <bean@localhost>
Wed, 4 Mar 2009 05:56:31 +0000 (05:56 +0000)
* configure.ac: Only test -mcmodel=large option in x86_64-efi, also add
another option -mno-red-zone.

* commands/handler.c: Change module description.

* kern/handler.c: Add missing space at the end of description line.

* kern/list.c: Likewise.

ChangeLog
DISTLIST
commands/handler.c
configure
configure.ac
kern/handler.c
kern/list.c

index 329d821569f28be77328bddadf313034371c0c82..4968e0d3ceaa85f62d6788e55643e5af3f3748ea 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2009-03-04  Bean  <bean123ch@gmail.com>
+
+       * configure.ac: Only test -mcmodel=large option in x86_64-efi, also add
+       another option -mno-red-zone.
+
+       * commands/handler.c: Change module description.
+
+       * kern/handler.c: Add missing space at the end of description line.
+
+       * kern/list.c: Likewise.
+
 2009-03-03  Robert Millan  <rmh@aybabtu.com>
 
        Move more components to the relocation area, and fix mbi pointer
index 3c8bd341bd0b1580510d127a8b867d91787abf60..fbe6aef5b11fc6e76dee54a0f6191ca500026e1e 100644 (file)
--- a/DISTLIST
+++ b/DISTLIST
@@ -61,7 +61,6 @@ commands/read.c
 commands/reboot.c
 commands/search.c
 commands/sleep.c
-commands/terminal.c
 commands/test.c
 commands/usbtest.c
 commands/videotest.c
index f30337e1fed3e73273f2e64c92c2acffbe7b7c64..cb1e7baea22dd633475b25eeda69453d105a52f4 100644 (file)
@@ -1,4 +1,4 @@
-/* handler.c - test module for dynamic loading */
+/* handler.c - commands to list or select handlers */
 /*
  *  GRUB  --  GRand Unified Bootloader
  *  Copyright (C) 2009  Free Software Foundation, Inc.
index c3677c68761c4504edb614917848e668f17a74d9..b249580806647466f989df911af6cf5b991409da 100644 (file)
--- a/configure
+++ b/configure
@@ -6774,6 +6774,12 @@ fi
 
 if test "x$target_m64" = x1; then
   # Force 64-bit mode.
+  TARGET_CFLAGS="$TARGET_CFLAGS -m64"
+  TARGET_LDFLAGS="$TARGET_LDFLAGS -m64"
+fi
+
+if test "$target_cpu"-"$platform" = x86_64-efi; then
+  # Use large model to support 4G memory
   { echo "$as_me:$LINENO: checking whether option -mcmodel=large works" >&5
 echo $ECHO_N "checking whether option -mcmodel=large works... $ECHO_C" >&6; }
 if test "${grub_cv_cc_mcmodel+set}" = set; then
@@ -6826,13 +6832,72 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 { echo "$as_me:$LINENO: result: $grub_cv_cc_mcmodel" >&5
 echo "${ECHO_T}$grub_cv_cc_mcmodel" >&6; }
-  if test "x$grub_cv_cc_mcmodel" = xno; then
+  if test "x$grub_cv_cc_no_mcmodel" = xno; then
     { { echo "$as_me:$LINENO: error: -mcmodel=large not supported, upgrade your gcc" >&5
 echo "$as_me: error: -mcmodel=large not supported, upgrade your gcc" >&2;}
    { (exit 1); exit 1; }; }
   fi
-  TARGET_CFLAGS="$TARGET_CFLAGS -m64 -mcmodel=large"
-  TARGET_LDFLAGS="$TARGET_LDFLAGS -m64"
+
+  # EFI writes to stack below %rsp, we must not use the red zone
+  { echo "$as_me:$LINENO: checking whether option -mno-red-zone works" >&5
+echo $ECHO_N "checking whether option -mno-red-zone works... $ECHO_C" >&6; }
+if test "${grub_cv_cc_no_red_zone+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+    CFLAGS="-m64 -mno-red-zone"
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  grub_cv_cc_no_red_zone=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       grub_cv_cc_no_red_zone=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ echo "$as_me:$LINENO: result: $grub_cv_cc_no_red_zone" >&5
+echo "${ECHO_T}$grub_cv_cc_no_red_zone" >&6; }
+  if test "x$grub_cv_cc_no_red_zone" = xno; then
+    { { echo "$as_me:$LINENO: error: -mno-red-zone not supported, upgrade your gcc" >&5
+echo "$as_me: error: -mno-red-zone not supported, upgrade your gcc" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+
+  TARGET_CFLAGS="$TARGET_CFLAGS -mcmodel=large -mno-red-zone"
 fi
 
 #
index fd89d302a99cc4a10fa097dfdbbfc127dc29bb4f..0220898c61dfd444918a8101ab9d4b7994ec20ae 100644 (file)
@@ -299,17 +299,34 @@ fi
 
 if test "x$target_m64" = x1; then
   # Force 64-bit mode.
+  TARGET_CFLAGS="$TARGET_CFLAGS -m64"
+  TARGET_LDFLAGS="$TARGET_LDFLAGS -m64"
+fi
+
+if test "$target_cpu"-"$platform" = x86_64-efi; then
+  # Use large model to support 4G memory
   AC_CACHE_CHECK([whether option -mcmodel=large works], grub_cv_cc_mcmodel, [
     CFLAGS="-m64 -mcmodel=large"
     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
                      [grub_cv_cc_mcmodel=yes],
                      [grub_cv_cc_mcmodel=no])
   ])
-  if test "x$grub_cv_cc_mcmodel" = xno; then
+  if test "x$grub_cv_cc_no_mcmodel" = xno; then
     AC_MSG_ERROR([-mcmodel=large not supported, upgrade your gcc])
   fi
-  TARGET_CFLAGS="$TARGET_CFLAGS -m64 -mcmodel=large"
-  TARGET_LDFLAGS="$TARGET_LDFLAGS -m64"
+
+  # EFI writes to stack below %rsp, we must not use the red zone
+  AC_CACHE_CHECK([whether option -mno-red-zone works], grub_cv_cc_no_red_zone, [
+    CFLAGS="-m64 -mno-red-zone"
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
+                     [grub_cv_cc_no_red_zone=yes],
+                     [grub_cv_cc_no_red_zone=no])
+  ])
+  if test "x$grub_cv_cc_no_red_zone" = xno; then
+    AC_MSG_ERROR([-mno-red-zone not supported, upgrade your gcc])
+  fi
+
+  TARGET_CFLAGS="$TARGET_CFLAGS -mcmodel=large -mno-red-zone"
 fi
 
 #
index c3ca18f24b46e3feff549585b860ddd3870d3c89..2bf85313cfa1d8b393807fbb677dc3453c91593e 100644 (file)
@@ -1,4 +1,4 @@
-/* handler.c - grub handler function*/
+/* handler.c - grub handler function */
 /*
  *  GRUB  --  GRand Unified Bootloader
  *  Copyright (C) 2009  Free Software Foundation, Inc.
index b22218ee9d26cfac5412195752a238d638a027c6..41f55740be28f4a6623abca75755d1fe761a86d2 100644 (file)
@@ -1,4 +1,4 @@
-/* list.c - grub list function*/
+/* list.c - grub list function */
 /*
  *  GRUB  --  GRand Unified Bootloader
  *  Copyright (C) 2009  Free Software Foundation, Inc.