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