Page MenuHomePhabricator

[Driver] Support UBSan multilib
AcceptedPublic

Authored by phosek on Nov 12 2020, 1:26 PM.

Details

Summary

This is analogous to the existing ASan multilib.

Diff Detail

Unit TestsFailed

TimeTest
390 mslinux > Clang.Driver::fuchsia.cpp
Script: -- : 'RUN: at line 1'; /mnt/disks/ssd0/agent/llvm-project/build/bin/clang --driver-mode=g++ /mnt/disks/ssd0/agent/llvm-project/clang/test/Driver/fuchsia.cpp -### -no-canonical-prefixes --target=x86_64-fuchsia -ccc-install-dir /mnt/disks/ssd0/agent/llvm-project/clang/test/Driver/Inputs/basic_fuchsia_tree/bin -resource-dir=/mnt/disks/ssd0/agent/llvm-project/clang/test/Driver/Inputs/resource_dir_with_per_target_subdir --sysroot=/mnt/disks/ssd0/agent/llvm-project/clang/test/Driver/platform -fuse-ld=lld 2>&1 | /mnt/disks/ssd0/agent/llvm-project/build/bin/FileCheck -check-prefixes=CHECK,CHECK-X86_64 /mnt/disks/ssd0/agent/llvm-project/clang/test/Driver/fuchsia.cpp
370 mslinux > HWAddressSanitizer-x86_64.TestCases::sizes.cpp
Script: -- : 'RUN: at line 3'; /mnt/disks/ssd0/agent/llvm-project/build/./bin/clang --driver-mode=g++ -m64 -gline-tables-only -fsanitize=hwaddress -fuse-ld=lld -mcmodel=large -mllvm -hwasan-globals -mllvm -hwasan-use-short-granules -mllvm -hwasan-instrument-landing-pads=0 -mllvm -hwasan-instrument-personality-functions /mnt/disks/ssd0/agent/llvm-project/compiler-rt/test/hwasan/TestCases/sizes.cpp -nostdlib++ -lstdc++ -o /mnt/disks/ssd0/agent/llvm-project/build/projects/compiler-rt/test/hwasan/X86_64/TestCases/Output/sizes.cpp.tmp
2,120 mswindows > Clang.Driver::fuchsia.cpp
Script: -- : 'RUN: at line 1'; c:\ws\w16-1\llvm-project\premerge-checks\build\bin\clang.exe --driver-mode=g++ C:\ws\w16-1\llvm-project\premerge-checks\clang\test\Driver\fuchsia.cpp -### -no-canonical-prefixes --target=x86_64-fuchsia -ccc-install-dir C:\ws\w16-1\llvm-project\premerge-checks\clang\test\Driver/Inputs/basic_fuchsia_tree/bin -resource-dir=C:\ws\w16-1\llvm-project\premerge-checks\clang\test\Driver/Inputs/resource_dir_with_per_target_subdir --sysroot=C:\ws\w16-1\llvm-project\premerge-checks\clang\test\Driver/platform -fuse-ld=lld 2>&1 | c:\ws\w16-1\llvm-project\premerge-checks\build\bin\filecheck.exe -check-prefixes=CHECK,CHECK-X86_64 C:\ws\w16-1\llvm-project\premerge-checks\clang\test\Driver\fuchsia.cpp

Event Timeline

phosek created this revision.Nov 12 2020, 1:26 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 12 2020, 1:26 PM
phosek requested review of this revision.Nov 12 2020, 1:26 PM
This revision is now accepted and ready to land.Nov 12 2020, 1:40 PM
mcgrathr added inline comments.Nov 13 2020, 11:30 AM
clang/cmake/caches/Fuchsia-stage2.cmake
214–215

Don't you need plain +ubsan instances of these like for +asan above?

216–217

Standalone ubsan doesn't replace the allocator, so these shouldn't be overridden for it like they are for asan.

clang/lib/Driver/ToolChains/Fuchsia.cpp
205

This being the case, should we be adding -fsanitize=undefined to the libc++ (et al) build for asan?
I guess that's an orthogonal change, really.

217

This is getting to be a lot of individual ordered integer constants to maintain.
Can we just define a local enum to represent the ordering and use symbolic names in each call?