1
2.include <src.opts.mk>
3
4PACKAGE=	lib${LIB}
5LIB=		compiler_rt
6MK_SSP=		no
7NO_PIC=
8WARNS?=		2
9
10CFLAGS+=	${PICFLAG}
11CFLAGS+=	-fvisibility=hidden
12CFLAGS+=	-DVISIBILITY_HIDDEN
13CFLAGS+=	-I${SRCTOP}/contrib/llvm-project/libunwind/include
14
15# gcc has incompatible internal declarations for __divtc3 and __multc3, but has
16# no option to silence its warning, so make warnings non-fatal.
17MK_WERROR.gcc=	no
18
19.include "Makefile.inc"
20
21# Out-of-line LSE atomics helpers for aarch64
22.if ${MACHINE_CPUARCH} == "aarch64"
23. for pat in cas swp ldadd ldclr ldeor ldset
24.  for size in 1 2 4 8 16
25.   for model in 1 2 3 4 5
26.    if ${pat} == "cas" || ${size} != "16"
27# Use .for to define lse_name, to get a special loop-local variable
28.     for lse_name in outline_atomic_${pat}${size}_${model}.S
29CLEANFILES+=	${lse_name}
30STATICOBJS+=	${lse_name:R}.o
31ACFLAGS.${lse_name}+= -DL_${pat} -DSIZE=${size} -DMODEL=${model} -I${CRTSRC}
32${lse_name}: lse.S
33	ln -sf ${.ALLSRC} ${.TARGET}
34.     endfor # lse_name
35.    endif
36.   endfor # model
37.  endfor # size
38. endfor # pat
39.endif
40
41.if ${MK_INSTALLLIB} != "no"
42SYMLINKS+=	libcompiler_rt.a ${LIBDIR}/libgcc.a
43.endif
44.if ${MK_PROFILE} != "no"
45SYMLINKS+=	libcompiler_rt_p.a ${LIBDIR}/libgcc_p.a
46.endif
47
48.include <bsd.lib.mk>
49