]> git.proxmox.com Git - grub2.git/commitdiff
Remove all trampoline support. Add -Wtrampolines when
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sun, 3 Mar 2013 14:57:30 +0000 (15:57 +0100)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sun, 3 Mar 2013 14:57:30 +0000 (15:57 +0100)
present. Remove symbols used for trampolines to make
link fail if trampolines are present.

ChangeLog
conf/Makefile.common
config.h.in
configure.ac
grub-core/kern/misc.c
include/grub/libgcc.h
include/grub/misc.h

index e67ca9aa1ab6c2e4f168b09ad32870242d4eda20..cacba374f1228b671427682efd34fdb649962353 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2013-03-03  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       Remove all trampoline support. Add -Wtrampolines when
+       present. Remove symbols used for trampolines to make
+       link fail if trampolines are present.
+
 2013-03-03  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * grub-core/script/execute.c (grub_script_arglist_to_argv): Move
index 75c0a5e07cf0e85791d41b4befe50fd272b3ff61..c185a553d72911f73984b2b2d4fde92bb435e566 100644 (file)
@@ -30,7 +30,7 @@ if COND_mips_loongson
   CPPFLAGS_PLATFORM = -DUSE_ASCII_FAILBACK
 endif
 if COND_mips
-  CFLAGS_PLATFORM += -mflush-func=grub_cpu_flush_cache
+  CFLAGS_PLATFORM += -mflush-func=grub_red_herring
   CCASFLAGS_PLATFORM = -march=mips3
 endif
 if COND_sparc64_ieee1275
index 91afd98f16c034066dce60b9f12f52a42941b5fe..621742caee9ec7da84ee87112bfcd062ebe384de 100644 (file)
@@ -11,7 +11,6 @@
 
 #if defined (GRUB_UTIL) || !defined (GRUB_MACHINE)
 #include <config-util.h>
-#define NESTED_FUNC_ATTR
 #else
 /* Define if C symbols get an underscore after compilation. */
 #define HAVE_ASM_USCORE @HAVE_ASM_USCORE@
 
 #define RE_ENABLE_I18N 1
 
-#if defined(__i386__)
-#define NESTED_FUNC_ATTR __attribute__ ((__regparm__ (1)))
-#else
-#define NESTED_FUNC_ATTR
-#endif
-
 #endif
index 92b550a5f6d4f7eb4ffd76d1fc5ebbddf5854e93..038f429077fc3e4fed014bc0d612566904b46ad6 100644 (file)
@@ -357,21 +357,18 @@ AC_CHECK_HEADER([util.h], [
 ])
 AC_SUBST([LIBUTIL])
 
-AC_CACHE_CHECK([whether -Wno-trampolines work], [grub_cv_host_cc_wnotrampolines], [
+AC_CACHE_CHECK([whether -Wtrampolines work], [grub_cv_host_cc_wtrampolines], [
   SAVED_CFLAGS="$CFLAGS"
-  # Test for -Wtrampolines rather than -Wno-trampolines to reduce confusion
-  # in the event of later failures (since -Wno-* is always accepted, but
-  # produces a diagnostic if something else is wrong).
   CFLAGS="$HOST_CFLAGS -Wtrampolines"
   AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h>
 int va_arg_func (int fixed, va_list args);]], [[]])],
-      [grub_cv_host_cc_wnotrampolines=yes],
-      [grub_cv_host_cc_wnotrampolines=no])
+      [grub_cv_host_cc_wtrampolines=yes],
+      [grub_cv_host_cc_wtrampolines=no])
   CFLAGS="$SAVED_CFLAGS"
 ])
 
-if test x"$grub_host_cv_cc_wnotrampolines" = xyes ; then
-  HOST_CFLAGS="$HOST_CFLAGS -Wno-trampolines"
+if test x"$grub_host_cv_cc_wtrampolines" = xyes ; then
+  HOST_CFLAGS="$HOST_CFLAGS -Wtrampolines"
 fi
 
 #
@@ -621,9 +618,6 @@ fi
 # Compiler features.
 #
 
-# Need __enable_execute_stack() for nested function trampolines?
-grub_CHECK_ENABLE_EXECUTE_STACK
-
 # Position independent executable.
 grub_CHECK_PIE
 [# Need that, because some distributions ship compilers that include
@@ -715,7 +709,7 @@ CFLAGS="$CFLAGS -Wl,--defsym,abort=main"
 fi
 
 # Check for libgcc symbols
-AC_CHECK_FUNCS(__bswapsi2 __bswapdi2 __ashldi3 __ashrdi3 __lshrdi3 __trampoline_setup __ucmpdi2 _restgpr_14_x __ia64_trampoline __udivsi3 __umoddi3 __udivdi3 __divsi3 __modsi3 __umodsi3 __moddi3 __divdi3 __ctzdi2 __ctzsi2)
+AC_CHECK_FUNCS(__bswapsi2 __bswapdi2 __ashldi3 __ashrdi3 __lshrdi3 __ucmpdi2 _restgpr_14_x __udivsi3 __umoddi3 __udivdi3 __divsi3 __modsi3 __umodsi3 __moddi3 __divdi3 __ctzdi2 __ctzsi2)
 
 if test "x$TARGET_APPLE_CC" = x1 ; then
 CFLAGS="$TARGET_CFLAGS -nostdlib"
@@ -761,21 +755,18 @@ if test x"$grub_cv_cc_isystem" = xyes ; then
 fi
 fi
 
-AC_CACHE_CHECK([whether -Wno-trampolines work], [grub_cv_cc_wnotrampolines], [
+AC_CACHE_CHECK([whether -Wtrampolines work], [grub_cv_cc_wtrampolines], [
   SAVED_CFLAGS="$CFLAGS"
-  # Test for -Wtrampolines rather than -Wno-trampolines to reduce confusion
-  # in the event of later failures (since -Wno-* is always accepted, but
-  # produces a diagnostic if something else is wrong).
   CFLAGS="$TARGET_CFLAGS -Wtrampolines"
   AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h>
 int va_arg_func (int fixed, va_list args);]], [[]])],
-      [grub_cv_cc_wnotrampolines=yes],
-      [grub_cv_cc_wnotrampolines=no])
+      [grub_cv_cc_wtrampolines=yes],
+      [grub_cv_cc_wtrampolines=no])
   CFLAGS="$SAVED_CFLAGS"
 ])
 
-if test x"$grub_cv_cc_wnotrampolines" = xyes ; then
-  TARGET_CFLAGS="$TARGET_CFLAGS -Wno-trampolines"
+if test x"$grub_cv_cc_wtrampolines" = xyes ; then
+  TARGET_CFLAGS="$TARGET_CFLAGS -Wtrampolines"
 fi
 
 # Restore the flags.
index c3203a06823e96e739d4ba43f30540b5443e28ec..6cb8f0e67dd6b209dfc1803412ba87665f05b8e5 100644 (file)
@@ -1120,14 +1120,6 @@ grub_abort (void)
 void abort (void) __attribute__ ((alias ("grub_abort")));
 #endif
 
-#if NEED_ENABLE_EXECUTE_STACK && !defined(GRUB_UTIL) && !defined(GRUB_MACHINE_EMU)
-/* Some gcc versions generate a call to this function
-   in trampolines for nested functions.  */
-void __enable_execute_stack (void *addr __attribute__ ((unused)))
-{
-}
-#endif
-
 #if NEED_REGISTER_FRAME_INFO && !defined(GRUB_UTIL)
 void __register_frame_info (void)
 {
index 956d639b9933388e608f7d1b47e512cb17f7d8ac..ca0d5774e1322c9f74a82640b9160b6b797eaf31 100644 (file)
@@ -74,14 +74,6 @@ void EXPORT_FUNC (__ctzsi2) (void);
 # endif
 #endif
 
-# ifdef HAVE___IA64_TRAMPOLINE
-void EXPORT_FUNC (__ia64_trampoline) (void);
-# endif
-
-#ifdef HAVE___TRAMPOLINE_SETUP
-void EXPORT_FUNC (__trampoline_setup) (void);
-#endif
-
 #ifdef HAVE__RESTGPR_14_X
 void EXPORT_FUNC (_restgpr_14_x) (void);
 void EXPORT_FUNC (_restgpr_15_x) (void);
index 33e6b73ccf2c40c58c2ca4b2767eb7d5f4d8317f..11eeb22a83969df005e494d09a3db0986e3e8f4b 100644 (file)
@@ -382,10 +382,6 @@ grub_uint64_t EXPORT_FUNC(grub_divmod64) (grub_uint64_t n,
                                          grub_uint64_t d,
                                          grub_uint64_t *r);
 
-#if !defined(GRUB_UTIL) && NEED_ENABLE_EXECUTE_STACK
-void EXPORT_FUNC(__enable_execute_stack) (void *addr);
-#endif
-
 #if !defined(GRUB_UTIL) && NEED_REGISTER_FRAME_INFO
 void EXPORT_FUNC (__register_frame_info) (void);
 void EXPORT_FUNC (__deregister_frame_info) (void);