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