1# $FreeBSD$ 2 3.include <bsd.own.mk> 4 5LIB= compiler_rt 6NO_PIC= 7WARNS?= 2 8 9CFLAGS+=${PICFLAG} -fvisibility=hidden -DVISIBILITY_HIDDEN 10 11.if ${MACHINE_CPUARCH} == "amd64" 12CRTARCH=x86_64 13.else 14CRTARCH=${MACHINE_CPUARCH} 15.endif 16 17CRTSRC=${.CURDIR}/../../contrib/compiler-rt/lib 18 19.PATH: ${CRTSRC}/${CRTARCH} ${CRTSRC} 20 21SRCF= absvdi2 \ 22 absvsi2 \ 23 absvti2 \ 24 addvdi3 \ 25 addvsi3 \ 26 addvti3 \ 27 ashldi3 \ 28 ashlti3 \ 29 ashrdi3 \ 30 ashrti3 \ 31 clear_cache \ 32 clzdi2 \ 33 clzsi2 \ 34 clzti2 \ 35 cmpdi2 \ 36 cmpti2 \ 37 comparedf2 \ 38 comparesf2 \ 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 floatdixf \ 71 floattidf \ 72 floattisf \ 73 floattixf \ 74 floatundidf \ 75 floatundisf \ 76 floatundixf \ 77 floatunsidf \ 78 floatunsisf \ 79 floatuntidf \ 80 floatuntisf \ 81 floatuntixf \ 82 int_util \ 83 lshrdi3 \ 84 lshrti3 \ 85 moddi3 \ 86 modti3 \ 87 muldc3 \ 88 muldi3 \ 89 mulodi4 \ 90 mulosi4 \ 91 muloti4 \ 92 mulsc3 \ 93 multi3 \ 94 mulvdi3 \ 95 mulvsi3 \ 96 mulvti3 \ 97 mulxc3 \ 98 negdf2 \ 99 negdi2 \ 100 negsf2 \ 101 negti2 \ 102 negvdi2 \ 103 negvsi2 \ 104 negvti2 \ 105 paritydi2 \ 106 paritysi2 \ 107 parityti2 \ 108 popcountdi2 \ 109 popcountsi2 \ 110 popcountti2 \ 111 powidf2 \ 112 powisf2 \ 113 powitf2 \ 114 powixf2 \ 115 subvdi3 \ 116 subvsi3 \ 117 subvti3 \ 118 trampoline_setup \ 119 ucmpdi2 \ 120 ucmpti2 \ 121 udivdi3 \ 122 udivmoddi4 \ 123 udivmodsi4 \ 124 udivmodti4 \ 125 udivti3 \ 126 umoddi3 \ 127 umodti3 128 129# These are already shipped by libc.a on arm and mips 130.if ${MACHINE_CPUARCH} != "arm" && ${MACHINE_CPUARCH} != "mips" 131SRCF+= adddf3 \ 132 addsf3 \ 133 divdf3 \ 134 divsf3 \ 135 divsi3 \ 136 extendsfdf2 \ 137 fixdfsi \ 138 fixsfsi \ 139 floatsidf \ 140 floatsisf \ 141 modsi3 \ 142 muldf3 \ 143 mulsf3 \ 144 subdf3 \ 145 subsf3 \ 146 truncdfsf2 \ 147 udivsi3 \ 148 umodsi3 149.endif 150 151# FreeBSD-specific atomic intrinsics. 152.if ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "mips" 153SRCF+= __sync_fetch_and_add_4 \ 154 __sync_fetch_and_and_4 \ 155 __sync_fetch_and_or_4 \ 156 __sync_fetch_and_sub_4 \ 157 __sync_fetch_and_xor_4 \ 158 __sync_lock_test_and_set_4 \ 159 __sync_val_compare_and_swap_4 160.endif 161.if ${MACHINE_ARCH:Mmips64*} != "" 162SRCF+= __sync_fetch_and_add_8 \ 163 __sync_fetch_and_and_8 \ 164 __sync_fetch_and_or_8 \ 165 __sync_fetch_and_sub_8 \ 166 __sync_fetch_and_xor_8 \ 167 __sync_lock_test_and_set_8 \ 168 __sync_val_compare_and_swap_8 169.endif 170 171.for file in ${SRCF} 172. if ${MACHINE_CPUARCH} != "arm" && exists(${CRTSRC}/${CRTARCH}/${file}.S) 173SRCS+= ${file}.S 174. else 175SRCS+= ${file}.c 176. endif 177.endfor 178 179.if ${MACHINE_CPUARCH} != "sparc64" && ${MACHINE_CPUARCH} != "mips" 180. if ${MK_INSTALLLIB} != "no" 181SYMLINKS+=libcompiler_rt.a ${LIBDIR}/libgcc.a 182. endif 183. if ${MK_PROFILE} != "no" 184SYMLINKS+=libcompiler_rt_p.a ${LIBDIR}/libgcc_p.a 185. endif 186.endif 187 188.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" || \ 189 ${MACHINE_CPUARCH} == "powerpc" 190AFLAGS+=--noexecstack 191ACFLAGS+=-Wa,--noexecstack 192.endif 193 194 195.include <bsd.lib.mk> 196