summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMadCamel <madcamel@gmail.com>2024-03-31 19:12:46 -0400
committerMadCamel <madcamel@gmail.com>2024-03-31 19:12:46 -0400
commit505f27650af670e4b59fedaa320da877c767db76 (patch)
tree3ff4bb7d5041ceea5ce15c6a04f392257c2c7b48
parentebf078b9fa81142834dc45e22ea661a61c50d17b (diff)
downloadtmwa-compiler_flags.tar.gz
tmwa-compiler_flags.tar.bz2
tmwa-compiler_flags.tar.xz
tmwa-compiler_flags.zip
Updated CFLAGS and LDFLAGS to enable more exploit mitigationscompiler_flags
TMWA is swiss cheese, let's at least make an attempt at mitigating remote exploitation by using features of the compiler and linker.
-rw-r--r--Makefile.in4
1 files changed, 3 insertions, 1 deletions
diff --git a/Makefile.in b/Makefile.in
index 10f909c..d009ed6 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -288,7 +288,9 @@ else
override CXX += -std=c++0x
endif
-CXXFLAGS += -fstack-protector
+CXXFLAGS += -fstack-protector-strong -fstack-clash-protection -fPIE -fsanitize=bounds -fsanitize-undefined-trap-on-error
+LDFLAGS += -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack -Wl,-z,separate-code
+
override CXXFLAGS += -fno-strict-aliasing
override CXXFLAGS += -fvisibility=hidden