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