1 # $NetBSD: Makefile.inc,v 1.16 2014/03/02 03:04:52 matt 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 udivsi3.c \ 131 udivti3.c \ 132 umodsi3.c \ 133 umodti3.c 134 135 GENERIC_SRCS+= \ 136 absvdi2.c \ 137 addvdi3.c \ 138 clzdi2.c \ 139 ctzdi2.c \ 140 ffsdi2.c \ 141 mulodi4.c \ 142 mulvdi3.c \ 143 negvdi2.c \ 144 paritydi2.c \ 145 popcountdi2.c \ 146 subvdi3.c 147 148 .if empty(LIBC_MACHINE_ARCH:M*64*) && ${LIBC_MACHINE_ARCH} != "alpha" 149 GENERIC_SRCS+= \ 150 cmpdi2.c \ 151 ashldi3.c \ 152 ashrdi3.c \ 153 divdi3.c \ 154 divmoddi4.c \ 155 lshrdi3.c \ 156 moddi3.c \ 157 muldi3.c \ 158 negdi2.c \ 159 ucmpdi2.c \ 160 udivdi3.c \ 161 udivmoddi4.c \ 162 umoddi3.c 163 .endif 164 165 GENERIC_SRCS+= \ 166 GCDAProfiling.c \ 167 PGOProfiling.c 168 169 .if ${LIBC_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 181 .if ${MACHINE_CPU} == "arm" 182 .if !empty(LIBC_MACHINE_ARCH:Mearm*) 183 GENERIC_SRCS+= \ 184 aeabi_idivmod.S \ 185 aeabi_ldivmod.S \ 186 aeabi_uidivmod.S \ 187 aeabi_uldivmod.S 188 .endif 189 GENERIC_SRCS+= \ 190 clear_cache.c 191 # Not yet, overlaps with softfloat 192 # aeabi_dcmp.S \ 193 # aeabi_fcmp.S 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