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