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 addtf3 \ 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 divtf3 \ 49 divti3 \ 50 divxc3 \ 51 enable_execute_stack \ 52 eprintf \ 53 ffsdi2 \ 54 ffsti2 \ 55 fixdfdi \ 56 fixdfti \ 57 fixsfdi \ 58 fixsfti \ 59 fixtfdi \ 60 fixtfsi \ 61 fixtfti \ 62 fixunsdfdi \ 63 fixunsdfsi \ 64 fixunsdfti \ 65 fixunssfdi \ 66 fixunssfsi \ 67 fixunssfti \ 68 fixunstfdi \ 69 fixunstfsi \ 70 fixunstfti \ 71 fixunsxfdi \ 72 fixunsxfsi \ 73 fixunsxfti \ 74 fixxfdi \ 75 fixxfti \ 76 floatdidf \ 77 floatdisf \ 78 floatdixf \ 79 floattidf \ 80 floattisf \ 81 floattixf \ 82 floatundidf \ 83 floatundisf \ 84 floatundixf \ 85 floatunsidf \ 86 floatunsisf \ 87 floatuntidf \ 88 floatuntisf \ 89 floatuntixf \ 90 gcc_personality_v0 \ 91 int_util \ 92 lshrdi3 \ 93 lshrti3 \ 94 moddi3 \ 95 modti3 \ 96 muldc3 \ 97 muldi3 \ 98 mulodi4 \ 99 mulosi4 \ 100 muloti4 \ 101 mulsc3 \ 102 multf3 \ 103 multi3 \ 104 mulvdi3 \ 105 mulvsi3 \ 106 mulvti3 \ 107 mulxc3 \ 108 negdf2 \ 109 negdi2 \ 110 negsf2 \ 111 negti2 \ 112 negvdi2 \ 113 negvsi2 \ 114 negvti2 \ 115 paritydi2 \ 116 paritysi2 \ 117 parityti2 \ 118 popcountdi2 \ 119 popcountsi2 \ 120 popcountti2 \ 121 powidf2 \ 122 powisf2 \ 123 powitf2 \ 124 powixf2 \ 125 subtf3 \ 126 subvdi3 \ 127 subvsi3 \ 128 subvti3 \ 129 trampoline_setup \ 130 ucmpdi2 \ 131 ucmpti2 \ 132 udivdi3 \ 133 udivmoddi4 \ 134 udivmodsi4 \ 135 udivmodti4 \ 136 udivti3 \ 137 umoddi3 \ 138 umodti3 139 140# These are already shipped by libc.a on arm and mips 141.if ${MACHINE_CPUARCH} != "arm" && ${MACHINE_CPUARCH} != "mips" 142SRCF+= adddf3 \ 143 addsf3 \ 144 divdf3 \ 145 divsf3 \ 146 extendsfdf2 \ 147 fixdfsi \ 148 fixsfsi \ 149 floatsidf \ 150 floatsisf \ 151 muldf3 \ 152 mulsf3 \ 153 subdf3 \ 154 subsf3 \ 155 truncdfsf2 156.endif 157 158.if ${MACHINE_CPUARCH} != "arm" 159SRCF+= comparedf2 \ 160 comparesf2 161.endif 162 163.if ${MACHINE_CPUARCH} != "mips" 164SRCF+= divsi3 \ 165 modsi3 \ 166 udivsi3 \ 167 umodsi3 168.endif 169 170# FreeBSD-specific atomic intrinsics. 171.if ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "armv6" 172.PATH: ${.CURDIR}/../../sys/arm/arm 173 174SRCF+= stdatomic 175CFLAGS+= -DEMIT_SYNC_ATOMICS 176.elif ${MACHINE_CPUARCH} == "mips" 177.PATH: ${.CURDIR}/../../sys/mips/mips 178 179SRCF+= stdatomic 180.endif 181 182.for file in ${SRCF} 183. if ${MACHINE_ARCH:Marm*hf*} != "" && exists(${CRTSRC}/${CRTARCH}/${file}vfp.S) 184SRCS+= ${file}vfp.S 185. elif !(${MACHINE_CPUARCH} == "arm" && ${MACHINE_ARCH:Marm*hf*} == "") && exists(${CRTSRC}/${CRTARCH}/${file}.S) 186SRCS+= ${file}.S 187. else 188SRCS+= ${file}.c 189. endif 190.endfor 191 192.if ${MACHINE_CPUARCH} == "arm" 193SRCS+= aeabi_div0.c \ 194 aeabi_idivmod.S \ 195 aeabi_ldivmod.S \ 196 aeabi_memcmp.S \ 197 aeabi_memcpy.S \ 198 aeabi_memmove.S \ 199 aeabi_memset.S \ 200 aeabi_uidivmod.S \ 201 aeabi_uldivmod.S \ 202 bswapdi2.S \ 203 bswapsi2.S \ 204 switch16.S \ 205 switch32.S \ 206 switch8.S \ 207 switchu8.S \ 208 sync_synchronize.S 209.endif 210 211.if ${MK_INSTALLLIB} != "no" 212SYMLINKS+=libcompiler_rt.a ${LIBDIR}/libgcc.a 213.endif 214.if ${MK_PROFILE} != "no" 215SYMLINKS+=libcompiler_rt_p.a ${LIBDIR}/libgcc_p.a 216.endif 217 218.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" || \ 219 ${MACHINE_CPUARCH} == "powerpc" 220AFLAGS+=--noexecstack 221ACFLAGS+=-Wa,--noexecstack 222.endif 223 224 225.include <bsd.lib.mk> 226