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