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