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