Added security hardening flags for ASLR and DEP protection for Windows compile.

This commit is contained in:
thunder2 2016-01-28 16:20:11 +01:00
parent 85cdfcc721
commit 8dde723e90
3 changed files with 24 additions and 0 deletions

View File

@ -28,6 +28,14 @@ win32 {
QMAKE_CFLAGS += -Wextra QMAKE_CFLAGS += -Wextra
QMAKE_CXXFLAGS += -Wextra QMAKE_CXXFLAGS += -Wextra
CONFIG(debug, debug|release) {
} else {
# Tell linker to use ASLR protection
QMAKE_LFLAGS += -Wl,-dynamicbase
# Tell linker to use DEP protection
QMAKE_LFLAGS += -Wl,-nxcompat
}
# solve linker warnings because of the order of the libraries # solve linker warnings because of the order of the libraries
QMAKE_LFLAGS += -Wl,--start-group QMAKE_LFLAGS += -Wl,--start-group

View File

@ -157,6 +157,14 @@ win32 {
QMAKE_CFLAGS += -Wextra QMAKE_CFLAGS += -Wextra
QMAKE_CXXFLAGS += -Wextra QMAKE_CXXFLAGS += -Wextra
CONFIG(debug, debug|release) {
} else {
# Tell linker to use ASLR protection
QMAKE_LFLAGS += -Wl,-dynamicbase
# Tell linker to use DEP protection
QMAKE_LFLAGS += -Wl,-nxcompat
}
# solve linker warnings because of the order of the libraries # solve linker warnings because of the order of the libraries
QMAKE_LFLAGS += -Wl,--start-group QMAKE_LFLAGS += -Wl,--start-group

View File

@ -72,6 +72,14 @@ win32 {
# solve linker warnings because of the order of the libraries # solve linker warnings because of the order of the libraries
QMAKE_LFLAGS += -Wl,--start-group QMAKE_LFLAGS += -Wl,--start-group
CONFIG(debug, debug|release) {
} else {
# Tell linker to use ASLR protection
QMAKE_LFLAGS += -Wl,-dynamicbase
# Tell linker to use DEP protection
QMAKE_LFLAGS += -Wl,-nxcompat
}
for(lib, LIB_DIR):LIBS += -L"$$lib" for(lib, LIB_DIR):LIBS += -L"$$lib"
LIBS += -lssl -lcrypto -lpthread -lminiupnpc -lz LIBS += -lssl -lcrypto -lpthread -lminiupnpc -lz
LIBS += -lcrypto -lws2_32 -lgdi32 LIBS += -lcrypto -lws2_32 -lgdi32