2010-11-11 15:13:11 +00:00
|
|
|
# $FreeBSD$
|
|
|
|
|
2014-05-06 04:22:01 +00:00
|
|
|
.include <src.opts.mk>
|
2010-11-11 15:13:11 +00:00
|
|
|
|
2016-02-04 21:16:35 +00:00
|
|
|
PACKAGE=lib${LIB}
|
2010-11-11 15:13:11 +00:00
|
|
|
LIB= compiler_rt
|
|
|
|
NO_PIC=
|
|
|
|
WARNS?= 2
|
|
|
|
|
2010-11-11 16:53:25 +00:00
|
|
|
CFLAGS+=${PICFLAG} -fvisibility=hidden -DVISIBILITY_HIDDEN
|
2015-02-22 22:31:36 +00:00
|
|
|
CFLAGS+=-I${.CURDIR}/../../contrib/libcxxrt
|
2010-11-11 15:13:11 +00:00
|
|
|
|
|
|
|
.if ${MACHINE_CPUARCH} == "amd64"
|
|
|
|
CRTARCH=x86_64
|
|
|
|
.else
|
|
|
|
CRTARCH=${MACHINE_CPUARCH}
|
|
|
|
.endif
|
|
|
|
|
2015-01-08 19:47:10 +00:00
|
|
|
CRTSRC=${.CURDIR}/../../contrib/compiler-rt/lib/builtins
|
2010-11-11 15:13:11 +00:00
|
|
|
|
|
|
|
.PATH: ${CRTSRC}/${CRTARCH} ${CRTSRC}
|
|
|
|
|
|
|
|
SRCF= absvdi2 \
|
|
|
|
absvsi2 \
|
|
|
|
absvti2 \
|
|
|
|
addvdi3 \
|
|
|
|
addvsi3 \
|
|
|
|
addvti3 \
|
2015-01-08 19:47:10 +00:00
|
|
|
apple_versioning \
|
2010-11-11 15:13:11 +00:00
|
|
|
ashldi3 \
|
|
|
|
ashlti3 \
|
|
|
|
ashrdi3 \
|
|
|
|
ashrti3 \
|
2013-06-15 12:16:27 +00:00
|
|
|
clear_cache \
|
2010-11-11 15:13:11 +00:00
|
|
|
clzdi2 \
|
|
|
|
clzsi2 \
|
|
|
|
clzti2 \
|
|
|
|
cmpdi2 \
|
|
|
|
cmpti2 \
|
|
|
|
ctzdi2 \
|
|
|
|
ctzsi2 \
|
|
|
|
ctzti2 \
|
|
|
|
divdc3 \
|
|
|
|
divdi3 \
|
2011-06-03 17:49:16 +00:00
|
|
|
divmoddi4 \
|
|
|
|
divmodsi4 \
|
2010-11-11 15:13:11 +00:00
|
|
|
divsc3 \
|
2016-02-06 13:39:20 +00:00
|
|
|
divtc3 \
|
2010-11-11 15:13:11 +00:00
|
|
|
divti3 \
|
|
|
|
divxc3 \
|
|
|
|
enable_execute_stack \
|
|
|
|
eprintf \
|
2015-09-10 20:35:47 +00:00
|
|
|
extendhfsf2 \
|
2010-11-11 15:13:11 +00:00
|
|
|
ffsdi2 \
|
|
|
|
ffsti2 \
|
|
|
|
fixdfdi \
|
|
|
|
fixdfti \
|
|
|
|
fixsfdi \
|
|
|
|
fixsfti \
|
|
|
|
fixunsdfdi \
|
|
|
|
fixunsdfsi \
|
|
|
|
fixunsdfti \
|
|
|
|
fixunssfdi \
|
|
|
|
fixunssfsi \
|
|
|
|
fixunssfti \
|
|
|
|
fixunsxfdi \
|
|
|
|
fixunsxfsi \
|
|
|
|
fixunsxfti \
|
|
|
|
fixxfdi \
|
|
|
|
fixxfti \
|
|
|
|
floatdidf \
|
|
|
|
floatdisf \
|
2015-04-07 19:31:29 +00:00
|
|
|
floatditf \
|
2010-11-11 15:13:11 +00:00
|
|
|
floatdixf \
|
2015-03-30 14:28:31 +00:00
|
|
|
floatsitf \
|
2010-11-11 15:13:11 +00:00
|
|
|
floattidf \
|
|
|
|
floattisf \
|
|
|
|
floattixf \
|
|
|
|
floatundidf \
|
|
|
|
floatundisf \
|
2015-04-07 19:31:29 +00:00
|
|
|
floatunditf \
|
2010-11-11 15:13:11 +00:00
|
|
|
floatundixf \
|
|
|
|
floatunsidf \
|
|
|
|
floatunsisf \
|
|
|
|
floatuntidf \
|
|
|
|
floatuntisf \
|
|
|
|
floatuntixf \
|
2015-01-08 19:47:10 +00:00
|
|
|
gcc_personality_v0 \
|
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 \
|
2015-04-07 19:28:53 +00:00
|
|
|
multc3 \
|
2010-11-11 15:13:11 +00:00
|
|
|
mulxc3 \
|
|
|
|
negdf2 \
|
|
|
|
negdi2 \
|
|
|
|
negsf2 \
|
|
|
|
negti2 \
|
|
|
|
negvdi2 \
|
|
|
|
negvsi2 \
|
|
|
|
negvti2 \
|
|
|
|
paritydi2 \
|
|
|
|
paritysi2 \
|
|
|
|
parityti2 \
|
|
|
|
popcountdi2 \
|
|
|
|
popcountsi2 \
|
|
|
|
popcountti2 \
|
|
|
|
powidf2 \
|
|
|
|
powisf2 \
|
|
|
|
powitf2 \
|
|
|
|
powixf2 \
|
|
|
|
subvdi3 \
|
|
|
|
subvsi3 \
|
|
|
|
subvti3 \
|
|
|
|
trampoline_setup \
|
2015-09-10 20:35:47 +00:00
|
|
|
truncdfhf2 \
|
|
|
|
truncsfhf2 \
|
2010-11-11 15:13:11 +00:00
|
|
|
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
|
|
|
|
|
2015-04-08 19:07:06 +00:00
|
|
|
# 128-bit quad precision long double support, only used on arm64
|
|
|
|
.if ${MACHINE_CPUARCH} == "aarch64"
|
|
|
|
SRCF+= addtf3 \
|
|
|
|
comparetf2 \
|
|
|
|
divtf3 \
|
|
|
|
extenddftf2 \
|
|
|
|
extendsftf2 \
|
|
|
|
fixtfdi \
|
|
|
|
fixtfsi \
|
|
|
|
fixtfti \
|
|
|
|
fixunstfdi \
|
|
|
|
fixunstfsi \
|
|
|
|
fixunstfti \
|
2015-04-16 12:54:28 +00:00
|
|
|
floatunsitf \
|
2015-04-08 19:07:06 +00:00
|
|
|
multf3 \
|
|
|
|
subtf3 \
|
|
|
|
trunctfdf2 \
|
|
|
|
trunctfsf2
|
|
|
|
.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 \
|
|
|
|
extendsfdf2 \
|
|
|
|
fixdfsi \
|
|
|
|
fixsfsi \
|
|
|
|
floatsidf \
|
|
|
|
floatsisf \
|
|
|
|
muldf3 \
|
|
|
|
mulsf3 \
|
2011-06-03 17:49:16 +00:00
|
|
|
subdf3 \
|
|
|
|
subsf3 \
|
2013-01-19 04:11:45 +00:00
|
|
|
truncdfsf2
|
|
|
|
.endif
|
|
|
|
|
2015-01-09 20:00:37 +00:00
|
|
|
.if ${MACHINE_CPUARCH} != "arm"
|
|
|
|
SRCF+= comparedf2 \
|
|
|
|
comparesf2
|
|
|
|
.endif
|
|
|
|
|
2014-10-01 08:26:51 +00:00
|
|
|
.if ${MACHINE_CPUARCH} != "mips"
|
2013-01-19 04:11:45 +00:00
|
|
|
SRCF+= divsi3 \
|
|
|
|
modsi3 \
|
2010-11-11 15:13:11 +00:00
|
|
|
udivsi3 \
|
|
|
|
umodsi3
|
|
|
|
.endif
|
|
|
|
|
2013-04-27 04:56:02 +00:00
|
|
|
# FreeBSD-specific atomic intrinsics.
|
2013-08-31 08:50:45 +00:00
|
|
|
.if ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "armv6"
|
2013-06-15 09:04:10 +00:00
|
|
|
.PATH: ${.CURDIR}/../../sys/arm/arm
|
|
|
|
|
|
|
|
SRCF+= stdatomic
|
2013-08-31 08:50:45 +00:00
|
|
|
CFLAGS+= -DEMIT_SYNC_ATOMICS
|
2013-06-08 13:22:53 +00:00
|
|
|
.elif ${MACHINE_CPUARCH} == "mips"
|
|
|
|
.PATH: ${.CURDIR}/../../sys/mips/mips
|
|
|
|
|
|
|
|
SRCF+= stdatomic
|
2011-12-27 22:13:51 +00:00
|
|
|
.endif
|
|
|
|
|
2010-11-11 15:13:11 +00:00
|
|
|
.for file in ${SRCF}
|
2016-05-18 06:01:18 +00:00
|
|
|
.if ${MACHINE_ARCH:Marmv6*} && (!defined(CPUTYPE) || ${CPUTYPE:M*soft*} == "") && \
|
|
|
|
exists(${CRTSRC}/${CRTARCH}/${file}vfp.S)
|
2014-03-23 12:49:25 +00:00
|
|
|
SRCS+= ${file}vfp.S
|
2016-05-18 06:01:18 +00:00
|
|
|
. elif exists(${CRTSRC}/${CRTARCH}/${file}.S)
|
2010-11-11 15:13:11 +00:00
|
|
|
SRCS+= ${file}.S
|
|
|
|
. else
|
|
|
|
SRCS+= ${file}.c
|
|
|
|
. endif
|
|
|
|
.endfor
|
|
|
|
|
2014-10-01 08:26:51 +00:00
|
|
|
.if ${MACHINE_CPUARCH} == "arm"
|
2015-01-09 20:00:37 +00:00
|
|
|
SRCS+= aeabi_div0.c \
|
2015-01-08 19:47:10 +00:00
|
|
|
aeabi_idivmod.S \
|
2013-01-19 02:28:44 +00:00
|
|
|
aeabi_ldivmod.S \
|
2013-02-06 00:01:28 +00:00
|
|
|
aeabi_memcmp.S \
|
|
|
|
aeabi_memcpy.S \
|
|
|
|
aeabi_memmove.S \
|
|
|
|
aeabi_memset.S \
|
2013-01-19 02:28:44 +00:00
|
|
|
aeabi_uidivmod.S \
|
2015-01-08 19:47:10 +00:00
|
|
|
aeabi_uldivmod.S \
|
|
|
|
bswapdi2.S \
|
|
|
|
bswapsi2.S \
|
|
|
|
switch16.S \
|
|
|
|
switch32.S \
|
|
|
|
switch8.S \
|
|
|
|
switchu8.S \
|
2015-01-09 20:00:37 +00:00
|
|
|
sync_synchronize.S
|
2013-01-19 02:28:44 +00:00
|
|
|
.endif
|
|
|
|
|
2013-04-20 14:44:28 +00:00
|
|
|
.if ${MK_INSTALLLIB} != "no"
|
2010-11-11 15:13:11 +00:00
|
|
|
SYMLINKS+=libcompiler_rt.a ${LIBDIR}/libgcc.a
|
2013-04-20 14:44:28 +00:00
|
|
|
.endif
|
|
|
|
.if ${MK_PROFILE} != "no"
|
2010-11-11 15:13:11 +00:00
|
|
|
SYMLINKS+=libcompiler_rt_p.a ${LIBDIR}/libgcc_p.a
|
|
|
|
.endif
|
|
|
|
|
2011-01-14 11:23:39 +00:00
|
|
|
.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" || \
|
2015-09-29 16:09:58 +00:00
|
|
|
${MACHINE_CPUARCH} == "powerpc" || ${MACHINE_ARCH:Marmv6*}
|
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>
|