a3bfe3
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
a3bfe3
From: Peter Jones <pjones@redhat.com>
a3bfe3
Date: Fri, 28 Sep 2018 15:48:09 -0400
a3bfe3
Subject: [PATCH] Do not allow stack trampolines, anywhere.
a3bfe3
a3bfe3
Signed-off-by: Peter Jones <pjones@redhat.com>
a3bfe3
---
a3bfe3
 configure.ac         | 3 +++
a3bfe3
 conf/Makefile.common | 2 +-
a3bfe3
 2 files changed, 4 insertions(+), 1 deletion(-)
a3bfe3
a3bfe3
diff --git a/configure.ac b/configure.ac
a3bfe3
index 40fcf567ae7..077df917593 100644
a3bfe3
--- a/configure.ac
a3bfe3
+++ b/configure.ac
a3bfe3
@@ -1983,6 +1983,9 @@ if test x"$enable_wextra" != xno ; then
a3bfe3
   HOST_CFLAGS="$HOST_CFLAGS -Wextra"
a3bfe3
 fi
a3bfe3
 
a3bfe3
+TARGET_CFLAGS="$TARGET_CFLAGS -Werror=trampolines -fno-trampolines"
a3bfe3
+HOST_CFLAGS="$HOST_CFLAGS -Werror=trampolines -fno-trampolines"
a3bfe3
+
a3bfe3
 TARGET_CPP="$TARGET_CC -E"
a3bfe3
 TARGET_CCAS=$TARGET_CC
a3bfe3
 
a3bfe3
diff --git a/conf/Makefile.common b/conf/Makefile.common
a3bfe3
index 0d9910d7875..38375a7891c 100644
a3bfe3
--- a/conf/Makefile.common
a3bfe3
+++ b/conf/Makefile.common
a3bfe3
@@ -66,7 +66,7 @@ grubconfdir = $(sysconfdir)/grub.d
a3bfe3
 platformdir = $(pkglibdir)/$(target_cpu)-$(platform)
a3bfe3
 starfielddir = $(pkgdatadir)/themes/starfield
a3bfe3
 
a3bfe3
-CFLAGS_GNULIB = -Wno-undef -Wno-unused -Wno-unused-parameter -Wno-redundant-decls -Wno-unreachable-code
a3bfe3
+CFLAGS_GNULIB = -Wno-undef -Wno-unused -Wno-unused-parameter -Wno-redundant-decls -Wno-unreachable-code -Werror=trampolines -fno-trampolines
a3bfe3
 CPPFLAGS_GNULIB = -I$(top_builddir)/grub-core/gnulib -I$(top_srcdir)/grub-core/gnulib
a3bfe3
 
a3bfe3
 CFLAGS_POSIX = -fno-builtin