xref: /freebsd/lib/libgcc_eh/Makefile.inc (revision 6580f5c38dd5b01aeeaed16b370f1a12423437f0)
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.if ${MACHINE} == "amd64" || ${MACHINE} == "i386" || ${MACHINE} == "powerpc"
21CFLAGS.UnwindLevel1-gcc-ext.c+=	-D_LIBUNWIND_SUPPORT_FRAME_APIS
22.endif
23.for file in ${SRCS_EXC:M*.c}
24CFLAGS.${file}+=	-fno-exceptions -funwind-tables
25.if ${MK_ASAN} != "no"
26# False-positives during stack unwinding
27CFLAGS.${file}+=	-fno-sanitize=address
28.endif
29.endfor
30.for file in ${SRCS_EXC:M*.cpp}
31CXXFLAGS.${file}+=	-fno-exceptions -funwind-tables
32.if ${MK_ASAN} != "no"
33# False-positives during stack unwinding
34CXXFLAGS.${file}+=	-fno-sanitize=address
35.endif
36.endfor
37
38CFLAGS+=	-I${UNWINDINCDIR}
39CFLAGS+=	-D_LIBUNWIND_IS_NATIVE_ONLY
40CFLAGS+=	-D_LIBUNWIND_USE_FRAME_HEADER_CACHE
41CXXFLAGS+=	-fno-rtti
42CXXSTD?=	c++11
43STATIC_CXXFLAGS+= -fvisibility=hidden -fPIC
44# Probably need to just move this earlier or use CXXFLAGS
45.if ${MK_DIRDEPS_BUILD} == "yes"
46# Avoid dependency on lib/libc++
47CFLAGS+=	-isystem ${SRCTOP}/contrib/llvm-project/libcxx/include -nostdinc++
48
49# we need this for __config_site
50CFLAGS+=	-I${SRCTOP}/lib/libc++
51.if ${.MAKE.LEVEL} > 0
52GENDIRDEPS_FILTER+= Nlib/libc++
53.endif
54.endif
55