2010-11-11 15:13:11 +00:00
|
|
|
# $FreeBSD$
|
|
|
|
|
|
|
|
.include <bsd.own.mk>
|
|
|
|
|
|
|
|
LIB= compiler_rt
|
|
|
|
NO_PIC=
|
|
|
|
WARNS?= 2
|
|
|
|
|
2010-11-11 16:53:25 +00:00
|
|
|
CFLAGS+=${PICFLAG} -fvisibility=hidden -DVISIBILITY_HIDDEN
|
2010-11-11 15:13:11 +00:00
|
|
|
|
|
|
|
.if ${MACHINE_CPUARCH} == "amd64"
|
|
|
|
CRTARCH=x86_64
|
|
|
|
.else
|
|
|
|
CRTARCH=${MACHINE_CPUARCH}
|
|
|
|
.endif
|
|
|
|
|
|
|
|
CRTSRC=${.CURDIR}/../../contrib/compiler-rt/lib
|
|
|
|
|
|
|
|
.PATH: ${CRTSRC}/${CRTARCH} ${CRTSRC}
|
|
|
|
|
|
|
|
SRCF= absvdi2 \
|
|
|
|
absvsi2 \
|
|
|
|
absvti2 \
|
|
|
|
addvdi3 \
|
|
|
|
addvsi3 \
|
|
|
|
addvti3 \
|
|
|
|
ashldi3 \
|
|
|
|
ashlti3 \
|
|
|
|
ashrdi3 \
|
|
|
|
ashrti3 \
|
|
|
|
clzdi2 \
|
|
|
|
clzsi2 \
|
|
|
|
clzti2 \
|
|
|
|
cmpdi2 \
|
|
|
|
cmpti2 \
|
|
|
|
comparedf2 \
|
|
|
|
comparesf2 \
|
|
|
|
ctzdi2 \
|
|
|
|
ctzsi2 \
|
|
|
|
ctzti2 \
|
|
|
|
divdc3 \
|
|
|
|
divdi3 \
|
2011-06-03 17:49:16 +00:00
|
|
|
divmoddi4 \
|
|
|
|
divmodsi4 \
|
2010-11-11 15:13:11 +00:00
|
|
|
divsc3 \
|
|
|
|
divti3 \
|
|
|
|
divxc3 \
|
|
|
|
enable_execute_stack \
|
|
|
|
eprintf \
|
|
|
|
ffsdi2 \
|
|
|
|
ffsti2 \
|
|
|
|
fixdfdi \
|
|
|
|
fixdfti \
|
|
|
|
fixsfdi \
|
|
|
|
fixsfti \
|
|
|
|
fixunsdfdi \
|
|
|
|
fixunsdfsi \
|
|
|
|
fixunsdfti \
|
|
|
|
fixunssfdi \
|
|
|
|
fixunssfsi \
|
|
|
|
fixunssfti \
|
|
|
|
fixunsxfdi \
|
|
|
|
fixunsxfsi \
|
|
|
|
fixunsxfti \
|
|
|
|
fixxfdi \
|
|
|
|
fixxfti \
|
|
|
|
floatdidf \
|
|
|
|
floatdisf \
|
|
|
|
floatdixf \
|
|
|
|
floattidf \
|
|
|
|
floattisf \
|
|
|
|
floattixf \
|
|
|
|
floatundidf \
|
|
|
|
floatundisf \
|
|
|
|
floatundixf \
|
|
|
|
floatunsidf \
|
|
|
|
floatunsisf \
|
|
|
|
floatuntidf \
|
|
|
|
floatuntisf \
|
|
|
|
floatuntixf \
|
2011-12-31 19:01:48 +00:00
|
|
|
int_util \
|
2010-11-11 15:13:11 +00:00
|
|
|
lshrdi3 \
|
|
|
|
lshrti3 \
|
|
|
|
moddi3 \
|
|
|
|
modti3 \
|
|
|
|
muldc3 \
|
|
|
|
muldi3 \
|
2011-12-31 19:01:48 +00:00
|
|
|
mulodi4 \
|
|
|
|
mulosi4 \
|
|
|
|
muloti4 \
|
2010-11-11 15:13:11 +00:00
|
|
|
mulsc3 \
|
|
|
|
multi3 \
|
|
|
|
mulvdi3 \
|
|
|
|
mulvsi3 \
|
|
|
|
mulvti3 \
|
|
|
|
mulxc3 \
|
|
|
|
negdf2 \
|
|
|
|
negdi2 \
|
|
|
|
negsf2 \
|
|
|
|
negti2 \
|
|
|
|
negvdi2 \
|
|
|
|
negvsi2 \
|
|
|
|
negvti2 \
|
|
|
|
paritydi2 \
|
|
|
|
paritysi2 \
|
|
|
|
parityti2 \
|
|
|
|
popcountdi2 \
|
|
|
|
popcountsi2 \
|
|
|
|
popcountti2 \
|
|
|
|
powidf2 \
|
|
|
|
powisf2 \
|
|
|
|
powitf2 \
|
|
|
|
powixf2 \
|
|
|
|
subvdi3 \
|
|
|
|
subvsi3 \
|
|
|
|
subvti3 \
|
|
|
|
trampoline_setup \
|
|
|
|
ucmpdi2 \
|
|
|
|
ucmpti2 \
|
|
|
|
udivdi3 \
|
|
|
|
udivmoddi4 \
|
2011-06-03 17:49:16 +00:00
|
|
|
udivmodsi4 \
|
2010-11-11 15:13:11 +00:00
|
|
|
udivmodti4 \
|
|
|
|
udivti3 \
|
|
|
|
umoddi3 \
|
|
|
|
umodti3
|
|
|
|
|
2012-12-18 07:26:55 +00:00
|
|
|
# Don't build clear_cache on ARM with clang as it is a builtin there.
|
|
|
|
.if ${MACHINE_CPUARCH} != "arm" || ${COMPILER_TYPE} != "clang"
|
|
|
|
SRCF+= clear_cache
|
|
|
|
.endif
|
|
|
|
|
2010-11-11 15:13:11 +00:00
|
|
|
# These are already shipped by libc.a on arm and mips
|
|
|
|
.if ${MACHINE_CPUARCH} != "arm" && ${MACHINE_CPUARCH} != "mips"
|
|
|
|
SRCF+= adddf3 \
|
|
|
|
addsf3 \
|
|
|
|
divdf3 \
|
|
|
|
divsf3 \
|
|
|
|
divsi3 \
|
|
|
|
extendsfdf2 \
|
|
|
|
fixdfsi \
|
|
|
|
fixsfsi \
|
|
|
|
floatsidf \
|
|
|
|
floatsisf \
|
|
|
|
modsi3 \
|
|
|
|
muldf3 \
|
|
|
|
mulsf3 \
|
2011-06-03 17:49:16 +00:00
|
|
|
subdf3 \
|
|
|
|
subsf3 \
|
2010-11-11 15:13:11 +00:00
|
|
|
truncdfsf2 \
|
|
|
|
udivsi3 \
|
|
|
|
umodsi3
|
|
|
|
.endif
|
|
|
|
|
2012-12-18 07:26:55 +00:00
|
|
|
# FreeBSD-specific atomic intrinsics. Clang provides them as a builtin.
|
|
|
|
.if (${MACHINE_CPUARCH} == "arm" && ${COMPILER_TYPE} != "clang") || \
|
|
|
|
${MACHINE_CPUARCH} == "mips"
|
2011-12-27 22:13:51 +00:00
|
|
|
SRCF+= __sync_fetch_and_add_4 \
|
|
|
|
__sync_fetch_and_and_4 \
|
|
|
|
__sync_fetch_and_or_4 \
|
|
|
|
__sync_fetch_and_sub_4 \
|
|
|
|
__sync_fetch_and_xor_4 \
|
|
|
|
__sync_lock_test_and_set_4 \
|
|
|
|
__sync_val_compare_and_swap_4
|
|
|
|
.endif
|
|
|
|
.if ${MACHINE_ARCH:Mmips64*} != ""
|
|
|
|
SRCF+= __sync_fetch_and_add_8 \
|
|
|
|
__sync_fetch_and_and_8 \
|
|
|
|
__sync_fetch_and_or_8 \
|
|
|
|
__sync_fetch_and_sub_8 \
|
|
|
|
__sync_fetch_and_xor_8 \
|
|
|
|
__sync_lock_test_and_set_8 \
|
|
|
|
__sync_val_compare_and_swap_8
|
|
|
|
.endif
|
|
|
|
|
2010-11-11 15:13:11 +00:00
|
|
|
.for file in ${SRCF}
|
|
|
|
. if ${MACHINE_CPUARCH} != "arm" && exists(${CRTSRC}/${CRTARCH}/${file}.S)
|
|
|
|
SRCS+= ${file}.S
|
|
|
|
. else
|
|
|
|
SRCS+= ${file}.c
|
|
|
|
. endif
|
|
|
|
.endfor
|
|
|
|
|
2012-05-15 22:47:34 +00:00
|
|
|
.if ${MACHINE_CPUARCH} != "mips"
|
2010-11-12 15:52:27 +00:00
|
|
|
. if ${MK_INSTALLLIB} != "no"
|
2010-11-11 15:13:11 +00:00
|
|
|
SYMLINKS+=libcompiler_rt.a ${LIBDIR}/libgcc.a
|
2010-11-12 15:52:27 +00:00
|
|
|
. endif
|
|
|
|
. if ${MK_PROFILE} != "no"
|
2010-11-11 15:13:11 +00:00
|
|
|
SYMLINKS+=libcompiler_rt_p.a ${LIBDIR}/libgcc_p.a
|
2010-11-12 15:52:27 +00:00
|
|
|
. endif
|
2010-11-11 15:13:11 +00:00
|
|
|
.endif
|
|
|
|
|
2011-01-14 11:23:39 +00:00
|
|
|
.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" || \
|
|
|
|
${MACHINE_CPUARCH} == "powerpc"
|
2011-01-07 14:35:45 +00:00
|
|
|
AFLAGS+=--noexecstack
|
2011-01-07 15:59:23 +00:00
|
|
|
ACFLAGS+=-Wa,--noexecstack
|
2011-01-07 14:35:45 +00:00
|
|
|
.endif
|
|
|
|
|
|
|
|
|
2010-11-11 15:13:11 +00:00
|
|
|
.include <bsd.lib.mk>
|