Page MenuHomeFreeBSD

Always build the sanitizer runtimes when compiling with clang
ClosedPublic

Authored by arichardson on Feb 8 2021, 10:29 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Mar 8, 10:58 AM
Unknown Object (File)
Fri, Mar 8, 10:58 AM
Unknown Object (File)
Fri, Mar 8, 10:18 AM
Unknown Object (File)
Fri, Mar 8, 10:10 AM
Unknown Object (File)
Feb 18 2024, 7:03 AM
Unknown Object (File)
Jan 9 2024, 10:36 AM
Unknown Object (File)
Dec 30 2023, 10:40 PM
Unknown Object (File)
Dec 20 2023, 5:37 AM
Subscribers

Details

Summary

This allows instrumenting e.g. test binaries even when compiling with an
external clang (e.g. CROSS_TOOLCHAIN=llvm11). I have some upcoming patches
that allow building the entire base system with ASan/UBSan/etc.
instrumentation and this is required in preparation for this.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

LGTM; as long as nobody tries to build these with gcc, it should be OK. On the other hand, maybe somebody will now complain that "clang stuff" is being built when they specifically disabled clang in their src.conf? But in that case we would need to add a separate MK_CLANG_RT option...

This revision is now accepted and ready to land.Feb 8 2021, 10:34 AM
In D28532#638643, @dim wrote:

LGTM; as long as nobody tries to build these with gcc, it should be OK. On the other hand, maybe somebody will now complain that "clang stuff" is being built when they specifically disabled clang in their src.conf? But in that case we would need to add a separate MK_CLANG_RT option...

Alternatively I could put this under MK_TOOLCHAIN?

In D28532#638643, @dim wrote:

LGTM; as long as nobody tries to build these with gcc, it should be OK. On the other hand, maybe somebody will now complain that "clang stuff" is being built when they specifically disabled clang in their src.conf? But in that case we would need to add a separate MK_CLANG_RT option...

Alternatively I could put this under MK_TOOLCHAIN?

I don't think so, because somebody who doesn't want to build toolchains (and thus uses llvm packages) will likely also have this option disabled. For now, lets just build this part unconditionally, at least when the compiler type is clang.

The *san runtimes are not that large / do not take too long to build I believe.
If we want to make them optional we could introduce MK_CLANG_RT or general MK_RUNTIMES or whatnot.