d5576b1cb8
GCC and Clang support compiler intrinsic error detections tools: address, memory, thread, undefined Let users conveniently enable it in qmake, for instance with CONFIG += sanitizer sanitize_address Also add a -sanitize [...] option to configure to use it by default for both the Qt libraries, and user applications. [ChangeLog][configure] Added support for GCC/Clang -fsanitize= options Change-Id: Ie5418abcdf41842566df510d7707e41739e66f87 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
31 lines
865 B
Plaintext
31 lines
865 B
Plaintext
# Sanitizer flags
|
|
|
|
|
|
sanitize_address {
|
|
QMAKE_CFLAGS += $$QMAKE_SANITIZE_ADDRESS_CFLAGS
|
|
QMAKE_CXXFLAGS += $$QMAKE_SANITIZE_ADDRESS_CXXFLAGS
|
|
QMAKE_LFLAGS += $$QMAKE_SANITIZE_ADDRESS_LFLAGS
|
|
}
|
|
|
|
sanitize_memory {
|
|
QMAKE_CFLAGS += $$QMAKE_SANITIZE_MEMORY_CFLAGS
|
|
QMAKE_CXXFLAGS += $$QMAKE_SANITIZE_MEMORY_CXXFLAGS
|
|
QMAKE_LFLAGS += $$QMAKE_SANITIZE_MEMORY_LFLAGS
|
|
}
|
|
|
|
sanitize_thread {
|
|
QMAKE_CFLAGS += $$QMAKE_SANITIZE_THREAD_CFLAGS
|
|
QMAKE_CXXFLAGS += $$QMAKE_SANITIZE_THREAD_CXXFLAGS
|
|
QMAKE_LFLAGS += $$QMAKE_SANITIZE_THREAD_LFLAGS
|
|
}
|
|
|
|
sanitize_undefined {
|
|
QMAKE_CFLAGS += $$QMAKE_SANITIZE_UNDEFINED_CFLAGS
|
|
QMAKE_CXXFLAGS += $$QMAKE_SANITIZE_UNDEFINED_CXXFLAGS
|
|
QMAKE_LFLAGS += $$QMAKE_SANITIZE_UNDEFINED_LFLAGS
|
|
}
|
|
|
|
QMAKE_CFLAGS += $$QMAKE_COMMON_SANITIZE_CFLAGS
|
|
QMAKE_CXXFLAGS += $$QMAKE_COMMON_SANITIZE_CXXFLAGS
|
|
|