I added the libclang_rt libraries (Address Sanitizer, Undefined Behavior
Sanitizer and Profile Guided Optimization) from compiler-rt to the tree
recently, but did not connect them to the build yet.
The requirements for these libraries are:
- Must be built with clang, gcc (not even recent versions) can build them
- Only make sense to build when either the cross-tools stage (e.g. the stuff installed under ${WORLDTMP}) has clang enabled, or when then final world has clang enabled.
- The sanitizer libraries can only be built for i386 and amd64.
- The profile library can only be built for i386, amd64 and LE arm.
Apart from the bit of ugliness in lib/Makefile (which Warner does not
like), there is also still a practical problem, which I have not been
able to solve as of yet:
On amd64, the build32 stage will now build the libclang_rt libraries,
but due to ${LIB32IMAKE} containing MK_TOOLCHAIN=no, the install32 stage
will *not* install them. I don't see any easy way around this, excect
maybe partially reverting r264930, but that will get us back to the
situation with NO_INCS, which Warner tried to avoid with that commit.
Note that I also did not introduce yet another WITH_LIBCLANG_RT knob,
since I don't really see the need: WITH_CLANG should basically always
cause these libraries to be built and installed.
However, if the general opinion is that another knob is good to have, I
can implement it, and move the lib/Makefile ugliness to src.opts.mk
instead.