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