Mir

Merge lp:~albaguirre/mir/add-ubsan-build-type into lp:mir

Proposed by Alberto Aguirre
Status: Merged
Approved by: Alexandros Frantzis
Approved revision: no longer in the source branch.
Merged at revision: 3161
Proposed branch: lp:~albaguirre/mir/add-ubsan-build-type
Merge into: lp:mir
Diff against target: 18 lines (+8/-0)
1 file modified
CMakeLists.txt (+8/-0)
To merge this branch: bzr merge lp:~albaguirre/mir/add-ubsan-build-type
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Alexandros Frantzis (community) Approve
Alan Griffiths Approve
Review via email: mp+279213@code.launchpad.net

Commit message

Add UBSan build type.

Invoke with -DCMAKE_BUILD_TYPE=ubsanitizer

Description of the change

Add UBSan build type.

Invoke with -DCMAKE_BUILD_TYPE=ubsanitizer

Adds support to create builds with the Undefined Behavior sanitizer (UBSan, -fsanitize=undefined) enabled.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

+ # Skip vptr checks, there seems to be missing RTTI information when linking with UBSan enabled

This is probably something we can fix. Logged as lp:1521930

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Alexandros Frantzis (afrantzis) wrote :

CI network failure.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt 2015-10-16 06:12:44 +0000
+++ CMakeLists.txt 2015-12-02 00:07:27 +0000
@@ -107,6 +107,14 @@
107 endif()107 endif()
108 set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -fsanitize=thread")108 set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -fsanitize=thread")
109 set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fsanitize=thread")109 set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fsanitize=thread")
110elseif(cmake_build_type_lower MATCHES "ubsanitizer")
111 # Skip vptr checks, there seems to be missing RTTI information when linking with UBSan enabled
112 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=undefined -fno-sanitize=vptr -fno-omit-frame-pointer")
113 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=undefined -fno-sanitize=vptr -fno-omit-frame-pointer")
114 set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -fsanitize=undefined -fno-sanitize=vptr")
115 set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fsanitize=undefined -fno-sanitize=vptr")
116 # "Symbol already defined" errors occur with pre-compiled headers
117 SET(MIR_USE_PRECOMPILED_HEADERS OFF CACHE BOOL "Use precompiled headers" FORCE)
110else()118else()
111 # AddressSanitizer builds fail if we disallow undefined symbols119 # AddressSanitizer builds fail if we disallow undefined symbols
112 set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined")120 set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined")

Subscribers

People subscribed via source and target branches