Blame SOURCES/rhelonly-kexec-tools-2.0.18-eppic-fix-issues-with-hardening-flags.patch

b9e861
From ce720608d5933e62f77f2c2f216859cf4f06adf8 Mon Sep 17 00:00:00 2001
b9e861
From: Kairui Song <kasong@redhat.com>
b9e861
Date: Wed, 13 Feb 2019 00:03:51 +0800
b9e861
Subject: [PATCH] Fix eppic issue with hardening flags
b9e861
b9e861
This is stash of two commits:
b9e861
b9e861
commit f98cf5fe07f390554696755f0a5843f6bb9c4716
b9e861
Author: ryncsn <ryncsn@gmail.com>
b9e861
Date:   Tue Mar 19 13:39:25 2019 +0800
b9e861
b9e861
    Tell gcc not to omit frame pointer
b9e861
b9e861
    After commit 0209874, it's now possible to enable optimization above O0.
b9e861
    But eppic might call __builtin_return_address(1). With O1,
b9e861
    -fomit-frame-pointer is enabled gcc may omit frame pointer.
b9e861
    __builtin_return_address(1) relies on callee preserves RBP as the stack
b9e861
    base, which is untrue if optimization is usded. In this case it may return
b9e861
    wrong value or crash.
b9e861
b9e861
    In case of any potential failure, use -fno-omit-frame-pointer globally.
b9e861
b9e861
    Signed-off-by: Kairui Song <ryncsn@gmail.com>
b9e861
b9e861
commit 0209874f4b46b8af5a2d42662ba6775cf5a1dc44
b9e861
Author: Kairui Song <kasong@redhat.com>
b9e861
Date:   Wed Feb 13 00:03:51 2019 +0800
b9e861
b9e861
    Drop O0 CFLAGS override in Makefile
b9e861
b9e861
Signed-off-by: Kairui Song <kasong@redhat.com>
b9e861
---
b9e861
 libeppic/Makefile | 2 +-
b9e861
 1 file changed, 1 insertion(+), 1 deletion(-)
b9e861
b9e861
diff --git a/libeppic/Makefile b/libeppic/Makefile
b9e861
index bcf2edf..8b97c87 100644
b9e861
--- a/eppic/libeppic/Makefile
b9e861
+++ b/eppic/libeppic/Makefile
b9e861
@@ -24,7 +24,7 @@ LDIRT    = lex.eppic.c lex.eppicpp.c eppic.tab.c eppic.tab.h eppicpp.tab.c \
b9e861
 LIBDIR	 = /usr/lib
b9e861
 TARGETS  = libeppic.a
b9e861
 
b9e861
-CFLAGS += -O0 -g -fPIC
b9e861
+CFLAGS += -g -fno-omit-frame-pointer -fPIC
b9e861
 ifeq ($(TARGET), PPC64)
b9e861
 	CFLAGS += -m64
b9e861
 endif
b9e861
-- 
b9e861
2.20.1
b9e861