xref: /freebsd/lib/libgcc_eh/Makefile.inc (revision 2e3507c25e42292b45a5482e116d278f5515d04d)
1
2COMPILERRTDIR=	${SRCTOP}/contrib/llvm-project/compiler-rt
3UNWINDINCDIR=	${SRCTOP}/contrib/llvm-project/libunwind/include
4UNWINDSRCDIR=	${SRCTOP}/contrib/llvm-project/libunwind/src
5
6STATIC_CFLAGS+=${PICFLAG} -fvisibility=hidden -DVISIBILITY_HIDDEN
7
8.PATH: ${COMPILERRTDIR}/lib/builtins
9.PATH: ${UNWINDSRCDIR}
10SRCS_EXC+=	gcc_personality_v0.c
11SRCS_EXC+=	Unwind-EHABI.cpp
12SRCS_EXC+=	Unwind-sjlj.c
13SRCS_EXC+=	UnwindLevel1-gcc-ext.c
14SRCS_EXC+=	UnwindLevel1.c
15SRCS_EXC+=	UnwindRegistersRestore.S
16SRCS_EXC+=	UnwindRegistersSave.S
17SRCS_EXC+=	libunwind.cpp
18
19SRCS+=		${SRCS_EXC}
20.for file in ${SRCS_EXC:M*.c}
21CFLAGS.${file}+=	-fno-exceptions -funwind-tables
22.if ${MK_ASAN} != "no"
23# False-positives during stack unwinding
24CFLAGS.${file}+=	-fno-sanitize=address
25.endif
26.endfor
27.for file in ${SRCS_EXC:M*.cpp}
28CXXFLAGS.${file}+=	-fno-exceptions -funwind-tables
29.if ${MK_ASAN} != "no"
30# False-positives during stack unwinding
31CXXFLAGS.${file}+=	-fno-sanitize=address
32.endif
33.endfor
34
35CFLAGS+=	-I${UNWINDINCDIR}
36CFLAGS+=	-D_LIBUNWIND_IS_NATIVE_ONLY
37CFLAGS+=	-D_LIBUNWIND_USE_FRAME_HEADER_CACHE
38CXXFLAGS+=	-fno-rtti
39CXXSTD?=	c++11
40STATIC_CXXFLAGS+= -fvisibility=hidden -fPIC
41# Probably need to just move this earlier or use CXXFLAGS
42.if ${MK_DIRDEPS_BUILD} == "yes"
43# Avoid dependency on lib/libc++
44CFLAGS+=	-isystem ${SRCTOP}/contrib/llvm-project/libcxx/include -nostdinc++
45
46# we need this for __config_site
47CFLAGS+=	-I${SRCTOP}/lib/libc++
48.if ${.MAKE.LEVEL} > 0
49GENDIRDEPS_FILTER+= Nlib/libc++
50.endif
51.endif
52