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