Makefile revision 245651
1215125Sed# $FreeBSD: head/lib/libcompiler_rt/Makefile 245651 2013-01-19 04:11:45Z andrew $
2215125Sed
3215125Sed.include <bsd.own.mk>
4215125Sed
5215125SedLIB=	compiler_rt
6215125SedNO_PIC=
7215125SedWARNS?=	2
8215125Sed
9215129SedCFLAGS+=${PICFLAG} -fvisibility=hidden -DVISIBILITY_HIDDEN
10215125Sed
11215125Sed.if ${MACHINE_CPUARCH} == "amd64"
12215125SedCRTARCH=x86_64
13215125Sed.else
14215125SedCRTARCH=${MACHINE_CPUARCH}
15215125Sed.endif
16215125Sed
17215125SedCRTSRC=${.CURDIR}/../../contrib/compiler-rt/lib
18215125Sed
19215125Sed.PATH: ${CRTSRC}/${CRTARCH} ${CRTSRC}
20215125Sed
21215125SedSRCF=	absvdi2 \
22215125Sed	absvsi2 \
23215125Sed	absvti2 \
24215125Sed	addvdi3 \
25215125Sed	addvsi3 \
26215125Sed	addvti3 \
27215125Sed	ashldi3 \
28215125Sed	ashlti3 \
29215125Sed	ashrdi3 \
30215125Sed	ashrti3 \
31215125Sed	clzdi2 \
32215125Sed	clzsi2 \
33215125Sed	clzti2 \
34215125Sed	cmpdi2 \
35215125Sed	cmpti2 \
36215125Sed	comparedf2 \
37215125Sed	comparesf2 \
38215125Sed	ctzdi2 \
39215125Sed	ctzsi2 \
40215125Sed	ctzti2 \
41215125Sed	divdc3 \
42215125Sed	divdi3 \
43222656Sed	divmoddi4 \
44222656Sed	divmodsi4 \
45215125Sed	divsc3 \
46215125Sed	divti3 \
47215125Sed	divxc3 \
48215125Sed	enable_execute_stack \
49215125Sed	eprintf \
50215125Sed	ffsdi2 \
51215125Sed	ffsti2 \
52215125Sed	fixdfdi \
53215125Sed	fixdfti \
54215125Sed	fixsfdi \
55215125Sed	fixsfti \
56215125Sed	fixunsdfdi \
57215125Sed	fixunsdfsi \
58215125Sed	fixunsdfti \
59215125Sed	fixunssfdi \
60215125Sed	fixunssfsi \
61215125Sed	fixunssfti \
62215125Sed	fixunsxfdi \
63215125Sed	fixunsxfsi \
64215125Sed	fixunsxfti \
65215125Sed	fixxfdi \
66215125Sed	fixxfti \
67215125Sed	floatdidf \
68215125Sed	floatdisf \
69215125Sed	floatdixf \
70215125Sed	floattidf \
71215125Sed	floattisf \
72215125Sed	floattixf \
73215125Sed	floatundidf \
74215125Sed	floatundisf \
75215125Sed	floatundixf \
76215125Sed	floatunsidf \
77215125Sed	floatunsisf \
78215125Sed	floatuntidf \
79215125Sed	floatuntisf \
80215125Sed	floatuntixf \
81229135Sed	int_util \
82215125Sed	lshrdi3 \
83215125Sed	lshrti3 \
84215125Sed	moddi3 \
85215125Sed	modti3 \
86215125Sed	muldc3 \
87215125Sed	muldi3 \
88229135Sed	mulodi4 \
89229135Sed	mulosi4 \
90229135Sed	muloti4 \
91215125Sed	mulsc3 \
92215125Sed	multi3 \
93215125Sed	mulvdi3 \
94215125Sed	mulvsi3 \
95215125Sed	mulvti3 \
96215125Sed	mulxc3 \
97215125Sed	negdf2 \
98215125Sed	negdi2 \
99215125Sed	negsf2 \
100215125Sed	negti2 \
101215125Sed	negvdi2 \
102215125Sed	negvsi2 \
103215125Sed	negvti2 \
104215125Sed	paritydi2 \
105215125Sed	paritysi2 \
106215125Sed	parityti2 \
107215125Sed	popcountdi2 \
108215125Sed	popcountsi2 \
109215125Sed	popcountti2 \
110215125Sed	powidf2 \
111215125Sed	powisf2 \
112215125Sed	powitf2 \
113215125Sed	powixf2 \
114215125Sed	subvdi3 \
115215125Sed	subvsi3 \
116215125Sed	subvti3 \
117215125Sed	trampoline_setup \
118215125Sed	ucmpdi2 \
119215125Sed	ucmpti2 \
120215125Sed	udivdi3 \
121215125Sed	udivmoddi4 \
122222656Sed	udivmodsi4 \
123215125Sed	udivmodti4 \
124215125Sed	udivti3 \
125215125Sed	umoddi3 \
126215125Sed	umodti3
127215125Sed
128244382Sandrew# Don't build clear_cache on ARM with clang as it is a builtin there.
129244382Sandrew.if ${MACHINE_CPUARCH} != "arm" || ${COMPILER_TYPE} != "clang"
130244382SandrewSRCF+=	clear_cache
131244382Sandrew.endif
132244382Sandrew
133215125Sed# These are already shipped by libc.a on arm and mips
134215125Sed.if ${MACHINE_CPUARCH} != "arm" && ${MACHINE_CPUARCH} != "mips"
135215125SedSRCF+=	adddf3 \
136215125Sed	addsf3 \
137215125Sed	divdf3 \
138215125Sed	divsf3 \
139215125Sed	extendsfdf2 \
140215125Sed	fixdfsi \
141215125Sed	fixsfsi \
142215125Sed	floatsidf \
143215125Sed	floatsisf \
144215125Sed	muldf3 \
145215125Sed	mulsf3 \
146222656Sed	subdf3 \
147222656Sed	subsf3 \
148245651Sandrew	truncdfsf2
149245651Sandrew.endif
150245651Sandrew
151245651Sandrew.if ${MACHINE_CPUARCH} != "mips" && \
152245651Sandrew    (${MACHINE_CPUARCH} != "arm" || ${MK_ARM_EABI} != "no")
153245651SandrewSRCF+=	divsi3 \
154245651Sandrew	modsi3 \
155215125Sed	udivsi3 \
156215125Sed	umodsi3
157215125Sed.endif
158215125Sed
159244382Sandrew# FreeBSD-specific atomic intrinsics. Clang provides them as a builtin.
160244382Sandrew.if (${MACHINE_CPUARCH} == "arm" && ${COMPILER_TYPE} != "clang") || \
161244382Sandrew    ${MACHINE_CPUARCH} == "mips"
162228919SedSRCF+=	__sync_fetch_and_add_4 \
163228919Sed	__sync_fetch_and_and_4 \
164228919Sed	__sync_fetch_and_or_4 \
165228919Sed	__sync_fetch_and_sub_4 \
166228919Sed	__sync_fetch_and_xor_4 \
167228919Sed	__sync_lock_test_and_set_4 \
168228919Sed	__sync_val_compare_and_swap_4
169228919Sed.endif
170228919Sed.if ${MACHINE_ARCH:Mmips64*} != ""
171228919SedSRCF+=	__sync_fetch_and_add_8 \
172228919Sed	__sync_fetch_and_and_8 \
173228919Sed	__sync_fetch_and_or_8 \
174228919Sed	__sync_fetch_and_sub_8 \
175228919Sed	__sync_fetch_and_xor_8 \
176228919Sed	__sync_lock_test_and_set_8 \
177228919Sed	__sync_val_compare_and_swap_8
178228919Sed.endif
179228919Sed
180215125Sed.for file in ${SRCF}
181215125Sed. if ${MACHINE_CPUARCH} != "arm" && exists(${CRTSRC}/${CRTARCH}/${file}.S)
182215125SedSRCS+=	${file}.S
183215125Sed. else
184215125SedSRCS+=	${file}.c
185215125Sed. endif
186215125Sed.endfor
187215125Sed
188245643Sandrew.if ${MACHINE_CPUARCH} == "arm" && ${MK_ARM_EABI} != "no"
189245649SandrewSRCS+=	aeabi_idivmod.S \
190245643Sandrew	aeabi_ldivmod.S \
191245643Sandrew	aeabi_uidivmod.S \
192245643Sandrew	aeabi_uldivmod.S
193245643Sandrew.endif
194245643Sandrew
195235487Smarius.if ${MACHINE_CPUARCH} != "mips"
196215185Sed. if ${MK_INSTALLLIB} != "no"
197215125SedSYMLINKS+=libcompiler_rt.a ${LIBDIR}/libgcc.a
198215185Sed. endif
199215185Sed. if ${MK_PROFILE} != "no"
200215125SedSYMLINKS+=libcompiler_rt_p.a ${LIBDIR}/libgcc_p.a
201215185Sed. endif
202215125Sed.endif
203215125Sed
204217393Skib.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" || \
205217393Skib    ${MACHINE_CPUARCH} == "powerpc"
206217101SkibAFLAGS+=--noexecstack
207217102SkibACFLAGS+=-Wa,--noexecstack
208217101Skib.endif
209217101Skib
210217101Skib
211215125Sed.include <bsd.lib.mk>
212