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