|
|
b8b9f4 |
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
a8c91d |
From: Peter Jones <pjones@redhat.com>
|
|
|
a8c91d |
Date: Tue, 2 Sep 2014 11:08:23 -0400
|
|
|
b8b9f4 |
Subject: [PATCH] Build as PIE+RELRO binaries.
|
|
|
a8c91d |
|
|
|
a8c91d |
Resolves: rhbz#1092542
|
|
|
a8c91d |
|
|
|
a8c91d |
Signed-off-by: Peter Jones <pjones@redhat.com>
|
|
|
a8c91d |
---
|
|
|
a8c91d |
Make.defaults | 2 +-
|
|
|
a8c91d |
libdpe/Makefile | 3 +++
|
|
|
a8c91d |
src/Makefile | 4 ++--
|
|
|
a8c91d |
3 files changed, 6 insertions(+), 3 deletions(-)
|
|
|
a8c91d |
|
|
|
a8c91d |
diff --git a/Make.defaults b/Make.defaults
|
|
|
a8c91d |
index 0995e5b..5ff74ee 100644
|
|
|
a8c91d |
--- a/Make.defaults
|
|
|
a8c91d |
+++ b/Make.defaults
|
|
|
a8c91d |
@@ -6,7 +6,7 @@ ARCH := $(shell uname -m | sed s,i[3456789]86,ia32,)
|
|
|
a8c91d |
INCDIR = -I$(TOPDIR)/include
|
|
|
a8c91d |
CPPFLAGS = -DCONFIG_$(ARCH)
|
|
|
a8c91d |
CFLAGS = -g -O0
|
|
|
a8c91d |
-BUILDFLAGS := $(CFLAGS) $(ARCH3264) -fpic -Wall -fshort-wchar -fno-strict-aliasing -fno-merge-constants --std=gnu99 -D_GNU_SOURCE -Wno-unused-result -Wno-unused-function
|
|
|
a8c91d |
+BUILDFLAGS := $(CFLAGS) $(ARCH3264) -Wall -fshort-wchar -fno-strict-aliasing -fno-merge-constants --std=gnu99 -D_GNU_SOURCE -Wno-unused-result -Wno-unused-function
|
|
|
a8c91d |
ASFLAGS = $(ARCH3264)
|
|
|
a8c91d |
LDFLAGS = -nostdlib
|
|
|
a8c91d |
CCLDFLAGS = -shared
|
|
|
a8c91d |
diff --git a/libdpe/Makefile b/libdpe/Makefile
|
|
|
a8c91d |
index 81d3c0b..a8b0c26 100644
|
|
|
a8c91d |
--- a/libdpe/Makefile
|
|
|
a8c91d |
+++ b/libdpe/Makefile
|
|
|
a8c91d |
@@ -5,6 +5,9 @@ SONAME = libdpe.so.0
|
|
|
a8c91d |
|
|
|
a8c91d |
include $(TOPDIR)/Make.defaults
|
|
|
a8c91d |
|
|
|
a8c91d |
+BUILDFLAGS += -fPIC
|
|
|
a8c91d |
+CCLDFLAGS += -fPIC -Wl,-z,relro,-z,now
|
|
|
a8c91d |
+
|
|
|
a8c91d |
TARGETS = libdpe.so libdpe.a
|
|
|
a8c91d |
all : $(TARGETS)
|
|
|
a8c91d |
|
|
|
a8c91d |
diff --git a/src/Makefile b/src/Makefile
|
|
|
a8c91d |
index e45d2a3..766ffe8 100644
|
|
|
a8c91d |
--- a/src/Makefile
|
|
|
a8c91d |
+++ b/src/Makefile
|
|
|
a8c91d |
@@ -7,8 +7,8 @@ PKLIBS = nss
|
|
|
a8c91d |
LIBS = popt
|
|
|
a8c91d |
STATIC_LIBS = $(TOPDIR)/libdpe/libdpe.a
|
|
|
a8c91d |
LDFLAGS =
|
|
|
a8c91d |
-CCLDFLAGS = -L../libdpe $(foreach pklib,$(PKLIBS), $(shell pkg-config --libs-only-L $(pklib)))
|
|
|
a8c91d |
-BUILDFLAGS += -I../include/ $(foreach pklib,$(PKLIBS), $(shell pkg-config --cflags $(pklib))) -Werror
|
|
|
a8c91d |
+CCLDFLAGS = -L../libdpe $(foreach pklib,$(PKLIBS), $(shell pkg-config --libs-only-L $(pklib))) -pie -fPIE -Wl,-z,relro,-z,now
|
|
|
a8c91d |
+BUILDFLAGS += -I../include/ $(foreach pklib,$(PKLIBS), $(shell pkg-config --cflags $(pklib))) -Werror -fPIE
|
|
|
a8c91d |
|
|
|
a8c91d |
TARGETS = pesign authvar client efisiglist efikeygen peverify
|
|
|
a8c91d |
|