1COMPILERRTDIR= ${SRCTOP}/contrib/llvm-project/compiler-rt 2UNWINDINCDIR= ${SRCTOP}/contrib/llvm-project/libunwind/include 3UNWINDSRCDIR= ${SRCTOP}/contrib/llvm-project/libunwind/src 4 5STATIC_CFLAGS+=${PICFLAG} -fvisibility=hidden -DVISIBILITY_HIDDEN 6 7.PATH: ${COMPILERRTDIR}/lib/builtins 8.PATH: ${UNWINDSRCDIR} 9SRCS_EXC+= gcc_personality_v0.c 10SRCS_EXC+= Unwind-EHABI.cpp 11SRCS_EXC+= Unwind-sjlj.c 12SRCS_EXC+= UnwindLevel1-gcc-ext.c 13SRCS_EXC+= UnwindLevel1.c 14SRCS_EXC+= UnwindRegistersRestore.S 15SRCS_EXC+= UnwindRegistersSave.S 16SRCS_EXC+= libunwind.cpp 17 18SRCS+= ${SRCS_EXC} 19.if ${MACHINE} == "amd64" || ${MACHINE} == "i386" || ${MACHINE} == "powerpc" 20CFLAGS.UnwindLevel1-gcc-ext.c+= -D_LIBUNWIND_SUPPORT_FRAME_APIS 21.endif 22.for file in ${SRCS_EXC:M*.c} 23CFLAGS.${file}+= -fno-exceptions -funwind-tables 24.if ${MK_ASAN} != "no" 25# False-positives during stack unwinding 26CFLAGS.${file}+= -fno-sanitize=address 27.endif 28.endfor 29.for file in ${SRCS_EXC:M*.cpp} 30CXXFLAGS.${file}+= -fno-exceptions -funwind-tables 31.if ${MK_ASAN} != "no" 32# False-positives during stack unwinding 33CXXFLAGS.${file}+= -fno-sanitize=address 34.endif 35.endfor 36 37CFLAGS+= -I${UNWINDINCDIR} 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 48# we need this for __config_site 49CFLAGS+= -I${SRCTOP}/lib/libc++ 50.if ${.MAKE.LEVEL} > 0 51GENDIRDEPS_FILTER+= Nlib/libc++ 52.endif 53.endif 54