libc/tests: Fix installation without MK_TOOLCHAIN

There is some exotic conditional logic here to avoid building a
particular test if a certain UBSAN library isn't present in the
toolchain sysroot.  This causes build failures for me when doing an
"installworld WITHOUT_TOOLCHAIN=", which I do frequently during tests.

I believe the problem is that SYSROOT is unset during installworld, so
the build sees the host's copy of libclang_rt.ubsan_standalone.a and
then tries to install a binary that wasn't built during buildworld.  Try
to make the check a bit less fragile.

Reviewed by:	dim
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D45035
This commit is contained in:
Mark Johnston 2024-05-28 08:24:43 -04:00
parent bf56e8b9c8
commit 8164d511d6

View file

@ -30,7 +30,7 @@ PROGS+= h_memset
# now on amd64 when it trips the stack bounds specified in t_ssp.sh . This
# probably needs to be fixed as it's currently hardcoded.
.if ${COMPILER_TYPE} == "clang" && !defined(_SKIP_BUILD) && \
(!defined(_RECURSING_PROGS) || ${PROG} == "h_raw")
(!defined(_RECURSING_PROGS) || ${PROG} == "h_raw") && ${MK_TOOLCHAIN} == "yes"
.include "${SRCTOP}/lib/libclang_rt/compiler-rt-vars.mk"
_libclang_rt_ubsan= ${SYSROOT}${SANITIZER_LIBDIR}/libclang_rt.ubsan_standalone-${CRTARCH}.a
.if exists(${_libclang_rt_ubsan})