7e98da0
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
7e98da0
From: Peter Jones <pjones@redhat.com>
7e98da0
Date: Tue, 15 Jan 2019 14:57:25 -0500
7e98da0
Subject: [PATCH] Try to set -fPIE and friends on libgnu.a
7e98da0
7e98da0
In order to make sure UTIL_CFLAGS and UTIL_LDFLAGS can correctly get
7e98da0
-Wl,-z,relro,-z,now , we need everything going in them to be built with at
7e98da0
least -fPIC (and preferably -fPIE) wherever we can, or else we get relocations
7e98da0
in some component object that can't be used with the link type that's being
7e98da0
used for the final ELF object.
7e98da0
7e98da0
So this makes sure libgnu.a gets built with HOST_CFLAGS and HOST_LDFLAGS,
7e98da0
which are what is later used to define UTIL_CFLAGS and UTIL_LDFLAGS, and
7e98da0
includes -fPIE.
7e98da0
7e98da0
Fixes an rpmdiff check.
7e98da0
7e98da0
Related: rhbz#1658500
7e98da0
7e98da0
Signed-off-by: Peter Jones <pjones@redhat.com>
7e98da0
---
7e98da0
 grub-core/gnulib/Makefile.am | 4 ++--
7e98da0
 1 file changed, 2 insertions(+), 2 deletions(-)
7e98da0
7e98da0
diff --git a/grub-core/gnulib/Makefile.am b/grub-core/gnulib/Makefile.am
7e98da0
index b7c5e60e1c3..bd3621930ff 100644
7e98da0
--- a/grub-core/gnulib/Makefile.am
7e98da0
+++ b/grub-core/gnulib/Makefile.am
7e98da0
@@ -38,8 +38,8 @@ CLEANFILES =
7e98da0
 DISTCLEANFILES =
7e98da0
 MAINTAINERCLEANFILES =
7e98da0
 
7e98da0
-AM_CPPFLAGS =
7e98da0
-AM_CFLAGS =
7e98da0
+AM_CPPFLAGS = $(HOST_CPPFLAGS)
7e98da0
+AM_CFLAGS = $(HOST_CFLAGS)
7e98da0
 
7e98da0
 noinst_LIBRARIES += libgnu.a
7e98da0