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