aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2015-01-17 09:27:42 +0100
committerMarc André Tanner <mat@brain-dump.org>2015-01-17 09:27:42 +0100
commite03ce9ae5a8ee6b460b2766b7adc756a91924494 (patch)
treee780a8c4945c1fb9507dd85997ff838fceb3c138
parent38fc17befacfea70e12ab9244b90cfa8bc2e08c8 (diff)
parenta83c61a66ea7a0bfc21d86fddc9ea5325c86ac24 (diff)
downloadvis-e03ce9ae5a8ee6b460b2766b7adc756a91924494.tar.gz
vis-e03ce9ae5a8ee6b460b2766b7adc756a91924494.tar.xz
Merge branch 'hardening' of https://github.com/jvoisin/vis
-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