xref: /freebsd/lib/libcompiler_rt/Makefile.inc (revision 63d1fd5970ec814904aa0f4580b10a0d302d08b2)
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# __cpu_model support, only used on x86
127.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386"
128SRCF+=		cpu_model
129.endif
130
131#
132# 128-bit quad precision long double support,
133# only used on some architectures.
134#
135.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "riscv"
136SRCF+=		addtf3
137SRCF+=		comparetf2
138SRCF+=		divtf3
139SRCF+=		extenddftf2
140SRCF+=		extendsftf2
141SRCF+=		fixtfdi
142SRCF+=		fixtfsi
143SRCF+=		fixtfti
144SRCF+=		fixunstfdi
145SRCF+=		fixunstfsi
146SRCF+=		fixunstfti
147SRCF+=		floatunsitf
148SRCF+=		multf3
149SRCF+=		subtf3
150SRCF+=		trunctfdf2
151SRCF+=		trunctfsf2
152.endif
153
154# These are already shipped by libc.a on some architectures.
155.if ${MACHINE_CPUARCH} != "arm" && ${MACHINE_CPUARCH} != "mips" && \
156    ${MACHINE_CPUARCH} != "riscv"
157SRCF+=		adddf3
158SRCF+=		addsf3
159SRCF+=		divdf3
160SRCF+=		divsf3
161SRCF+=		extendsfdf2
162SRCF+=		fixdfsi
163SRCF+=		fixsfsi
164SRCF+=		floatsidf
165SRCF+=		floatsisf
166SRCF+=		muldf3
167SRCF+=		mulsf3
168SRCF+=		subdf3
169SRCF+=		subsf3
170SRCF+=		truncdfsf2
171.endif
172
173.if ${MACHINE_CPUARCH} != "arm"
174SRCF+=		comparedf2
175SRCF+=		comparesf2
176.endif
177
178.if ${MACHINE_CPUARCH} != "mips"
179SRCF+=		divsi3
180SRCF+=		modsi3
181SRCF+=		udivsi3
182SRCF+=		umodsi3
183.endif
184
185# FreeBSD-specific atomic intrinsics.
186.if ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "armv6"
187.PATH:		${SRCTOP}/sys/arm/arm
188
189SRCF+=		stdatomic
190CFLAGS+=	-DEMIT_SYNC_ATOMICS
191.elif ${MACHINE_CPUARCH} == "mips"
192.PATH:		${SRCTOP}/sys/mips/mips
193
194SRCF+=		stdatomic
195.endif
196
197.for file in ${SRCF}
198.if ${MACHINE_ARCH:Marmv6*} && (!defined(CPUTYPE) || ${CPUTYPE:M*soft*} == "") \
199    && exists(${CRTSRC}/${CRTARCH}/${file}vfp.S)
200SRCS+=		${file}vfp.S
201. elif exists(${CRTSRC}/${CRTARCH}/${file}.S)
202SRCS+=		${file}.S
203. else
204SRCS+=		${file}.c
205. endif
206.endfor
207
208.if ${MACHINE_CPUARCH} == "arm"
209SRCS+=		aeabi_div0.c
210SRCS+=		aeabi_idivmod.S
211SRCS+=		aeabi_ldivmod.S
212SRCS+=		aeabi_memcmp.S
213SRCS+=		aeabi_memcpy.S
214SRCS+=		aeabi_memmove.S
215SRCS+=		aeabi_memset.S
216SRCS+=		aeabi_uidivmod.S
217SRCS+=		aeabi_uldivmod.S
218SRCS+=		bswapdi2.S
219SRCS+=		bswapsi2.S
220SRCS+=		switch16.S
221SRCS+=		switch32.S
222SRCS+=		switch8.S
223SRCS+=		switchu8.S
224SRCS+=		sync_synchronize.S
225.endif
226