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