88c41d
Introduce build hardening flags for f23
88c41d
88c41d
From: Al Stone <ahs3@redhat.com>
88c41d
88c41d
88c41d
---
88c41d
 generate/unix/Makefile.config |    2 ++
88c41d
 generate/unix/iasl/Makefile   |   13 +++++++------
88c41d
 2 files changed, 9 insertions(+), 6 deletions(-)
88c41d
88c41d
Index: acpica-unix2-20180209/generate/unix/Makefile.config
88c41d
===================================================================
88c41d
--- acpica-unix2-20180209.orig/generate/unix/Makefile.config
88c41d
+++ acpica-unix2-20180209/generate/unix/Makefile.config
88c41d
@@ -182,6 +182,8 @@ ifneq ($(NOFORTIFY),TRUE)
88c41d
 OPT_CFLAGS += -D_FORTIFY_SOURCE=2
88c41d
 endif
88c41d
 
88c41d
+OPT_CFLAGS += -fPIC -pie
88c41d
+
88c41d
 CFLAGS += \
88c41d
     -D$(HOST)\
88c41d
     -D_GNU_SOURCE\
88c41d
Index: acpica-unix2-20180209/generate/unix/iasl/Makefile
88c41d
===================================================================
88c41d
--- acpica-unix2-20180209.orig/generate/unix/iasl/Makefile
88c41d
+++ acpica-unix2-20180209/generate/unix/iasl/Makefile
88c41d
@@ -344,26 +344,27 @@ $(OBJDIR)/prparserparse.c $(OBJDIR)/prpa
88c41d
 # Cannot use the common compile warning flags since the C files are created
88c41d
 # by the utilities above and they are not necessarily ANSI C, etc.
88c41d
 #
88c41d
+HARDENING_FLAGS = -fPIC -pie
88c41d
 $(OBJDIR)/aslcompilerlex.o :   $(OBJDIR)/aslcompilerlex.c
88c41d
 	@echo "- " "Intermediate" $<
88c41d
-	@$(CC) -c $(CFLAGS) -Wall -Werror -o$@ $<
88c41d
+	@$(CC) -c $(CFLAGS) $(HARDENING_FLAGS) -Wall -Werror -o$@ $<
88c41d
 
88c41d
 $(OBJDIR)/aslcompilerparse.o : $(OBJDIR)/aslcompilerparse.c
88c41d
 	@echo "- " "Intermediate" $<
88c41d
-	@$(CC) -c $(CFLAGS) -Wall -Werror -o$@ $<
88c41d
+	@$(CC) -c $(CFLAGS) $(HARDENING_FLAGS) -Wall -Werror -o$@ $<
88c41d
 
88c41d
 $(OBJDIR)/dtparserlex.o :      $(OBJDIR)/dtparserlex.c
88c41d
 	@echo "- " "Intermediate" $<
88c41d
-	@$(CC) -c $(CFLAGS) -Wall -Werror -o$@ $<
88c41d
+	@$(CC) -c $(CFLAGS) $(HARDENING_FLAGS) -Wall -Werror -o$@ $<
88c41d
 
88c41d
 $(OBJDIR)/dtparserparse.o :    $(OBJDIR)/dtparserparse.c
88c41d
 	@echo "- " "Intermediate" $<
88c41d
-	@$(CC) -c $(CFLAGS) -Wall -Werror -o$@ $<
88c41d
+	@$(CC) -c $(CFLAGS) $(HARDENING_FLAGS) -Wall -Werror -o$@ $<
88c41d
 
88c41d
 $(OBJDIR)/prparserlex.o :      $(OBJDIR)/prparserlex.c
88c41d
 	@echo "- " "Intermediate" $<
88c41d
-	@$(CC) -c $(CFLAGS) -Wall -Werror -o$@ $<
88c41d
+	@$(CC) -c $(CFLAGS) $(HARDENING_FLAGS) -Wall -Werror -o$@ $<
88c41d
 
88c41d
 $(OBJDIR)/prparserparse.o :    $(OBJDIR)/prparserparse.c
88c41d
 	@echo "- " "Intermediate" $<
88c41d
-	@$(CC) -c $(CFLAGS) -Wall -Werror -o$@ $<
88c41d
+	@$(CC) -c $(CFLAGS) $(HARDENING_FLAGS) -Wall -Werror -o$@ $<