aboutsummaryrefslogtreecommitdiff
path: root/config.mk
diff options
context:
space:
mode:
Diffstat (limited to 'config.mk')
-rw-r--r--config.mk9
1 files changed, 9 insertions, 0 deletions
diff --git a/config.mk b/config.mk
index 6ba65cf..efc85b5 100644
--- a/config.mk
+++ b/config.mk
@@ -33,3 +33,12 @@ DEBUG_CFLAGS = ${CFLAGS} -UNDEBUG -O0 -g -ggdb -Wall -Wextra -Wno-missing-field-
CC ?= cc
STRIP ?= strip
+
+# Hardening
+ifeq (${CC},gcc)
+ CFLAGS += -fPIC -fstack-protector-all -D_FORTIFY_SOURCE=2
+ LDFLAGS += -z now -z relro -pie
+else ifeq (${CC},clang)
+ CFLAGS += -fPIE -fstack-protector-all -D_FORTIFY_SOURCE=2
+ LDFLAGS += -z now -z relro -pie
+endif