1 # $NetBSD: Makefile.inc,v 1.17.2.1 2014/08/10 06:51:50 tls Exp $ 2 3 COMPILER_RT_SRCDIR= ${NETBSDSRCDIR}/sys/external/bsd/compiler_rt/dist 4 5 .if ${LIBC_MACHINE_ARCH} == "powerpc" 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/${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 divdf3.c \ 42 divsf3.c \ 43 extendsfdf2.c \ 44 fixdfsi.c \ 45 fixdfti.c \ 46 fixsfsi.c \ 47 fixsfti.c \ 48 floatsidf.c \ 49 floatsisf.c \ 50 floatunsidf.c \ 51 floatunsisf.c \ 52 muldf3.c \ 53 mulsf3.c \ 54 subdf3.c \ 55 subsf3.c \ 56 truncdfsf2.c 57 .endif 58 59 GENERIC_SRCS+= \ 60 absvsi2.c \ 61 absvti2.c \ 62 addvsi3.c \ 63 addvti3.c \ 64 ashlti3.c \ 65 ashrti3.c \ 66 clzsi2.c \ 67 clzti2.c \ 68 cmpti2.c \ 69 ctzsi2.c \ 70 ctzti2.c \ 71 divmodsi4.c \ 72 divsi3.c \ 73 divti3.c \ 74 ffsti2.c \ 75 fixsfdi.c \ 76 fixdfdi.c \ 77 fixunsdfdi.c \ 78 fixunsdfsi.c \ 79 fixunsdfti.c \ 80 fixunssfdi.c \ 81 fixunssfsi.c \ 82 fixunssfti.c \ 83 fixunsxfdi.c \ 84 fixunsxfsi.c \ 85 fixunsxfti.c \ 86 fixxfdi.c \ 87 fixxfti.c \ 88 floatdidf.c \ 89 floatdisf.c \ 90 floatdixf.c \ 91 floattidf.c \ 92 floattisf.c \ 93 floattixf.c \ 94 floatundidf.c \ 95 floatundisf.c \ 96 floatundixf.c \ 97 floatuntidf.c \ 98 floatuntisf.c \ 99 floatuntixf.c \ 100 int_util.c \ 101 lshrti3.c \ 102 modsi3.c \ 103 modti3.c \ 104 muldc3.c \ 105 mulosi4.c \ 106 muloti4.c \ 107 multi3.c \ 108 mulvsi3.c \ 109 mulvti3.c \ 110 negdf2.c \ 111 negsf2.c \ 112 negti2.c \ 113 negvsi2.c \ 114 negvti2.c \ 115 paritysi2.c \ 116 parityti2.c \ 117 popcountsi2.c \ 118 popcountti2.c \ 119 powidf2.c \ 120 powisf2.c \ 121 powitf2.c \ 122 powixf2.c \ 123 subvsi3.c \ 124 subvti3.c \ 125 ucmpti2.c \ 126 udivmodsi4.c \ 127 udivmodti4.c \ 128 udivti3.c \ 129 umodsi3.c \ 130 umodti3.c 131 132 .if ${MACHINE_CPU} != "sh3" 133 # On sh3 __udivsi3 is gcc "millicode" with special calling convention 134 # (less registers clobbered than usual). Each DSO that needs it gets 135 # its own hidden copy from libgcc.a. 136 GENERIC_SRCS+= \ 137 udivsi3.c 138 .endif 139 140 GENERIC_SRCS+= \ 141 absvdi2.c \ 142 addvdi3.c \ 143 clzdi2.c \ 144 ctzdi2.c \ 145 ffsdi2.c \ 146 mulodi4.c \ 147 mulvdi3.c \ 148 negvdi2.c \ 149 paritydi2.c \ 150 popcountdi2.c \ 151 subvdi3.c 152 153 .if empty(LIBC_MACHINE_ARCH:M*64*) && ${LIBC_MACHINE_ARCH} != "alpha" 154 GENERIC_SRCS+= \ 155 cmpdi2.c \ 156 ashldi3.c \ 157 ashrdi3.c \ 158 divdi3.c \ 159 divmoddi4.c \ 160 lshrdi3.c \ 161 moddi3.c \ 162 muldi3.c \ 163 negdi2.c \ 164 ucmpdi2.c \ 165 udivdi3.c \ 166 udivmoddi4.c \ 167 umoddi3.c 168 .endif 169 170 GENERIC_SRCS+= \ 171 GCDAProfiling.c \ 172 InstrProfiling.c \ 173 InstrProfilingBuffer.c \ 174 InstrProfilingFile.c \ 175 InstrProfilingPlatformOther.c 176 177 .if ${LIBC_MACHINE_ARCH} == "powerpc" 178 GENERIC_SRCS+= \ 179 fixtfdi.c \ 180 fixunstfdi.c \ 181 floatditf.c \ 182 floatunditf.c \ 183 gcc_qadd.c \ 184 gcc_qdiv.c \ 185 gcc_qmul.c \ 186 gcc_qsub.c 187 .endif 188 189 .if ${MACHINE_CPU} == "arm" 190 .if !empty(LIBC_MACHINE_ARCH:Mearm*) 191 GENERIC_SRCS+= \ 192 aeabi_idivmod.S \ 193 aeabi_ldivmod.S \ 194 aeabi_uidivmod.S \ 195 aeabi_uldivmod.S 196 .endif 197 GENERIC_SRCS+= \ 198 clear_cache.c 199 # Not yet, overlaps with softfloat 200 # aeabi_dcmp.S \ 201 # aeabi_fcmp.S 202 # Not yet, requires ARMv6 203 #GENERIC_SRCS+= \ 204 # bswapdi2.S \ 205 # bswapsi2.S 206 .endif 207 208 .for src in ${GENERIC_SRCS} 209 . if exists(${COMPILER_RT_CPU_DIR}/${src:R}.S) || \ 210 exists(${COMPILER_RT_ARCH_DIR}/${src:R}.S) 211 SRCS+= ${src:R}.S 212 . else 213 SRCS+= ${src} 214 . if ${src:E} != "cc" 215 COPTS.${src}+= -Wno-missing-prototypes \ 216 -Wno-old-style-definition \ 217 -Wno-strict-prototypes \ 218 -Wno-uninitialized \ 219 -Wno-cast-qual 220 . endif 221 . endif 222 .endfor 223