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