1 # $NetBSD: Makefile.inc,v 1.24.2.2 2015/02/04 22:00:24 martin Exp $ 2 3 COMPILER_RT_SRCDIR= ${NETBSDSRCDIR}/sys/external/bsd/compiler_rt/dist 4 5 .if ${LIBC_MACHINE_ARCH} == "powerpc" || ${LIBC_MACHINE_ARCH} == "powerpc64" 6 COMPILER_RT_CPU_DIR= ${COMPILER_RT_SRCDIR}/lib/builtins/ppc 7 COMPILER_RT_ARCH_DIR= ${COMPILER_RT_SRCDIR}/lib/builtins/ppc 8 .else 9 COMPILER_RT_CPU_DIR= ${COMPILER_RT_SRCDIR}/lib/builtins/${LIBC_MACHINE_CPU} 10 COMPILER_RT_ARCH_DIR= ${COMPILER_RT_SRCDIR}/lib/builtins/${LIBC_MACHINE_ARCH} 11 .endif 12 13 .PATH: ${COMPILER_RT_CPU_DIR} 14 .PATH: ${COMPILER_RT_ARCH_DIR} 15 .PATH: ${COMPILER_RT_SRCDIR}/lib/builtins 16 .PATH: ${COMPILER_RT_SRCDIR}/lib/profile 17 18 # Complex support needs parts of libm 19 #GENERIC_SRCS+= 20 # mulxc3.c \ 21 # mulsc3.c \ 22 # divxc3.c \ 23 # divdc3.c \ 24 # divsc3.c 25 26 # Implemented on top of our atomic interface. 27 #GENERIC_SRCS+= atomic.c 28 29 .if ${HAVE_LIBGCC_EH} == "no" 30 GENERIC_SRCS+= \ 31 gcc_personality_v0.c 32 .endif 33 34 .if 0 35 # Conflicts with soft-float 36 GENERIC_SRCS+= \ 37 comparedf2.c \ 38 comparesf2.c \ 39 adddf3.c \ 40 addsf3.c \ 41 addtf3.c \ 42 divdf3.c \ 43 divsf3.c \ 44 divtf3.c \ 45 extendsfdf2.c \ 46 extendsftf2.c \ 47 extenddftf2.c \ 48 fixdfsi.c \ 49 fixdfti.c \ 50 fixsfsi.c \ 51 fixsfti.c \ 52 floatsidf.c \ 53 floatsisf.c \ 54 floatunsidf.c \ 55 floatunsisf.c \ 56 muldf3.c \ 57 mulsf3.c \ 58 multf3.c \ 59 subdf3.c \ 60 subsf3.c \ 61 subtf3.c \ 62 truncdfsf2.c \ 63 trunctfdf2.c \ 64 trunctfsf2.c 65 .endif 66 67 GENERIC_SRCS+= \ 68 absvsi2.c \ 69 absvti2.c \ 70 addvsi3.c \ 71 addvti3.c \ 72 ashlti3.c \ 73 ashrti3.c \ 74 clzti2.c \ 75 cmpti2.c \ 76 ctzti2.c \ 77 divti3.c \ 78 ffsti2.c \ 79 fixsfdi.c \ 80 fixdfdi.c \ 81 fixunsdfdi.c \ 82 fixunsdfsi.c \ 83 fixunssfdi.c \ 84 fixunssfsi.c \ 85 fixunsxfdi.c \ 86 fixunsxfsi.c \ 87 fixxfdi.c \ 88 floatdidf.c \ 89 floatdisf.c \ 90 floatdixf.c \ 91 floatundidf.c \ 92 floatundisf.c \ 93 floatundixf.c \ 94 int_util.c \ 95 lshrti3.c \ 96 modti3.c \ 97 muldc3.c \ 98 mulosi4.c \ 99 muloti4.c \ 100 multi3.c \ 101 mulvsi3.c \ 102 mulvti3.c \ 103 negdf2.c \ 104 negsf2.c \ 105 negti2.c \ 106 negvsi2.c \ 107 negvti2.c \ 108 paritysi2.c \ 109 parityti2.c \ 110 popcountsi2.c \ 111 popcountti2.c \ 112 powidf2.c \ 113 powisf2.c \ 114 powitf2.c \ 115 powixf2.c \ 116 subvsi3.c \ 117 subvti3.c \ 118 ucmpti2.c \ 119 udivmodti4.c \ 120 udivti3.c \ 121 umodti3.c 122 123 .if ${MACHINE_ARCH} != "aarch64" 124 GENERIC_SRCS+= \ 125 fixunsdfti.c \ 126 fixunssfti.c \ 127 fixunsxfti.c \ 128 fixxfti.c \ 129 floattidf.c \ 130 floattisf.c \ 131 floattixf.c \ 132 floatuntidf.c \ 133 floatuntisf.c \ 134 floatuntixf.c 135 .endif 136 137 # These have h/w instructions which are always used. 138 .if ${LIBC_MACHINE_ARCH} != "alpha" && ${LIBC_MACHINE_CPU} != "powerpc" \ 139 && ${LIBC_MACHINE_CPU} != "aarch64" 140 GENERIC_SRCS+= \ 141 clzsi2.c 142 .endif 143 144 # These have h/w instructions which are always used. 145 .if ${LIBC_MACHINE_ARCH} != "alpha" && ${LIBC_MACHINE_CPU} != "powerpc" \ 146 && ${LIBC_MACHINE_CPU} != "aarch64" && ${LIBC_MACHINE_ARCH} != "vax" 147 GENERIC_SRCS+= \ 148 ctzsi2.c \ 149 divmodsi4.c \ 150 divsi3.c \ 151 modsi3.c \ 152 udivmodsi4.c \ 153 umodsi3.c 154 155 . if ${LIBC_MACHINE_CPU} != "sh3" 156 # On sh3 __udivsi3 is gcc "millicode" with special calling convention 157 # (less registers clobbered than usual). Each DSO that needs it gets 158 # its own hidden copy from libgcc.a. 159 GENERIC_SRCS+= \ 160 udivsi3.c 161 . endif 162 .endif 163 164 165 GENERIC_SRCS+= \ 166 absvdi2.c \ 167 addvdi3.c \ 168 mulodi4.c \ 169 mulvdi3.c \ 170 negvdi2.c \ 171 paritydi2.c \ 172 popcountdi2.c \ 173 subvdi3.c 174 175 # These have h/w instructions which are always used. 176 .if ${LIBC_MACHINE_ARCH} != "alpha" && ${LIBC_MACHINE_CPU} != "powerpc64" \ 177 && ${LIBC_MACHINE_ARCH} != "aarch64" 178 GENERIC_SRCS+= \ 179 clzdi2.c \ 180 ctzdi2.c \ 181 ffsdi2.c 182 .endif 183 184 # Don't need these on 64-bit machines. 185 .if empty(LIBC_MACHINE_ARCH:M*64*) && ${LIBC_MACHINE_ARCH} != "alpha" 186 GENERIC_SRCS+= \ 187 cmpdi2.c \ 188 ashldi3.c \ 189 ashrdi3.c \ 190 divdi3.c \ 191 divmoddi4.c \ 192 lshrdi3.c \ 193 moddi3.c \ 194 muldi3.c \ 195 negdi2.c \ 196 ucmpdi2.c \ 197 udivdi3.c \ 198 udivmoddi4.c \ 199 umoddi3.c 200 .endif 201 202 GENERIC_SRCS+= \ 203 GCDAProfiling.c \ 204 InstrProfiling.c \ 205 InstrProfilingBuffer.c \ 206 InstrProfilingFile.c \ 207 InstrProfilingPlatformOther.c 208 209 .if ${LIBC_MACHINE_ARCH} == "powerpc" || ${LIBC_MACHINE_ARCH} == "powerpc64" 210 GENERIC_SRCS+= \ 211 fixtfdi.c \ 212 fixunstfdi.c \ 213 floatditf.c \ 214 floatunditf.c \ 215 gcc_qadd.c \ 216 gcc_qdiv.c \ 217 gcc_qmul.c \ 218 gcc_qsub.c 219 .endif 220 221 .if ${LIBC_MACHINE_CPU} == "aarch64" 222 GENERIC_SRCS+= \ 223 clear_cache.c 224 .endif 225 226 .if ${LIBC_MACHINE_CPU} == "arm" 227 .if !empty(LIBC_MACHINE_ARCH:Mearm*) 228 GENERIC_SRCS+= \ 229 aeabi_idivmod.S \ 230 aeabi_ldivmod.S \ 231 aeabi_uidivmod.S \ 232 aeabi_uldivmod.S 233 .endif 234 GENERIC_SRCS+= \ 235 clear_cache.c 236 # Not yet, overlaps with softfloat 237 # aeabi_dcmp.S \ 238 # aeabi_fcmp.S 239 # Not yet, requires ARMv6 240 #GENERIC_SRCS+= \ 241 # bswapdi2.S \ 242 # bswapsi2.S 243 .endif 244 245 .for src in ${GENERIC_SRCS} 246 . if exists(${COMPILER_RT_CPU_DIR}/${src:R}.S) || \ 247 exists(${COMPILER_RT_ARCH_DIR}/${src:R}.S) 248 SRCS+= ${src:R}.S 249 . else 250 SRCS+= ${src} 251 . if ${src:E} != "cc" 252 COPTS.${src}+= -Wno-missing-prototypes \ 253 -Wno-old-style-definition \ 254 -Wno-strict-prototypes \ 255 -Wno-uninitialized \ 256 -Wno-cast-qual 257 . endif 258 . endif 259 .endfor 260