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