nalika / rpms / grub2

Forked from rpms/grub2 2 years ago
Clone

Blame SOURCES/0106-Do-not-allow-stack-trampolines-anywhere.patch

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