1# $FreeBSD$ 2 3.include <src.opts.mk> 4 5LIB= compiler_rt 6NO_PIC= 7WARNS?= 2 8 9CFLAGS+=${PICFLAG} -fvisibility=hidden -DVISIBILITY_HIDDEN 10CFLAGS+=-I${.CURDIR}/../../contrib/libcxxrt 11 12.if ${MACHINE_CPUARCH} == "amd64" 13CRTARCH=x86_64 14.else 15CRTARCH=${MACHINE_CPUARCH} 16.endif 17 18CRTSRC=${.CURDIR}/../../contrib/compiler-rt/lib/builtins 19 20.PATH: ${CRTSRC}/${CRTARCH} ${CRTSRC} 21 22SRCF= absvdi2 \ 23 absvsi2 \ 24 absvti2 \ 25 addvdi3 \ 26 addvsi3 \ 27 addvti3 \ 28 apple_versioning \ 29 ashldi3 \ 30 ashlti3 \ 31 ashrdi3 \ 32 ashrti3 \ 33 clear_cache \ 34 clzdi2 \ 35 clzsi2 \ 36 clzti2 \ 37 cmpdi2 \ 38 cmpti2 \ 39 ctzdi2 \ 40 ctzsi2 \ 41 ctzti2 \ 42 divdc3 \ 43 divdi3 \ 44 divmoddi4 \ 45 divmodsi4 \ 46 divsc3 \ 47 divti3 \ 48 divxc3 \ 49 enable_execute_stack \ 50 eprintf \ 51 ffsdi2 \ 52 ffsti2 \ 53 fixdfdi \ 54 fixdfti \ 55 fixsfdi \ 56 fixsfti \ 57 fixunsdfdi \ 58 fixunsdfsi \ 59 fixunsdfti \ 60 fixunssfdi \ 61 fixunssfsi \ 62 fixunssfti \ 63 fixunsxfdi \ 64 fixunsxfsi \ 65 fixunsxfti \ 66 fixxfdi \ 67 fixxfti \ 68 floatdidf \ 69 floatdisf \ 70 floatditf \ 71 floatdixf \ 72 floatsitf \ 73 floattidf \ 74 floattisf \ 75 floattixf \ 76 floatundidf \ 77 floatundisf \ 78 floatunditf \ 79 floatundixf \ 80 floatunsidf \ 81 floatunsisf \ 82 floatuntidf \ 83 floatuntisf \ 84 floatuntixf \ 85 gcc_personality_v0 \ 86 int_util \ 87 lshrdi3 \ 88 lshrti3 \ 89 moddi3 \ 90 modti3 \ 91 muldc3 \ 92 muldi3 \ 93 mulodi4 \ 94 mulosi4 \ 95 muloti4 \ 96 mulsc3 \ 97 multi3 \ 98 mulvdi3 \ 99 mulvsi3 \ 100 mulvti3 \ 101 multc3 \ 102 mulxc3 \ 103 negdf2 \ 104 negdi2 \ 105 negsf2 \ 106 negti2 \ 107 negvdi2 \ 108 negvsi2 \ 109 negvti2 \ 110 paritydi2 \ 111 paritysi2 \ 112 parityti2 \ 113 popcountdi2 \ 114 popcountsi2 \ 115 popcountti2 \ 116 powidf2 \ 117 powisf2 \ 118 powitf2 \ 119 powixf2 \ 120 subvdi3 \ 121 subvsi3 \ 122 subvti3 \ 123 trampoline_setup \ 124 ucmpdi2 \ 125 ucmpti2 \ 126 udivdi3 \ 127 udivmoddi4 \ 128 udivmodsi4 \ 129 udivmodti4 \ 130 udivti3 \ 131 umoddi3 \ 132 umodti3 133 134# 128-bit quad precision long double support, only used on arm64 135.if ${MACHINE_CPUARCH} == "aarch64" 136SRCF+= addtf3 \ 137 comparetf2 \ 138 divtf3 \ 139 extenddftf2 \ 140 extendsftf2 \ 141 fixtfdi \ 142 fixtfsi \ 143 fixtfti \ 144 fixunstfdi \ 145 fixunstfsi \ 146 fixunstfti \ 147 multf3 \ 148 subtf3 \ 149 trunctfdf2 \ 150 trunctfsf2 151.endif 152 153# These are already shipped by libc.a on arm and mips 154.if ${MACHINE_CPUARCH} != "arm" && ${MACHINE_CPUARCH} != "mips" 155SRCF+= adddf3 \ 156 addsf3 \ 157 divdf3 \ 158 divsf3 \ 159 extendsfdf2 \ 160 fixdfsi \ 161 fixsfsi \ 162 floatsidf \ 163 floatsisf \ 164 muldf3 \ 165 mulsf3 \ 166 subdf3 \ 167 subsf3 \ 168 truncdfsf2 169.endif 170 171.if ${MACHINE_CPUARCH} != "arm" 172SRCF+= comparedf2 \ 173 comparesf2 174.endif 175 176.if ${MACHINE_CPUARCH} != "mips" 177SRCF+= divsi3 \ 178 modsi3 \ 179 udivsi3 \ 180 umodsi3 181.endif 182 183# FreeBSD-specific atomic intrinsics. 184.if ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "armv6" 185.PATH: ${.CURDIR}/../../sys/arm/arm 186 187SRCF+= stdatomic 188CFLAGS+= -DEMIT_SYNC_ATOMICS 189.elif ${MACHINE_CPUARCH} == "mips" 190.PATH: ${.CURDIR}/../../sys/mips/mips 191 192SRCF+= stdatomic 193.endif 194 195.for file in ${SRCF} 196. if ${MACHINE_ARCH:Marm*hf*} != "" && exists(${CRTSRC}/${CRTARCH}/${file}vfp.S) 197SRCS+= ${file}vfp.S 198. elif !(${MACHINE_CPUARCH} == "arm" && ${MACHINE_ARCH:Marm*hf*} == "") && exists(${CRTSRC}/${CRTARCH}/${file}.S) 199SRCS+= ${file}.S 200. else 201SRCS+= ${file}.c 202. endif 203.endfor 204 205.if ${MACHINE_CPUARCH} == "arm" 206SRCS+= aeabi_div0.c \ 207 aeabi_idivmod.S \ 208 aeabi_ldivmod.S \ 209 aeabi_memcmp.S \ 210 aeabi_memcpy.S \ 211 aeabi_memmove.S \ 212 aeabi_memset.S \ 213 aeabi_uidivmod.S \ 214 aeabi_uldivmod.S \ 215 bswapdi2.S \ 216 bswapsi2.S \ 217 switch16.S \ 218 switch32.S \ 219 switch8.S \ 220 switchu8.S \ 221 sync_synchronize.S 222.endif 223 224.if ${MK_INSTALLLIB} != "no" 225SYMLINKS+=libcompiler_rt.a ${LIBDIR}/libgcc.a 226.endif 227.if ${MK_PROFILE} != "no" 228SYMLINKS+=libcompiler_rt_p.a ${LIBDIR}/libgcc_p.a 229.endif 230 231.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" || \ 232 ${MACHINE_CPUARCH} == "powerpc" 233AFLAGS+=--noexecstack 234ACFLAGS+=-Wa,--noexecstack 235.endif 236 237 238.include <bsd.lib.mk> 239