7e98da0
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
7e98da0
From: Peter Jones <pjones@redhat.com>
e153146
Date: Fri, 12 Jul 2019 10:06:50 +0200
7e98da0
Subject: [PATCH] Do not allow stack trampolines, anywhere.
7e98da0
7e98da0
Signed-off-by: Peter Jones <pjones@redhat.com>
7e98da0
---
7e98da0
 configure.ac         | 3 +++
7e98da0
 conf/Makefile.common | 2 +-
7e98da0
 2 files changed, 4 insertions(+), 1 deletion(-)
7e98da0
7e98da0
diff --git a/configure.ac b/configure.ac
13985b0
index bd28edf3141..907477a585c 100644
7e98da0
--- a/configure.ac
7e98da0
+++ b/configure.ac
46968b6
@@ -2062,6 +2062,9 @@ if test x"$enable_wextra" != xno ; then
7e98da0
   HOST_CFLAGS="$HOST_CFLAGS -Wextra"
7e98da0
 fi
7e98da0
 
7e98da0
+TARGET_CFLAGS="$TARGET_CFLAGS -Werror=trampolines -fno-trampolines"
7e98da0
+HOST_CFLAGS="$HOST_CFLAGS -Werror=trampolines -fno-trampolines"
7e98da0
+
7e98da0
 TARGET_CPP="$TARGET_CC -E"
7e98da0
 TARGET_CCAS=$TARGET_CC
7e98da0
 
7e98da0
diff --git a/conf/Makefile.common b/conf/Makefile.common
46968b6
index 35e14ff017e..0647c53b916 100644
7e98da0
--- a/conf/Makefile.common
7e98da0
+++ b/conf/Makefile.common
7e98da0
@@ -66,7 +66,7 @@ grubconfdir = $(sysconfdir)/grub.d
7e98da0
 platformdir = $(pkglibdir)/$(target_cpu)-$(platform)
7e98da0
 starfielddir = $(pkgdatadir)/themes/starfield
7e98da0
 
7e98da0
-CFLAGS_GNULIB = -Wno-undef -Wno-unused -Wno-unused-parameter -Wno-redundant-decls -Wno-unreachable-code
7e98da0
+CFLAGS_GNULIB = -Wno-undef -Wno-unused -Wno-unused-parameter -Wno-redundant-decls -Wno-unreachable-code -Werror=trampolines -fno-trampolines
e153146
 CPPFLAGS_GNULIB = -I$(top_builddir)/grub-core/lib/gnulib -I$(top_srcdir)/grub-core/lib/gnulib
7e98da0
 
7e98da0
 CFLAGS_POSIX = -fno-builtin