xref: /freebsd/lib/libcompiler_rt/Makefile.inc (revision feabce61dcd6e6b2be679e6919a0bda5ab27b19a)
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+=		divtc3
36SRCF+=		divti3
37SRCF+=		divxc3
38SRCF+=		enable_execute_stack
39SRCF+=		eprintf
40SRCF+=		extendhfsf2
41SRCF+=		ffsdi2
42SRCF+=		ffsti2
43SRCF+=		fixdfdi
44SRCF+=		fixdfti
45SRCF+=		fixsfdi
46SRCF+=		fixsfti
47SRCF+=		fixunsdfdi
48SRCF+=		fixunsdfsi
49SRCF+=		fixunsdfti
50SRCF+=		fixunssfdi
51SRCF+=		fixunssfsi
52SRCF+=		fixunssfti
53SRCF+=		fixunsxfdi
54SRCF+=		fixunsxfsi
55SRCF+=		fixunsxfti
56SRCF+=		fixxfdi
57SRCF+=		fixxfti
58SRCF+=		floatdidf
59SRCF+=		floatdisf
60SRCF+=		floatditf
61SRCF+=		floatdixf
62SRCF+=		floatsitf
63SRCF+=		floattidf
64SRCF+=		floattisf
65SRCF+=		floattixf
66SRCF+=		floatundidf
67SRCF+=		floatundisf
68SRCF+=		floatunditf
69SRCF+=		floatundixf
70SRCF+=		floatunsidf
71SRCF+=		floatunsisf
72SRCF+=		floatuntidf
73SRCF+=		floatuntisf
74SRCF+=		floatuntixf
75SRCF+=		gcc_personality_v0
76SRCF+=		int_util
77SRCF+=		lshrdi3
78SRCF+=		lshrti3
79SRCF+=		moddi3
80SRCF+=		modti3
81SRCF+=		muldc3
82SRCF+=		muldi3
83SRCF+=		mulodi4
84SRCF+=		mulosi4
85SRCF+=		muloti4
86SRCF+=		mulsc3
87SRCF+=		multi3
88SRCF+=		mulvdi3
89SRCF+=		mulvsi3
90SRCF+=		mulvti3
91SRCF+=		multc3
92SRCF+=		mulxc3
93SRCF+=		negdf2
94SRCF+=		negdi2
95SRCF+=		negsf2
96SRCF+=		negti2
97SRCF+=		negvdi2
98SRCF+=		negvsi2
99SRCF+=		negvti2
100SRCF+=		paritydi2
101SRCF+=		paritysi2
102SRCF+=		parityti2
103SRCF+=		popcountdi2
104SRCF+=		popcountsi2
105SRCF+=		popcountti2
106SRCF+=		powidf2
107SRCF+=		powisf2
108SRCF+=		powitf2
109SRCF+=		powixf2
110SRCF+=		subvdi3
111SRCF+=		subvsi3
112SRCF+=		subvti3
113SRCF+=		trampoline_setup
114SRCF+=		truncdfhf2
115SRCF+=		truncsfhf2
116SRCF+=		ucmpdi2
117SRCF+=		ucmpti2
118SRCF+=		udivdi3
119SRCF+=		udivmoddi4
120SRCF+=		udivmodsi4
121SRCF+=		udivmodti4
122SRCF+=		udivti3
123SRCF+=		umoddi3
124SRCF+=		umodti3
125
126#
127# 128-bit quad precision long double support,
128# only used on arm64 and riscv.
129#
130.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "riscv"
131SRCF+=		addtf3
132SRCF+=		comparetf2
133SRCF+=		divtf3
134SRCF+=		extenddftf2
135SRCF+=		extendsftf2
136SRCF+=		fixtfdi
137SRCF+=		fixtfsi
138SRCF+=		fixtfti
139SRCF+=		fixunstfdi
140SRCF+=		fixunstfsi
141SRCF+=		fixunstfti
142SRCF+=		floatunsitf
143SRCF+=		multf3
144SRCF+=		subtf3
145SRCF+=		trunctfdf2
146SRCF+=		trunctfsf2
147.endif
148
149# These are already shipped by libc.a on arm and mips
150.if ${MACHINE_CPUARCH} != "arm" && ${MACHINE_CPUARCH} != "mips"
151SRCF+=		adddf3
152SRCF+=		addsf3
153SRCF+=		divdf3
154SRCF+=		divsf3
155SRCF+=		extendsfdf2
156SRCF+=		fixdfsi
157SRCF+=		fixsfsi
158SRCF+=		floatsidf
159SRCF+=		floatsisf
160SRCF+=		muldf3
161SRCF+=		mulsf3
162SRCF+=		subdf3
163SRCF+=		subsf3
164SRCF+=		truncdfsf2
165.endif
166
167.if ${MACHINE_CPUARCH} != "arm"
168SRCF+=		comparedf2
169SRCF+=		comparesf2
170.endif
171
172.if ${MACHINE_CPUARCH} != "mips"
173SRCF+=		divsi3
174SRCF+=		modsi3
175SRCF+=		udivsi3
176SRCF+=		umodsi3
177.endif
178
179# FreeBSD-specific atomic intrinsics.
180.if ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "armv6"
181.PATH:		${SRCTOP}/sys/arm/arm
182
183SRCF+=		stdatomic
184CFLAGS+=	-DEMIT_SYNC_ATOMICS
185.elif ${MACHINE_CPUARCH} == "mips"
186.PATH:		${SRCTOP}/sys/mips/mips
187
188SRCF+=		stdatomic
189.endif
190
191.for file in ${SRCF}
192.if ${MACHINE_ARCH:Marmv6*} && (!defined(CPUTYPE) || ${CPUTYPE:M*soft*} == "") \
193    && exists(${CRTSRC}/${CRTARCH}/${file}vfp.S)
194SRCS+=		${file}vfp.S
195. elif exists(${CRTSRC}/${CRTARCH}/${file}.S)
196SRCS+=		${file}.S
197. else
198SRCS+=		${file}.c
199. endif
200.endfor
201
202.if ${MACHINE_CPUARCH} == "arm"
203SRCS+=		aeabi_div0.c
204SRCS+=		aeabi_idivmod.S
205SRCS+=		aeabi_ldivmod.S
206SRCS+=		aeabi_memcmp.S
207SRCS+=		aeabi_memcpy.S
208SRCS+=		aeabi_memmove.S
209SRCS+=		aeabi_memset.S
210SRCS+=		aeabi_uidivmod.S
211SRCS+=		aeabi_uldivmod.S
212SRCS+=		bswapdi2.S
213SRCS+=		bswapsi2.S
214SRCS+=		switch16.S
215SRCS+=		switch32.S
216SRCS+=		switch8.S
217SRCS+=		switchu8.S
218SRCS+=		sync_synchronize.S
219.endif
220