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