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