1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

chore(build): add hardening flags to default qTox builds

Re: #3452
This commit is contained in:
Zetok Zalbavar 2016-12-17 20:06:44 +00:00
parent 32bbdb2b98
commit 43b3f6e339
No known key found for this signature in database
GPG Key ID: C953D3880212068A

View File

@ -44,6 +44,20 @@ CONFIG += link_pkgconfig
# undocumented, but just works
CONFIG += silent
# Hardening flags (ASLR, warnings, etc)
# TODO: add `-Werror` to hardening flags once all warnings are fixed
QMAKE_CXXFLAGS += -fstack-protector-all \
-fPIE \
-Wstack-protector \
-Wstrict-overflow \
-Wstrict-aliasing \
--param ssp-buffer-size=1
# osx cannot into security (build on it fails with those enabled)
!macx {
QMAKE_LFLAGS += -Wl,-z,now -Wl,-z,relro
}
# needed, since `rtti_off` doesn't work
QMAKE_CXXFLAGS += -fno-rtti
QMAKE_RESOURCE_FLAGS += -compress 9 -threshold 0