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)
Mon, Nov 11, 11:50 PM
Unknown Object (File)
Mon, Nov 11, 11:47 PM
Unknown Object (File)
Mon, Nov 11, 11:18 PM
Unknown Object (File)
Sat, Oct 19, 5:50 AM
Unknown Object (File)
Sat, Oct 19, 5:50 AM
Unknown Object (File)
Sat, Oct 19, 5:50 AM
Unknown Object (File)
Sat, Oct 19, 5:30 AM
Unknown Object (File)
Oct 2 2024, 11:09 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.