xref: /netbsd-src/external/gpl3/gcc/lib/libasan/Makefile (revision f96b448e4dc9bfcbcb726459a4a946979dcef3dc)
1# $NetBSD: Makefile,v 1.37 2024/09/30 00:32:12 kalvisd Exp $
2
3UNSUPPORTED_COMPILER.clang=	# defined
4NOSANITIZER=	# defined
5
6.include <bsd.own.mk>
7
8.include "../Makefile.inc"
9.include "../Makefile.sanitizer"
10
11.PATH: ${SANITIZER}/asan ${SANITIZER}/lsan
12
13# XXXmknative
14ASAN_SRCS= \
15	asan_activation.cpp \
16	asan_allocator.cpp \
17	asan_debugging.cpp \
18	asan_descriptions.cpp \
19	asan_errors.cpp \
20	asan_fake_stack.cpp \
21	asan_flags.cpp \
22	asan_globals.cpp \
23	asan_interceptors.cpp \
24	asan_interceptors_memintrinsics.cpp \
25	asan_linux.cpp \
26	asan_mac.cpp \
27	asan_malloc_linux.cpp \
28	asan_malloc_mac.cpp \
29	asan_malloc_win.cpp \
30	asan_memory_profile.cpp \
31	asan_new_delete.cpp \
32	asan_poisoning.cpp \
33	asan_posix.cpp \
34	asan_premap_shadow.cpp \
35	asan_report.cpp \
36	asan_rtl.cpp \
37	asan_shadow_setup.cpp \
38	asan_stack.cpp \
39	asan_stats.cpp \
40	asan_suppressions.cpp \
41	asan_thread.cpp \
42	asan_win.cpp \
43	asan_win_dll_thunk.cpp \
44	asan_win_dynamic_runtime_thunk.cpp \
45	asan_interceptors_vfork.S
46
47LIB=	asan
48SRCS+=	${ASAN_SRCS} lsan_common.cpp lsan_common_linux.cpp
49LIBDPLIBS+= rt ${NETBSDSRCDIR}/lib/librt
50LIBDPLIBS+= m  ${NETBSDSRCDIR}/lib/libm
51LIBDPLIBS+= pthread ${NETBSDSRCDIR}/lib/libpthread
52CPPFLAGS+=-DCAN_SANITIZE_UB=0
53
54.if ${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipseb"
55COPTS.asan_interceptors.cpp += -O1
56.endif
57
58# This helps, but isn't enough.
59.if ${MACHINE_ARCH} == "m68k" || ${MACHINE_ARCH} == "m68000"
60COPTS.asan_interceptors.cpp += -fno-jump-tables -Os
61COPTS.asan_interceptors.cpp += -mlong-jump-table-offsets -Os
62.endif
63
64.include <bsd.lib.mk>
65