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+= -D_LIBUNWIND_IS_NATIVE_ONLY 38CFLAGS+= -D_LIBUNWIND_USE_FRAME_HEADER_CACHE 39CXXFLAGS+= -fno-rtti 40CXXSTD?= c++11 41STATIC_CXXFLAGS+= -fvisibility=hidden -fPIC 42# Probably need to just move this earlier or use CXXFLAGS 43.if ${MK_DIRDEPS_BUILD} == "yes" 44# Avoid dependency on lib/libc++ 45CFLAGS+= -isystem ${SRCTOP}/contrib/llvm-project/libcxx/include -nostdinc++ 46 47# we need this for __config_site 48CFLAGS+= -I${SRCTOP}/lib/libc++ 49.if ${.MAKE.LEVEL} > 0 50GENDIRDEPS_FILTER+= Nlib/libc++ 51.endif 52.endif 53