Define _REENTRANT for MKSANITIZER build. This is needed for at least stdio
code. This caused new build issued with duplicated symbols in few places
and rump kernel code picking different code paths borrowed from libc.
Handle all this in one go.
Add bsd.sanitizer.mk to share common code used by programs and libraries.
Switch from realall to beforeinstall target in .syms files. This is more
reliable in MKSANITIZER.
Fix generation of .a.syms files in LLVM sanitizers. The old rules weren't
functional and sometimes they were fatal in the build.
Add the .a.syms files to distribution sets.
These files are generated only in certain .a files in 64bit version of
sanitizers.
Correct the location of files with LLVM sanitizers. Move the LLVM sanitizer
entries from base to comp files.
Register external/bsd/compiler_rt as a _SUBDIR. This will allow to handle
properly includes specific for compiler_rt.
Centralize build_install target for external/bsd/compiler_rt.
With the above changes MKOBJDIR is now respected properly for me.
Do not install LLVM sanitizers into TOOLDIR for !HAVE_LLVM.
Do not error if a priority from 0 to 100 is used for constructor or
destructor.
Use -Wno-error to silence all errors from this warning type. There should
be used -Wno-prio-ctor-dtor, but it's not supported by GCC7.
Add i386 support for LLVM sanitizers.
Add new build phases do-sanitizer-* for building LLVM sanitizers after libs
and before other programs. This phase is important as sanitizers need
to link with libs and sanitized programs must link with sanitizer runtimes.
The sanitizers are special purpose piece of software that needs customized
build rules. Do not bother with generating debuginfo files for them.
Fixes MKDEBUG=yes build
Leak Sanitizer header is already needed in the distribution for built with
Address Sanitizer (MKSANITIZER):
- dist/llvm/utils/TableGen/TableGen.cpp
- dist/clang/utils/TableGen/TableGen.cpp
Next version of LLVM (9.0) will ship with LSan.
Add build rules for LLVM in all the supported variations for NetBSD/amd64:
- asan
- xray
- tsan, dd
- libfuzzer
- msan
- safestack
- ubsan
These build rules compile functional sanitizers.
The build rules are still not hooked into the distribution build, as there
is pending work on backporting improvements for the llvm-8 branch needed
for netbsd-9 and newer.