xref: /freebsd/lib/libcompiler_rt/Makefile.inc (revision 0957b409a90fd597c1e9124cbaf3edd2b488f4ac)
1# $FreeBSD$
2
3CRTARCH=	${MACHINE_CPUARCH:C/amd64/x86_64/}
4
5CRTSRC=		${SRCTOP}/contrib/compiler-rt/lib/builtins
6
7.PATH:		${CRTSRC}/${CRTARCH}
8.PATH:		${CRTSRC}
9
10SRCF+=		absvdi2
11SRCF+=		absvsi2
12SRCF+=		absvti2
13SRCF+=		addvdi3
14SRCF+=		addvsi3
15SRCF+=		addvti3
16SRCF+=		apple_versioning
17SRCF+=		ashldi3
18SRCF+=		ashlti3
19SRCF+=		ashrdi3
20SRCF+=		ashrti3
21SRCF+=		clear_cache
22SRCF+=		clzdi2
23SRCF+=		clzsi2
24SRCF+=		clzti2
25SRCF+=		cmpdi2
26SRCF+=		cmpti2
27SRCF+=		ctzdi2
28SRCF+=		ctzsi2
29SRCF+=		ctzti2
30SRCF+=		divdc3
31SRCF+=		divdi3
32SRCF+=		divmoddi4
33SRCF+=		divmodsi4
34SRCF+=		divsc3
35SRCF+=		divsi3
36SRCF+=		divtc3
37SRCF+=		divti3
38SRCF+=		divxc3
39SRCF+=		enable_execute_stack
40SRCF+=		eprintf
41SRCF+=		extendhfsf2
42SRCF+=		ffsdi2
43SRCF+=		ffssi2
44SRCF+=		ffsti2
45SRCF+=		fixdfdi
46SRCF+=		fixdfti
47SRCF+=		fixsfdi
48SRCF+=		fixsfti
49SRCF+=		fixunsdfdi
50SRCF+=		fixunsdfsi
51SRCF+=		fixunsdfti
52SRCF+=		fixunssfdi
53SRCF+=		fixunssfsi
54SRCF+=		fixunssfti
55SRCF+=		fixunsxfdi
56SRCF+=		fixunsxfsi
57SRCF+=		fixunsxfti
58SRCF+=		fixxfdi
59SRCF+=		fixxfti
60SRCF+=		floatditf
61SRCF+=		floatsitf
62SRCF+=		floattidf
63SRCF+=		floattisf
64SRCF+=		floattixf
65SRCF+=		floatunditf
66SRCF+=		floatunsidf
67SRCF+=		floatunsisf
68SRCF+=		floatuntidf
69SRCF+=		floatuntisf
70SRCF+=		floatuntixf
71SRCF+=		gcc_personality_v0
72SRCF+=		int_util
73SRCF+=		lshrdi3
74SRCF+=		lshrti3
75SRCF+=		moddi3
76SRCF+=		modsi3
77SRCF+=		modti3
78SRCF+=		muldc3
79SRCF+=		muldi3
80SRCF+=		mulodi4
81SRCF+=		mulosi4
82SRCF+=		muloti4
83SRCF+=		mulsc3
84SRCF+=		multi3
85SRCF+=		mulvdi3
86SRCF+=		mulvsi3
87SRCF+=		mulvti3
88SRCF+=		multc3
89SRCF+=		mulxc3
90SRCF+=		negdf2
91SRCF+=		negdi2
92SRCF+=		negsf2
93SRCF+=		negti2
94SRCF+=		negvdi2
95SRCF+=		negvsi2
96SRCF+=		negvti2
97SRCF+=		paritydi2
98SRCF+=		paritysi2
99SRCF+=		parityti2
100SRCF+=		popcountdi2
101SRCF+=		popcountsi2
102SRCF+=		popcountti2
103SRCF+=		powidf2
104SRCF+=		powisf2
105SRCF+=		powitf2
106SRCF+=		powixf2
107SRCF+=		subvdi3
108SRCF+=		subvsi3
109SRCF+=		subvti3
110SRCF+=		trampoline_setup
111SRCF+=		truncdfhf2
112SRCF+=		truncsfhf2
113SRCF+=		ucmpdi2
114SRCF+=		ucmpti2
115SRCF+=		udivdi3
116SRCF+=		udivmoddi4
117SRCF+=		udivmodsi4
118SRCF+=		udivmodti4
119SRCF+=		udivsi3
120SRCF+=		udivti3
121SRCF+=		umoddi3
122SRCF+=		umodsi3
123SRCF+=		umodti3
124
125# Avoid using SSE2 instructions on i386, if unsupported.
126.if ${MACHINE_CPUARCH} == "i386" && empty(MACHINE_CPU:Msse2)
127SRCS+=		floatdidf.c
128SRCS+=		floatdisf.c
129SRCS+=		floatdixf.c
130SRCS+=		floatundidf.c
131SRCS+=		floatundisf.c
132SRCS+=		floatundixf.c
133.else
134SRCF+=		floatdidf
135SRCF+=		floatdisf
136SRCF+=		floatdixf
137SRCF+=		floatundidf
138SRCF+=		floatundisf
139SRCF+=		floatundixf
140.endif
141
142# __cpu_model support, only used on x86
143.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386"
144SRCF+=		cpu_model
145.endif
146
147#
148# 128-bit quad precision long double support,
149# only used on some architectures.
150#
151.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "riscv"
152SRCF+=		addtf3
153SRCF+=		comparetf2
154SRCF+=		divtf3
155SRCF+=		extenddftf2
156SRCF+=		extendsftf2
157SRCF+=		fixtfdi
158SRCF+=		fixtfsi
159SRCF+=		fixtfti
160SRCF+=		fixunstfdi
161SRCF+=		fixunstfsi
162SRCF+=		fixunstfti
163SRCF+=		floatunsitf
164SRCF+=		multf3
165SRCF+=		subtf3
166SRCF+=		trunctfdf2
167SRCF+=		trunctfsf2
168.endif
169
170# These are already shipped by libc.a on some architectures.
171.if ${MACHINE_CPUARCH} != "arm" && ${MACHINE_CPUARCH} != "mips" && \
172    ${MACHINE_CPUARCH} != "riscv"
173SRCF+=		adddf3
174SRCF+=		addsf3
175SRCF+=		divdf3
176SRCF+=		divsf3
177SRCF+=		extendsfdf2
178SRCF+=		fixdfsi
179SRCF+=		fixsfsi
180SRCF+=		floatsidf
181SRCF+=		floatsisf
182SRCF+=		muldf3
183SRCF+=		mulsf3
184SRCF+=		subdf3
185SRCF+=		subsf3
186SRCF+=		truncdfsf2
187.endif
188
189.if ${MACHINE_CPUARCH} != "arm" && ${MACHINE_CPUARCH} != "mips"
190SRCF+=		comparedf2
191SRCF+=		comparesf2
192.endif
193
194# FreeBSD-specific atomic intrinsics.
195.if ${MACHINE_CPUARCH} == "arm"
196.PATH:		${SRCTOP}/sys/arm/arm
197
198SRCF+=		stdatomic
199CFLAGS+=	-DEMIT_SYNC_ATOMICS
200.elif ${MACHINE_CPUARCH} == "mips"
201.PATH:		${SRCTOP}/sys/mips/mips
202
203SRCF+=		stdatomic
204.endif
205
206.for file in ${SRCF}
207.if ${MACHINE_ARCH:Marmv[67]*} && (!defined(CPUTYPE) || ${CPUTYPE:M*soft*} == "") \
208    && exists(${CRTSRC}/${CRTARCH}/${file}vfp.S)
209SRCS+=		${file}vfp.S
210. elif exists(${CRTSRC}/${CRTARCH}/${file}.S)
211SRCS+=		${file}.S
212. else
213SRCS+=		${file}.c
214. endif
215.endfor
216
217.if ${MACHINE_CPUARCH} == "arm"
218SRCS+=		aeabi_div0.c
219SRCS+=		aeabi_idivmod.S
220SRCS+=		aeabi_ldivmod.S
221SRCS+=		aeabi_memcmp.S
222SRCS+=		aeabi_memcpy.S
223SRCS+=		aeabi_memmove.S
224SRCS+=		aeabi_memset.S
225SRCS+=		aeabi_uidivmod.S
226SRCS+=		aeabi_uldivmod.S
227SRCS+=		bswapdi2.S
228SRCS+=		bswapsi2.S
229SRCS+=		switch16.S
230SRCS+=		switch32.S
231SRCS+=		switch8.S
232SRCS+=		switchu8.S
233SRCS+=		sync_synchronize.S
234.endif
235
236# On some archs GCC-6.3 requires bswap32 built-in.
237.if ${MACHINE_CPUARCH} == "mips" || ${MACHINE_CPUARCH} == "sparc64"
238SRCS+=		bswapdi2.c
239SRCS+=		bswapsi2.c
240.endif
241