Currently both ASAN and UBSAN are supported on Windows but only ASAN is enabled in LLVM build system. This patch enables the option to build LLVM with UBSAN on windows.
Tested with clang-cl released in LLVM16.
Paths
| Differential D151511
[CMake] Enable building with UBSAN + clang-cl on windows ClosedPublic Authored by dwang on May 25 2023, 3:40 PM.
Details Summary Currently both ASAN and UBSAN are supported on Windows but only ASAN is enabled in LLVM build system. This patch enables the option to build LLVM with UBSAN on windows. Tested with clang-cl released in LLVM16.
Diff Detail
Event TimelineComment Actions
dwang retitled this revision from Enable building with UBSAN + enable_ubsan_clang_cl on windows to [CMake] Enable building with UBSAN + enable_ubsan_clang_cl on windows.May 26 2023, 10:25 AM dwang retitled this revision from [CMake] Enable building with UBSAN + enable_ubsan_clang_cl on windows to [CMake] Enable building with UBSAN on windows.May 26 2023, 10:30 AM dwang retitled this revision from [CMake] Enable building with UBSAN on windows to [CMake] Enable building with UBSAN + clang on windows.May 26 2023, 10:33 AM dwang retitled this revision from [CMake] Enable building with UBSAN + clang on windows to [CMake] Enable building with UBSAN + clang-cl on windows. Comment Actions Apart from the two nits, the CMake changes LGTM, although I haven't tested the patch myself. I'm not particularly familiar with UBSAN, so can't really comment on the other changes to ubsan_ignorelist.txt.
Comment Actions For the ubsan ignore list, the newly added files reported ubsan crashes similiar to the one reported in: https://github.com/llvm/llvm-project/issues/61775
Comment Actions For the UBSAN crashes, I found an alternative workaround here: https://github.com/llvm/llvm-project/issues/31914. Since the errors only reproduce on windows, this seems like a cleaner fix. This revision is now accepted and ready to land.Jun 12 2023, 8:08 AM Comment Actions @pgousseau Thanks for the review! This revision was landed with ongoing or failed builds.Jun 13 2023, 2:18 AM Closed by commit rG56bf960629cb: [CMake] Enable building with UBSAN + clang-cl on windows. (authored by pgousseau). · Explain Why This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 530829 llvm/cmake/modules/HandleLLVMOptions.cmake
llvm/include/llvm/ADT/EpochTracker.h
llvm/include/llvm/ADT/SmallPtrSet.h
llvm/include/llvm/ADT/StringMap.h
llvm/include/llvm/Support/AllocatorBase.h
|
Perhaps supported by clang-cl?