nalika / rpms / grub2

Forked from rpms/grub2 2 years ago
Clone

Blame SOURCES/0123-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
8e15ce
index bd28edf3141..907477a585c 100644
8e15ce
--- a/configure.ac
8e15ce
+++ b/configure.ac
8e15ce
@@ -2062,6 +2062,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
8e15ce
index 35e14ff017e..0647c53b916 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