summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorDaniel Borkmann <dborkman@redhat.com>2013-05-24 13:32:04 +0200
committerDaniel Borkmann <dborkman@redhat.com>2013-05-24 13:40:36 +0200
commit37dd6912701cb16f6339af97216e159c3f9038ee (patch)
tree3523b2941175a1d35d74ae25e77fd06fef0297e3 /Makefile
parent97d26b9ee4bffda96e74fd1379cdddd47adbaf49 (diff)
make: minor update in cflags
Add -z relro for linking, move --param ssp-buffer-size=4 to stack protector flag, and more. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile9
1 files changed, 5 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index c35cd07..2c7852a 100644
--- a/Makefile
+++ b/Makefile
@@ -38,7 +38,8 @@ endif
# For packaging purposes, you might want to call your own:
# make CFLAGS="<flags>"
-CFLAGS_DEF = -fstack-protector
+CFLAGS_DEF = -fstack-protector-all -Wstack-protector
+CFLAGS_DEF += --param=ssp-buffer-size=4
ifeq ($(DEBUG), 1)
CFLAGS_DEF += -g
CFLAGS_DEF += -O2
@@ -46,13 +47,13 @@ else
CFLAGS_DEF += -march=native
CFLAGS_DEF += -mtune=native
CFLAGS_DEF += -O3
- CFLAGS_DEF += -fpie
+ CFLAGS_DEF += -fPIE -pie
CFLAGS_DEF += -pipe
CFLAGS_DEF += -fomit-frame-pointer
+ CFLAGS_DEF += -Wl,-z,relro,-z,now
endif
-CFLAGS_DEF += --param=ssp-buffer-size=4
CFLAGS_DEF += -fno-strict-aliasing
-CFLAGS_DEF += -fexceptions
+CFLAGS_DEF += -fexceptions -ftrapv
CFLAGS_DEF += -fasynchronous-unwind-tables
CFLAGS_DEF += -fno-delete-null-pointer-checks
CFLAGS_DEF += -D_FORTIFY_SOURCE=2