2016-01-07 00:44:04 +00:00
|
|
|
Introduce build hardening flags for f23
|
|
|
|
|
|
|
|
From: Al Stone <ahs3@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
generate/unix/Makefile.config | 2 ++
|
|
|
|
generate/unix/iasl/Makefile | 13 +++++++------
|
|
|
|
2 files changed, 9 insertions(+), 6 deletions(-)
|
|
|
|
|
|
|
|
diff --git a/generate/unix/Makefile.config b/generate/unix/Makefile.config
|
|
|
|
index 2c67be4..e8a419e 100644
|
|
|
|
--- a/generate/unix/Makefile.config
|
|
|
|
+++ b/generate/unix/Makefile.config
|
2015-05-28 18:53:37 +00:00
|
|
|
@@ -167,6 +167,8 @@ ifneq ($(NOFORTIFY),TRUE)
|
2015-04-06 23:17:50 +00:00
|
|
|
OPT_CFLAGS += -D_FORTIFY_SOURCE=2
|
|
|
|
endif
|
|
|
|
|
|
|
|
+OPT_CFLAGS += -fPIC -pie
|
|
|
|
+
|
|
|
|
CFLAGS += \
|
|
|
|
-D$(HOST)\
|
|
|
|
-D_GNU_SOURCE\
|
2016-01-07 00:44:04 +00:00
|
|
|
diff --git a/generate/unix/iasl/Makefile b/generate/unix/iasl/Makefile
|
|
|
|
index 8b71edd..b403037 100644
|
|
|
|
--- a/generate/unix/iasl/Makefile
|
|
|
|
+++ b/generate/unix/iasl/Makefile
|
2016-02-23 00:42:58 +00:00
|
|
|
@@ -312,20 +312,21 @@ $(OBJDIR)/prparserparse.c $(OBJDIR)/prparser.y.h : $(ASL_COMPILER)/prparse
|
2015-04-06 23:35:24 +00:00
|
|
|
# Cannot use the common compile warning flags since the C files are created
|
|
|
|
# by the utilities above and they are not necessarily ANSI C, etc.
|
|
|
|
#
|
|
|
|
+HARDENING_FLAGS = -fPIC -pie
|
|
|
|
$(OBJDIR)/aslcompilerlex.o : $(OBJDIR)/aslcompilerlex.c
|
|
|
|
- $(CC) -c $(CFLAGS) -Wall -Werror -o$@ $<
|
|
|
|
+ $(CC) -c $(CFLAGS) $(HARDENING_FLAGS) -Wall -Werror -o$@ $<
|
|
|
|
|
|
|
|
$(OBJDIR)/aslcompilerparse.o : $(OBJDIR)/aslcompilerparse.c
|
|
|
|
- $(CC) -c $(CFLAGS) -Wall -Werror -o$@ $<
|
|
|
|
+ $(CC) -c $(CFLAGS) $(HARDENING_FLAGS) -Wall -Werror -o$@ $<
|
|
|
|
|
|
|
|
$(OBJDIR)/dtparserlex.o : $(OBJDIR)/dtparserlex.c
|
|
|
|
- $(CC) -c $(CFLAGS) -Wall -Werror -o$@ $<
|
|
|
|
+ $(CC) -c $(CFLAGS) $(HARDENING_FLAGS) -Wall -Werror -o$@ $<
|
|
|
|
|
|
|
|
$(OBJDIR)/dtparserparse.o : $(OBJDIR)/dtparserparse.c
|
|
|
|
- $(CC) -c $(CFLAGS) -Wall -Werror -o$@ $<
|
|
|
|
+ $(CC) -c $(CFLAGS) $(HARDENING_FLAGS) -Wall -Werror -o$@ $<
|
|
|
|
|
|
|
|
$(OBJDIR)/prparserlex.o : $(OBJDIR)/prparserlex.c
|
|
|
|
- $(CC) -c $(CFLAGS) -Wall -Werror -o$@ $<
|
|
|
|
+ $(CC) -c $(CFLAGS) $(HARDENING_FLAGS) -Wall -Werror -o$@ $<
|
|
|
|
|
|
|
|
$(OBJDIR)/prparserparse.o : $(OBJDIR)/prparserparse.c
|
|
|
|
- $(CC) -c $(CFLAGS) -Wall -Werror -o$@ $<
|
|
|
|
+ $(CC) -c $(CFLAGS) $(HARDENING_FLAGS) -Wall -Werror -o$@ $<
|