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