]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2004-04-04 Yoshinori K. Okuji <okuji@enbug.org>
authorokuji <okuji@localhost>
Sun, 4 Apr 2004 09:15:43 +0000 (09:15 +0000)
committerokuji <okuji@localhost>
Sun, 4 Apr 2004 09:15:43 +0000 (09:15 +0000)
* configure.ac (STAGE2_CFLAGS): Check if -fno-stack-protector is
supported by GCC. If yes, added the option. This is necessary
for OpenBSD, because the stack protector defines additional
symbols. Reported by uc.sheda <uc.sheda@laposte.net>.

ChangeLog
configure
configure.ac
docs/grub-install.8
docs/grub-md5-crypt.8
docs/grub-terminfo.8
docs/grub.8
grub/Makefile.in
netboot/Makefile.in

index 673b9641984ab3147f23562a7fafc795b055452c..798b7838c3d6376e621f28df29c2461549cc47e8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2004-04-04  Yoshinori K. Okuji  <okuji@enbug.org>
+
+       * configure.ac (STAGE2_CFLAGS): Check if -fno-stack-protector is
+       supported by GCC. If yes, added the option. This is necessary
+       for OpenBSD, because the stack protector defines additional
+       symbols. Reported by uc.sheda <uc.sheda@laposte.net>.
+
 2004-03-28  Pavel Roskin  <proski@gnu.org>
 
        * stage2/boot.c: Imply --no-mem-option for Linux kernels with
index c26ea52cdf32033330d66fff4dc7d5dd7ec78d7a..50a6ea3d3d439675d68c990d7f2a3e0070a8359c 100644 (file)
--- a/configure
+++ b/configure
@@ -3289,6 +3289,60 @@ echo "${ECHO_T}$size_flag" >&6
     else
       STAGE2_CFLAGS="-O2 -fno-strength-reduce -fno-unroll-loops"
     fi
+    # OpenBSD has a GCC extension for protecting applications from
+    # stack smashing attacks, but GRUB doesn't want this feature.
+    echo "$as_me:$LINENO: checking whether gcc has -fno-stack-protector" >&5
+echo $ECHO_N "checking whether gcc has -fno-stack-protector... $ECHO_C" >&6
+if test "${no_stack_protector_flag+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+      saved_CFLAGS=$CFLAGS
+      CFLAGS="-fno-stack-protector"
+      cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* 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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  no_stack_protector_flag=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+no_stack_protector_flag=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+      CFLAGS=$saved_CFLAGS
+
+fi
+echo "$as_me:$LINENO: result: $no_stack_protector_flag" >&5
+echo "${ECHO_T}$no_stack_protector_flag" >&6
+    if test "x$no_stack_protector_flag" = xyes; then
+      STAGE2_CFLAGS="$STAGE2_CFLAGS -fno-stack-protector"
+    fi
   fi
 fi
 
index 8bb18b56a1a212501caf8522e01e80dd4e62d87e..14e75b1c016eb6b5b02fbb5753af684f256b22a3 100644 (file)
@@ -97,6 +97,21 @@ if test "x$ac_cv_prog_gcc" = xyes; then
     else
       STAGE2_CFLAGS="-O2 -fno-strength-reduce -fno-unroll-loops"
     fi
+    # OpenBSD has a GCC extension for protecting applications from
+    # stack smashing attacks, but GRUB doesn't want this feature.
+    AC_CACHE_CHECK([whether gcc has -fno-stack-protector],
+                  no_stack_protector_flag, [
+      saved_CFLAGS=$CFLAGS
+      CFLAGS="-fno-stack-protector"
+      AC_TRY_COMPILE(,
+                    ,
+                    no_stack_protector_flag=yes,
+                    no_stack_protector_flag=no)
+      CFLAGS=$saved_CFLAGS
+    ])
+    if test "x$no_stack_protector_flag" = xyes; then
+      STAGE2_CFLAGS="$STAGE2_CFLAGS -fno-stack-protector"
+    fi
   fi
 fi
 
index a89affe98f8d5a168979674f8c3e335cd361604e..21e3cef2e0af57fb6fc0cc09083543747654548e 100644 (file)
@@ -1,5 +1,5 @@
 .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.23.
-.TH GRUB-INSTALL "8" "March 2004" "grub-install (GNU GRUB 0.94)" FSF
+.TH GRUB-INSTALL "8" "April 2004" "grub-install (GNU GRUB 0.94)" FSF
 .SH NAME
 grub-install \- install GRUB on your drive
 .SH SYNOPSIS
index 28505648cb542bd6a2750631f53d494fa0b8074a..cb05cdb7d679e59d63028434a0c1c7b964ae4f9c 100644 (file)
@@ -1,5 +1,5 @@
 .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.23.
-.TH GRUB-MD5-CRYPT "8" "March 2004" "grub-md5-crypt (GNU GRUB )" FSF
+.TH GRUB-MD5-CRYPT "8" "April 2004" "grub-md5-crypt (GNU GRUB )" FSF
 .SH NAME
 grub-md5-crypt \- Encrypt a password in MD5 format
 .SH SYNOPSIS
index 869d08c4335a961e1d5289755210bf0920f62bb9..3485d39441658e8d69328433fb24f1048047ae09 100644 (file)
@@ -1,5 +1,5 @@
 .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.23.
-.TH GRUB-TERMINFO "8" "March 2004" "grub-terminfo (GNU GRUB 0.94)" FSF
+.TH GRUB-TERMINFO "8" "April 2004" "grub-terminfo (GNU GRUB 0.94)" FSF
 .SH NAME
 grub-terminfo \- Generate a terminfo command from a terminfo name
 .SH SYNOPSIS
index acaa41c8231d98596c2068561845a4a764e55288..1cd63e48691b0a8ca8bc61818dc91d5a791b279e 100644 (file)
@@ -1,5 +1,5 @@
 .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.23.
-.TH GRUB "8" "March 2004" "grub (GNU GRUB 0.94)" FSF
+.TH GRUB "8" "April 2004" "grub (GNU GRUB 0.94)" FSF
 .SH NAME
 grub \- the grub shell
 .SH SYNOPSIS
index 2da761b2b5f605e127a103a45c57d6c47f137596..eef7a20fc9cb18e1ed9b237bf0115192ca71732c 100644 (file)
@@ -142,9 +142,9 @@ sharedstatedir = @sharedstatedir@
 sysconfdir = @sysconfdir@
 target_alias = @target_alias@
 sbin_PROGRAMS = grub
+@SERIAL_SPEED_SIMULATION_FALSE@SERIAL_FLAGS = -DSUPPORT_SERIAL=1 
 
 @SERIAL_SPEED_SIMULATION_TRUE@SERIAL_FLAGS = -DSUPPORT_SERIAL=1 -DSIMULATE_SLOWNESS_OF_SERIAL=1
-@SERIAL_SPEED_SIMULATION_FALSE@SERIAL_FLAGS = -DSUPPORT_SERIAL=1 
 
 AM_CPPFLAGS = -DGRUB_UTIL=1 -DFSYS_EXT2FS=1 -DFSYS_FAT=1 \
        -DFSYS_FFS=1 -DFSYS_MINIX=1 -DSUPPORT_HERCULES=1 \
index e08f91a0a37681c1b90f88a4a622f26a684ad77a..07494505def105b57701155fd2f9bfd06012cef2 100644 (file)
@@ -144,10 +144,10 @@ target_alias = @target_alias@
 
 # For <shared.h> and <stage1.h>.
 INCLUDES = -I$(top_srcdir)/stage2 -I$(top_srcdir)/stage1
+@NETBOOT_SUPPORT_FALSE@LIBDRIVERS = 
 
 # Don't build the netboot support by default.
 @NETBOOT_SUPPORT_TRUE@LIBDRIVERS = libdrivers.a
-@NETBOOT_SUPPORT_FALSE@LIBDRIVERS = 
 
 noinst_LIBRARIES = $(LIBDRIVERS)