opnsense-src/lib/libc/x86/sys/Makefile.inc
Alex Richardson f0712132b6 Don't instrument the rdtsc ifunc when building with ASAN/UBSAN
The ifunc resolver is called before the sanitizer runtime is initialized,
so any instrumentation results in an immediate crash.

Reviewed By:	kib
Differential Revision: https://reviews.freebsd.org/D31046
2021-08-02 14:33:24 +01:00

22 lines
432 B
Makefile

# $FreeBSD$
.PATH: ${LIBC_SRCTOP}/x86/sys
SRCS+= \
__vdso_gettc.c \
pkru.c
MAN+= \
pkru.3
.if ${MACHINE_CPUARCH} == "amd64" && ${MK_HYPERV} != "no"
CFLAGS+= -DWANT_HYPERV
.endif
# We can't use sanitizer instrumentation on ifuncs called during sanitizer
# runtime startup.
.if ${MK_ASAN} != "no"
CFLAGS.__vdso_gettc.c+=-fno-sanitize=address
.endif
.if ${MK_UBSAN} != "no"
CFLAGS.__vdso_gettc.c+=-fno-sanitize=undefined
.endif