Fix build of stand/ when building world with ASAN
authorAlex Richardson <arichardson@FreeBSD.org>
Mon, 2 Aug 2021 08:50:16 +0000 (09:50 +0100)
committerAlex Richardson <arichardson@FreeBSD.org>
Mon, 2 Aug 2021 13:33:24 +0000 (14:33 +0100)
commit5e9226f063bc43574e2168b4aafad8232f08002a
treecf852dafb6b1c7bc523a209f846c79386f9b0b92
parentc826e08841fbcc0ba0c5a78aa09d6ee22a95f2f9
Fix build of stand/ when building world with ASAN

The userboot/test  program links against the default userspace libraries
(e.g. shared libgcc_s.so) that will be instrumented if WITH_ASAN is set.
All other programs link against libsa instead of libc and therefore can't
use the sanitizer runtime library. To fix the stand/ build with
sanitizers, we disable MK_ASAN/MK_UBSAN if -nostdlib is found in the
LDFLAGS (i.e. we are using libsa instead of libc).

Reviewed By: imp, tsoome
Differential Revision: https://reviews.freebsd.org/D31047
stand/defs.mk
stand/userboot/userboot/Makefile