added Clang UBSan support

- allow to enable UBSan with the CONFIG+=ubsan config with qmake
 - added UBSan.supp config to suppress Qt's errors, can be enabled using
   the UBSAN_OPTIONS=suppressions=<path>/UBSan.supp env. variable
This commit is contained in:
silverqx
2022-05-28 18:01:26 +02:00
parent 5f33a1f186
commit 6646909eb0
2 changed files with 23 additions and 0 deletions
+21
View File
@@ -41,3 +41,24 @@ QMAKE_CXXFLAGS_WARN_ON *= \
# Clang 12 still doesn't support -Wstrict-null-sentinel
!clang: QMAKE_CXXFLAGS_WARN_ON *= -Wstrict-null-sentinel
# Allow to enable UBSan with Clang
clang:ubsan: {
QMAKE_CXXFLAGS += -O1
QMAKE_CXXFLAGS *= \
-fsanitize=undefined \
-fsanitize=nullability \
-fsanitize=float-divide-by-zero \
-fsanitize=unsigned-integer-overflow \
-fsanitize=implicit-conversion \
-fsanitize=local-bounds \
QMAKE_LFLAGS *= \
-fsanitize=undefined \
-fsanitize=nullability \
-fsanitize=float-divide-by-zero \
-fsanitize=unsigned-integer-overflow \
-fsanitize=implicit-conversion \
-fsanitize=local-bounds
}
+2
View File
@@ -0,0 +1,2 @@
implicit-integer-sign-change:qarraydata.h
unsigned-integer-overflow:qhashfunctions.h