This is an archive of the discontinued LLVM Phabricator instance.

[cmake] Add LLVM_UBSAN_FLAGS, to allow overriding UBSan flags
ClosedPublic

Authored by vsk on Oct 14 2020, 7:12 PM.

Details

Summary

Allow overriding the default set of flags used to enable UBSan when
building llvm.

This can be used to test new checks or opt out of certain checks.

Diff Detail

Event Timeline

vsk created this revision.Oct 14 2020, 7:12 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 14 2020, 7:12 PM
Herald added a subscriber: mgorny. · View Herald Transcript
vsk requested review of this revision.Oct 14 2020, 7:12 PM
kastiglione added inline comments.Oct 26 2020, 10:52 AM
llvm/CMakeLists.txt
490

should this be option()? I think this will overwrite -DLLVM_UBSAN_FLAGS=<value>.

vsk added inline comments.Oct 26 2020, 3:18 PM
llvm/CMakeLists.txt
490

From what I gather, set(... CACHE ...) is appropriate here. This does not overwrite a -D command line option (otherwise -DLLVM_USE_SANITIZER would not work). Also, technically option doesn't support non-BOOL types, although in practice I'm not sure whether the distinction matters.

kastiglione accepted this revision.Oct 26 2020, 3:33 PM

thanks for correcting my misunderstanding

This revision is now accepted and ready to land.Oct 26 2020, 3:33 PM
This revision was landed with ongoing or failed builds.Oct 26 2020, 3:48 PM
This revision was automatically updated to reflect the committed changes.