acpica-tools/f23-harden.patch
DistroBaker 80dc240519 Merged update from upstream sources
This is an automated DistroBaker update from upstream sources.
If you do not know what this is about or would like to opt out,
contact the OSCI team.

Source: https://src.fedoraproject.org/rpms/acpica-tools.git#defe2b64332fc44bf9915c8f57d2614c529cdb43
2020-10-31 12:18:15 +01:00

72 lines
2.7 KiB
Diff

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(-)
Index: acpica-unix2-20200925/generate/unix/Makefile.config
===================================================================
--- acpica-unix2-20200925.orig/generate/unix/Makefile.config
+++ acpica-unix2-20200925/generate/unix/Makefile.config
@@ -189,6 +189,8 @@ ifneq ($(NOFORTIFY),TRUE)
OPT_CFLAGS += -D_FORTIFY_SOURCE=2
endif
+OPT_CFLAGS += -fPIC -pie
+
CFLAGS += \
-D$(ACPI_HOST)\
-D_GNU_SOURCE\
Index: acpica-unix2-20200925/generate/unix/iasl/Makefile
===================================================================
--- acpica-unix2-20200925.orig/generate/unix/iasl/Makefile
+++ acpica-unix2-20200925/generate/unix/iasl/Makefile
@@ -359,34 +359,35 @@ $(OBJDIR)/prparserparse.c $(OBJDIR)/prpa
# 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
@echo "- " "Intermediate" $<
- @$(CC) -c $(CFLAGS) -Wall -Werror -o$@ $<
+ @$(CC) -c $(CFLAGS) $(HARDENING_FLAGS) -Wall -Werror -o$@ $<
$(OBJDIR)/aslcompilerparse.o : $(OBJDIR)/aslcompilerparse.c
@echo "- " "Intermediate" $<
- @$(CC) -c $(CFLAGS) -Wall -Werror -o$@ $<
+ @$(CC) -c $(CFLAGS) $(HARDENING_FLAGS) -Wall -Werror -o$@ $<
$(OBJDIR)/dtcompilerparserlex.o : $(OBJDIR)/dtcompilerparserlex.c
@echo "- " "Intermediate" $<
- @$(CC) -c $(CFLAGS) -Wall -Werror -o$@ $<
+ @$(CC) -c $(CFLAGS) $(HARDENING_FLAGS) -Wall -Werror -o$@ $<
$(OBJDIR)/dtcompilerparserparse.o : $(OBJDIR)/dtcompilerparserparse.c
@echo "- " "Intermediate" $<
- @$(CC) -c $(CFLAGS) -Wall -Werror -o$@ $<
+ @$(CC) -c $(CFLAGS) $(HARDENING_FLAGS) -Wall -Werror -o$@ $<
$(OBJDIR)/dtparserlex.o : $(OBJDIR)/dtparserlex.c
@echo "- " "Intermediate" $<
- @$(CC) -c $(CFLAGS) -Wall -Werror -o$@ $<
+ @$(CC) -c $(CFLAGS) $(HARDENING_FLAGS) -Wall -Werror -o$@ $<
$(OBJDIR)/dtparserparse.o : $(OBJDIR)/dtparserparse.c
@echo "- " "Intermediate" $<
- @$(CC) -c $(CFLAGS) -Wall -Werror -o$@ $<
+ @$(CC) -c $(CFLAGS) $(HARDENING_FLAGS) -Wall -Werror -o$@ $<
$(OBJDIR)/prparserlex.o : $(OBJDIR)/prparserlex.c
@echo "- " "Intermediate" $<
- @$(CC) -c $(CFLAGS) -Wall -Werror -o$@ $<
+ @$(CC) -c $(CFLAGS) $(HARDENING_FLAGS) -Wall -Werror -o$@ $<
$(OBJDIR)/prparserparse.o : $(OBJDIR)/prparserparse.c
@echo "- " "Intermediate" $<
- @$(CC) -c $(CFLAGS) -Wall -Werror -o$@ $<
+ @$(CC) -c $(CFLAGS) $(HARDENING_FLAGS) -Wall -Werror -o$@ $<