1# $FreeBSD$ 2 3CRTARCH= ${MACHINE_CPUARCH:C/amd64/x86_64/} 4 5CRTSRC= ${SRCTOP}/contrib/llvm-project/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+= bswapdi2 22SRCF+= bswapsi2 23SRCF+= clear_cache 24SRCF+= clzdi2 25SRCF+= clzsi2 26SRCF+= clzti2 27SRCF+= cmpdi2 28SRCF+= cmpti2 29SRCF+= ctzdi2 30SRCF+= ctzsi2 31SRCF+= ctzti2 32SRCF+= divdc3 33SRCF+= divdi3 34SRCF+= divmoddi4 35SRCF+= divmodsi4 36SRCF+= divmodti4 37SRCF+= divsc3 38SRCF+= divsi3 39SRCF+= divtc3 40SRCF+= divti3 41SRCF+= divxc3 42SRCF+= enable_execute_stack 43SRCF+= extendhfsf2 44SRCF+= ffsdi2 45SRCF+= ffssi2 46SRCF+= ffsti2 47SRCF+= fixdfdi 48SRCF+= fixdfti 49SRCF+= fixsfdi 50SRCF+= fixsfti 51SRCF+= fixunsdfdi 52SRCF+= fixunsdfsi 53SRCF+= fixunsdfti 54SRCF+= fixunssfdi 55SRCF+= fixunssfsi 56SRCF+= fixunssfti 57SRCF+= fixunsxfdi 58SRCF+= fixunsxfsi 59SRCF+= fixunsxfti 60SRCF+= fixxfdi 61SRCF+= fixxfti 62SRCF+= floatditf 63SRCF+= floattidf 64SRCF+= floattisf 65SRCF+= floattixf 66SRCF+= floatunditf 67SRCF+= floatunsidf 68SRCF+= floatunsisf 69SRCF+= floatuntidf 70SRCF+= floatuntisf 71SRCF+= floatuntixf 72SRCF+= int_util 73SRCF+= lshrdi3 74SRCF+= lshrti3 75SRCF+= moddi3 76SRCF+= modsi3 77SRCF+= modti3 78SRCF+= muldc3 79SRCF+= muldi3 80SRCF+= mulodi4 81SRCF+= mulosi4 82SRCF+= muloti4 83SRCF+= mulsc3 84SRCF+= multc3 85SRCF+= multi3 86SRCF+= mulvdi3 87SRCF+= mulvsi3 88SRCF+= mulvti3 89SRCF+= mulxc3 90SRCF+= negdf2 91SRCF+= negdi2 92SRCF+= negsf2 93SRCF+= negti2 94SRCF+= negvdi2 95SRCF+= negvsi2 96SRCF+= negvti2 97SRCF+= paritydi2 98SRCF+= paritysi2 99SRCF+= parityti2 100SRCF+= popcountdi2 101SRCF+= popcountsi2 102SRCF+= popcountti2 103SRCF+= powidf2 104SRCF+= powisf2 105SRCF+= powitf2 106SRCF+= powixf2 107SRCF+= subvdi3 108SRCF+= subvsi3 109SRCF+= subvti3 110SRCF+= trampoline_setup 111SRCF+= truncdfhf2 112SRCF+= truncsfhf2 113SRCF+= ucmpdi2 114SRCF+= ucmpti2 115SRCF+= udivdi3 116SRCF+= udivmoddi4 117SRCF+= udivmodsi4 118SRCF+= udivmodti4 119SRCF+= udivsi3 120SRCF+= udivti3 121SRCF+= umoddi3 122SRCF+= umodsi3 123SRCF+= umodti3 124 125# Enable compiler-rt's atomic implementation only for clang, as it uses clang 126# specific builtins, and gcc packages usually come with their own libatomic. 127# Exclude arm which has its own implementations of atomic functions, below. 128.if "${COMPILER_TYPE}" == "clang" && ${MACHINE_CPUARCH} != "arm" 129SRCF+= atomic 130.endif 131 132# Avoid using SSE2 instructions on i386, if unsupported. 133.if ${MACHINE_CPUARCH} == "i386" && empty(MACHINE_CPU:Msse2) 134SRCS+= floatdidf.c 135SRCS+= floatdisf.c 136SRCS+= floatdixf.c 137SRCS+= floatundidf.c 138SRCS+= floatundisf.c 139SRCS+= floatundixf.c 140.else 141SRCF+= floatdidf 142SRCF+= floatdisf 143SRCF+= floatdixf 144SRCF+= floatundidf 145SRCF+= floatundisf 146SRCF+= floatundixf 147.endif 148 149# __cpu_model support, only used on aarch64 and x86 150.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \ 151 ${MACHINE_CPUARCH} == "i386" 152SRCF+= cpu_model 153.endif 154 155# The fp_mode implementation for amd64 and i386 is shared, while other 156# architectures use the regular approach. 157.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" 158SRCS+= i386/fp_mode.c 159.else 160SRCF+= fp_mode 161.endif 162 163# 164# 128-bit quad precision long double support, 165# only used on some architectures. 166# 167.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "riscv" 168SRCF+= addtf3 169SRCF+= comparetf2 170SRCF+= divtf3 171SRCF+= extenddftf2 172SRCF+= extendhftf2 173SRCF+= extendsftf2 174SRCF+= fixtfdi 175SRCF+= fixtfsi 176SRCF+= fixtfti 177SRCF+= fixunstfdi 178SRCF+= fixunstfsi 179SRCF+= fixunstfti 180SRCF+= floatsitf 181SRCF+= floattitf 182SRCF+= floatunsitf 183SRCF+= floatuntitf 184SRCF+= multf3 185SRCF+= subtf3 186SRCF+= trunctfdf2 187SRCF+= trunctfhf2 188SRCF+= trunctfsf2 189.endif 190 191# These are already shipped by libc.a on some architectures. 192.if ${MACHINE_CPUARCH} != "arm" && ${MACHINE_CPUARCH} != "mips" && \ 193 ${MACHINE_CPUARCH} != "riscv" 194SRCF+= adddf3 195SRCF+= addsf3 196SRCF+= divdf3 197SRCF+= divsf3 198SRCF+= extendsfdf2 199SRCF+= fixdfsi 200SRCF+= fixsfsi 201SRCF+= floatsidf 202SRCF+= floatsisf 203SRCF+= muldf3 204SRCF+= mulsf3 205SRCF+= subdf3 206SRCF+= subsf3 207SRCF+= truncdfsf2 208.endif 209 210.if ${MACHINE_CPUARCH} != "arm" && ${MACHINE_CPUARCH} != "mips" 211SRCF+= comparedf2 212SRCF+= comparesf2 213.endif 214 215# FreeBSD-specific atomic intrinsics. 216.if ${MACHINE_CPUARCH} == "arm" 217.PATH: ${SRCTOP}/sys/arm/arm 218 219SRCF+= stdatomic 220CFLAGS+= -DEMIT_SYNC_ATOMICS 221.elif ${MACHINE_CPUARCH} == "mips" 222.PATH: ${SRCTOP}/sys/mips/mips 223 224SRCF+= stdatomic 225.endif 226 227.for file in ${SRCF} 228.if ${MACHINE_CPUARCH} == "arm" && (!defined(CPUTYPE) || ${CPUTYPE:M*soft*} == "") \ 229 && exists(${CRTSRC}/${CRTARCH}/${file}vfp.S) 230SRCS+= ${file}vfp.S 231. elif exists(${CRTSRC}/${CRTARCH}/${file}.S) 232SRCS+= ${file}.S 233. else 234SRCS+= ${file}.c 235. endif 236.endfor 237 238.if ${MACHINE_CPUARCH} == "arm" 239SRCS+= aeabi_div0.c 240SRCS+= aeabi_idivmod.S 241SRCS+= aeabi_ldivmod.S 242SRCS+= aeabi_memcmp.S 243SRCS+= aeabi_memcpy.S 244SRCS+= aeabi_memmove.S 245SRCS+= aeabi_memset.S 246SRCS+= aeabi_uidivmod.S 247SRCS+= aeabi_uldivmod.S 248SRCS+= switch16.S 249SRCS+= switch32.S 250SRCS+= switch8.S 251SRCS+= switchu8.S 252SRCS+= sync_synchronize.S 253.endif 254 255.if ${MACHINE_ARCH:Mriscv*sf} 256CFLAGS+= -D__SOFT_FP__ 257.endif 258