xref: /freebsd/lib/libcompiler_rt/Makefile (revision cc55ee8009a550810d38777fd6ace9abf3a2f6b4)
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
1453b715b5SDimitry AndricCFLAGS+=	-I${SRCTOP}/contrib/libcxxrt
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
22*cc55ee80SDimitry Andric# Out-of-line LSE atomics helpers for aarch64
23*cc55ee80SDimitry Andric.if ${MACHINE_CPUARCH} == "aarch64"
24*cc55ee80SDimitry Andric. for pat in cas swp ldadd ldclr ldeor ldset
25*cc55ee80SDimitry Andric.  for size in 1 2 4 8 16
26*cc55ee80SDimitry Andric.   for model in 1 2 3 4
27*cc55ee80SDimitry Andric.    if ${pat} == "cas" || ${size} != "16"
28*cc55ee80SDimitry Andric# Use .for to define lse_name, to get a special loop-local variable
29*cc55ee80SDimitry Andric.     for lse_name in outline_atomic_${pat}${size}_${model}.S
30*cc55ee80SDimitry AndricCLEANFILES+=	${lse_name}
31*cc55ee80SDimitry AndricSTATICOBJS+=	${lse_name:R}.o
32*cc55ee80SDimitry AndricACFLAGS.${lse_name}+= -DL_${pat} -DSIZE=${size} -DMODEL=${model} -I${CRTSRC}
33*cc55ee80SDimitry Andric${lse_name}: lse.S
34*cc55ee80SDimitry Andric	ln -sf ${.ALLSRC} ${.TARGET}
35*cc55ee80SDimitry Andric.     endfor # lse_name
36*cc55ee80SDimitry Andric.    endif
37*cc55ee80SDimitry Andric.   endfor # model
38*cc55ee80SDimitry Andric.  endfor # size
39*cc55ee80SDimitry Andric. endfor # pat
40*cc55ee80SDimitry Andric.endif
41*cc55ee80SDimitry 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