Commit Graph

12 Commits

Author SHA1 Message Date
kamil 9d306cc429 Install LLVM sanitizers into usr/lib/clang/9.0.0 2020-02-07 19:00:10 +00:00
kamil 1222d7c306 Set NOLIBCSANITIZER for LLVM sanitizer runtimes
Do not sanitize sanitizer runtimes.
2019-09-03 03:04:31 +00:00
kamil ea3d61d0f9 Register syms.extra in LLVM sanitizer .syms files
syms.extra contain additional content that has to be shipped with these
.syms files.

At least libFuzzer requires the .syms files to be in order.
2019-08-30 23:36:40 +00:00
kamil 1a5f018b01 Enhance the support of LLVM sanitizers
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.
2019-08-27 22:48:53 +00:00
kamil a0f3a067f2 Correct the build rules of LLVM sanitizers
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.
2019-08-26 04:49:45 +00:00
kamil ae9c7cb925 Rework the LLVM compiler_rt build rules
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.
2019-08-25 06:06:48 +00:00
kamil 648288fe75 Fix LLVM sanitizer build by GCC (HAVE_LLVM=no)
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.
2019-08-23 19:26:02 +00:00
kamil 4ed00d96e7 Enhance MKSANITIZER support
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.
2019-08-23 06:38:27 +00:00
adam 4e86ae76ab Fix building compiler_rt with MKCOMPAT=no; approved by kamil@ 2019-08-22 18:15:44 +00:00
kamil 0da4a66149 Set NODEBUG for LLVM sanitizers
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
2019-08-16 23:07:20 +00:00
kamil 645a2f39f4 Ship with sanitizer/lsan_interface.h for LLVM 7
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.
2019-08-15 16:31:17 +00:00
kamil 2d8e86c2f2 Add compiler-rt build rules for LLVM sanitizers &co
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.
2019-08-08 14:00:27 +00:00