xref: /freebsd/lib/libcompiler_rt/Makefile (revision 8524dc53fd4c6b79d75b82cb82f3ac72fc25e85f)
1a3cf0ef5SEd Schouten
2c6063d0dSWarner Losh.include <src.opts.mk>
3a3cf0ef5SEd Schouten
4a70cba95SGlen BarberPACKAGE=	lib${LIB}
5a3cf0ef5SEd SchoutenLIB=		compiler_rt
6a723bb66SRyan LibbyMK_SSP=		no
7a3cf0ef5SEd SchoutenNO_PIC=
8a3cf0ef5SEd SchoutenWARNS?=		2
9a3cf0ef5SEd Schouten
1053b715b5SDimitry AndricCFLAGS+=	${PICFLAG}
1153b715b5SDimitry AndricCFLAGS+=	-fvisibility=hidden
1253b715b5SDimitry AndricCFLAGS+=	-DVISIBILITY_HIDDEN
137ecd99faSDimitry AndricCFLAGS+=	-I${SRCTOP}/contrib/llvm-project/libunwind/include
14a3cf0ef5SEd Schouten
15d006dde2SDimitry Andric# gcc has incompatible internal declarations for __divtc3 and __multc3, but has
16d006dde2SDimitry Andric# no option to silence its warning, so make warnings non-fatal.
177fa2f2a6SAlex RichardsonMK_WERROR.gcc=	no
18d006dde2SDimitry Andric
19040b3049SEd Maste.include "Makefile.inc"
2079ef2c64SAndrew Turner
21cc55ee80SDimitry Andric# Out-of-line LSE atomics helpers for aarch64
22cc55ee80SDimitry Andric.if ${MACHINE_CPUARCH} == "aarch64"
23cc55ee80SDimitry Andric. for pat in cas swp ldadd ldclr ldeor ldset
24cc55ee80SDimitry Andric.  for size in 1 2 4 8 16
25*8524dc53SJessica Clarke.   for model in 1 2 3 4 5
26cc55ee80SDimitry Andric.    if ${pat} == "cas" || ${size} != "16"
27cc55ee80SDimitry Andric# Use .for to define lse_name, to get a special loop-local variable
28cc55ee80SDimitry Andric.     for lse_name in outline_atomic_${pat}${size}_${model}.S
29cc55ee80SDimitry AndricCLEANFILES+=	${lse_name}
30cc55ee80SDimitry AndricSTATICOBJS+=	${lse_name:R}.o
31cc55ee80SDimitry AndricACFLAGS.${lse_name}+= -DL_${pat} -DSIZE=${size} -DMODEL=${model} -I${CRTSRC}
32cc55ee80SDimitry Andric${lse_name}: lse.S
33cc55ee80SDimitry Andric	ln -sf ${.ALLSRC} ${.TARGET}
34cc55ee80SDimitry Andric.     endfor # lse_name
35cc55ee80SDimitry Andric.    endif
36cc55ee80SDimitry Andric.   endfor # model
37cc55ee80SDimitry Andric.  endfor # size
38cc55ee80SDimitry Andric. endfor # pat
39cc55ee80SDimitry Andric.endif
40cc55ee80SDimitry Andric
41a3cf0ef5SEd Schouten.if ${MK_INSTALLLIB} != "no"
42a3cf0ef5SEd SchoutenSYMLINKS+=	libcompiler_rt.a ${LIBDIR}/libgcc.a
43a3cf0ef5SEd Schouten.endif
44a3cf0ef5SEd Schouten.if ${MK_PROFILE} != "no"
45a3cf0ef5SEd SchoutenSYMLINKS+=	libcompiler_rt_p.a ${LIBDIR}/libgcc_p.a
46a3cf0ef5SEd Schouten.endif
47a3cf0ef5SEd Schouten
48a3cf0ef5SEd Schouten.include <bsd.lib.mk>
49