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