aboutsummaryrefslogtreecommitdiff
path: root/lib/ubsan/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ubsan/CMakeLists.txt')
-rw-r--r--lib/ubsan/CMakeLists.txt5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/ubsan/CMakeLists.txt b/lib/ubsan/CMakeLists.txt
index 09c7a851e075..541138044654 100644
--- a/lib/ubsan/CMakeLists.txt
+++ b/lib/ubsan/CMakeLists.txt
@@ -17,7 +17,12 @@ include_directories(..)
set(UBSAN_CFLAGS ${SANITIZER_COMMON_CFLAGS})
append_no_rtti_flag(UBSAN_CFLAGS)
+append_list_if(COMPILER_RT_HAS_WGLOBAL_CONSTRUCTORS_FLAG -Wglobal-constructors
+ UBSAN_CFLAGS)
+
set(UBSAN_CXXFLAGS ${SANITIZER_COMMON_CFLAGS})
+append_list_if(COMPILER_RT_HAS_WGLOBAL_CONSTRUCTORS_FLAG -Wglobal-constructors
+ UBSAN_CXXFLAGS)
add_custom_target(ubsan)