Home | History | Annotate | Line # | Download | only in compiler_rt
Makefile.inc revision 1.35.4.2
      1  1.35.4.1  martin # $NetBSD: Makefile.inc,v 1.35.4.2 2020/04/13 08:03:09 martin Exp $
      2       1.1   joerg 
      3       1.1   joerg COMPILER_RT_SRCDIR=	${NETBSDSRCDIR}/sys/external/bsd/compiler_rt/dist
      4       1.1   joerg 
      5      1.25   joerg .if ${LIBC_MACHINE_ARCH} == "powerpc" || ${LIBC_MACHINE_ARCH} == "powerpc64"
      6      1.15   joerg COMPILER_RT_CPU_DIR=	${COMPILER_RT_SRCDIR}/lib/builtins/ppc
      7      1.15   joerg COMPILER_RT_ARCH_DIR=	${COMPILER_RT_SRCDIR}/lib/builtins/ppc
      8       1.1   joerg .else
      9      1.24    matt COMPILER_RT_CPU_DIR=	${COMPILER_RT_SRCDIR}/lib/builtins/${LIBC_MACHINE_CPU}
     10      1.16    matt COMPILER_RT_ARCH_DIR=	${COMPILER_RT_SRCDIR}/lib/builtins/${LIBC_MACHINE_ARCH}
     11       1.1   joerg .endif
     12       1.1   joerg 
     13       1.1   joerg .PATH: ${COMPILER_RT_CPU_DIR}
     14       1.1   joerg .PATH: ${COMPILER_RT_ARCH_DIR}
     15      1.15   joerg .PATH: ${COMPILER_RT_SRCDIR}/lib/builtins
     16       1.4   joerg .PATH: ${COMPILER_RT_SRCDIR}/lib/profile
     17       1.1   joerg 
     18       1.1   joerg # Complex support needs parts of libm
     19       1.1   joerg #GENERIC_SRCS+=
     20       1.1   joerg #	mulxc3.c \
     21       1.1   joerg #	mulsc3.c \
     22       1.1   joerg #	divxc3.c \
     23       1.1   joerg #	divdc3.c \
     24       1.1   joerg #	divsc3.c
     25       1.1   joerg 
     26      1.21   joerg # Implemented on top of our atomic interface.
     27      1.21   joerg #GENERIC_SRCS+= atomic.c
     28       1.2   joerg 
     29      1.10   joerg .if ${HAVE_LIBGCC_EH} == "no"
     30       1.2   joerg GENERIC_SRCS+= \
     31       1.2   joerg 	gcc_personality_v0.c
     32       1.6   joerg .endif
     33       1.2   joerg 
     34      1.35  martin GENERIC_SRCS+= \
     35      1.35  martin 	absvsi2.c \
     36      1.35  martin 	absvti2.c \
     37      1.35  martin 	addvsi3.c \
     38      1.35  martin 	addvti3.c \
     39      1.35  martin 	ashlti3.c \
     40      1.35  martin 	ashrti3.c \
     41      1.35  martin 	clzti2.c \
     42      1.35  martin 	cmpti2.c \
     43      1.35  martin 	ctzti2.c \
     44      1.35  martin 	divti3.c \
     45      1.35  martin 	ffsti2.c \
     46      1.35  martin 	fixsfdi.c \
     47      1.35  martin 	fixdfdi.c \
     48      1.35  martin 	fixunsdfdi.c \
     49      1.35  martin 	fixunsdfsi.c \
     50      1.35  martin 	fixunssfdi.c \
     51      1.35  martin 	fixunssfsi.c \
     52      1.35  martin 	fixunsxfdi.c \
     53      1.35  martin 	fixunsxfsi.c \
     54      1.35  martin 	int_util.c \
     55      1.35  martin 	lshrti3.c \
     56      1.35  martin 	modti3.c \
     57      1.35  martin 	muldc3.c \
     58      1.35  martin 	mulosi4.c \
     59      1.35  martin 	muloti4.c \
     60      1.35  martin 	multi3.c \
     61      1.35  martin 	mulvsi3.c \
     62      1.35  martin 	mulvti3.c \
     63      1.35  martin 	negti2.c \
     64      1.35  martin 	negvsi2.c \
     65      1.35  martin 	negvti2.c \
     66      1.35  martin 	paritysi2.c \
     67      1.35  martin 	parityti2.c \
     68      1.35  martin 	popcountsi2.c \
     69      1.35  martin 	popcountti2.c \
     70      1.35  martin 	subvsi3.c \
     71      1.35  martin 	subvti3.c \
     72      1.35  martin 	ucmpti2.c \
     73      1.35  martin 	udivmodti4.c \
     74      1.35  martin 	udivti3.c \
     75      1.35  martin 	umodti3.c
     76      1.35  martin 
     77      1.35  martin # only used for machines using IEEE 754 floating point formats
     78      1.35  martin .if ${MACHINE_ARCH} != "vax"
     79      1.35  martin 
     80       1.8   joerg .if 0
     81       1.2   joerg # Conflicts with soft-float
     82       1.2   joerg GENERIC_SRCS+= \
     83       1.2   joerg 	comparedf2.c \
     84       1.3   joerg 	comparesf2.c \
     85       1.3   joerg 	adddf3.c \
     86       1.3   joerg 	addsf3.c \
     87      1.23   joerg 	addtf3.c \
     88       1.3   joerg 	divdf3.c \
     89       1.3   joerg 	divsf3.c \
     90      1.23   joerg 	divtf3.c \
     91       1.3   joerg 	extendsfdf2.c \
     92      1.23   joerg 	extendsftf2.c \
     93      1.23   joerg 	extenddftf2.c \
     94      1.11   joerg 	fixdfsi.c \
     95       1.3   joerg 	fixdfti.c \
     96       1.3   joerg 	fixsfsi.c \
     97       1.3   joerg 	fixsfti.c \
     98       1.3   joerg 	floatsidf.c \
     99       1.3   joerg 	floatsisf.c \
    100       1.7   joerg 	floatunsidf.c \
    101       1.7   joerg 	floatunsisf.c \
    102       1.3   joerg 	muldf3.c \
    103       1.3   joerg 	mulsf3.c \
    104      1.23   joerg 	multf3.c \
    105       1.3   joerg 	subdf3.c \
    106       1.3   joerg 	subsf3.c \
    107      1.23   joerg 	subtf3.c \
    108      1.23   joerg 	truncdfsf2.c \
    109      1.23   joerg 	trunctfdf2.c \
    110      1.23   joerg 	trunctfsf2.c
    111       1.2   joerg .endif
    112       1.2   joerg 
    113      1.35  martin GENERIC_SRCS+=	\
    114       1.1   joerg 	floatdidf.c \
    115       1.1   joerg 	floatdisf.c \
    116       1.1   joerg 	floatdixf.c \
    117       1.1   joerg 	floatundidf.c \
    118       1.1   joerg 	floatundisf.c \
    119       1.1   joerg 	floatundixf.c \
    120       1.1   joerg 	negdf2.c \
    121       1.1   joerg 	negsf2.c \
    122       1.1   joerg 	powidf2.c \
    123       1.1   joerg 	powisf2.c \
    124       1.1   joerg 	powitf2.c \
    125      1.35  martin 	powixf2.c
    126      1.35  martin 
    127      1.35  martin .endif # IEEE 754 only machines
    128       1.1   joerg 
    129      1.31  martin .if ${MACHINE_ARCH} != "m68k"
    130      1.31  martin GENERIC_SRCS+= \
    131      1.31  martin 	fixxfdi.c
    132      1.31  martin .endif
    133      1.31  martin 
    134      1.31  martin 
    135      1.22    matt .if ${MACHINE_ARCH} != "aarch64"
    136      1.22    matt GENERIC_SRCS+= \
    137      1.22    matt 	fixunsdfti.c \
    138      1.22    matt 	fixunssfti.c \
    139      1.22    matt 	fixunsxfti.c \
    140      1.22    matt 	fixxfti.c \
    141      1.22    matt 	floattidf.c \
    142      1.22    matt 	floattisf.c \
    143      1.22    matt 	floattixf.c \
    144      1.22    matt 	floatuntidf.c \
    145      1.22    matt 	floatuntisf.c \
    146      1.22    matt 	floatuntixf.c
    147  1.35.4.2  martin .else
    148  1.35.4.2  martin GENERIC_SRCS+= \
    149  1.35.4.2  martin 	comparetf2.c
    150      1.22    matt .endif
    151      1.22    matt 
    152      1.22    matt # These have h/w instructions which are always used.
    153      1.27    matt .if ${LIBC_MACHINE_ARCH} != "alpha" && ${LIBC_MACHINE_CPU} != "aarch64" \
    154      1.27    matt     && ${LIBC_MACHINE_CPU} != "powerpc" && ${LIBC_MACHINE_CPU} != "or1k"
    155      1.26    matt GENERIC_SRCS+= \
    156      1.26    matt 	clzsi2.c
    157      1.26    matt .endif
    158      1.26    matt 
    159      1.26    matt # These have h/w instructions which are always used.
    160      1.27    matt .if ${LIBC_MACHINE_ARCH} != "alpha" && ${LIBC_MACHINE_ARCH} != "vax" \
    161      1.27    matt     && ${LIBC_MACHINE_CPU} != "aarch64" && ${LIBC_MACHINE_CPU} != "powerpc" \
    162      1.27    matt     && ${LIBC_MACHINE_CPU} != "or1k"
    163      1.27    matt GENERIC_SRCS+= \
    164      1.27    matt 	ctzsi2.c
    165      1.27    matt .endif
    166      1.27    matt 
    167      1.27    matt # These have h/w instructions which are always used.
    168      1.26    matt .if ${LIBC_MACHINE_ARCH} != "alpha" && ${LIBC_MACHINE_CPU} != "powerpc" \
    169      1.24    matt     && ${LIBC_MACHINE_CPU} != "aarch64" && ${LIBC_MACHINE_ARCH} != "vax"
    170      1.22    matt GENERIC_SRCS+= \
    171      1.22    matt 	divmodsi4.c \
    172      1.22    matt 	divsi3.c \
    173      1.22    matt 	udivmodsi4.c \
    174  1.35.4.1  martin 
    175  1.35.4.1  martin . if ${LIBC_MACHINE_ARCH} != "m68000"
    176  1.35.4.1  martin # Our __{,u}modsi3 codes assume that __udivsi3 returns remainder to
    177  1.35.4.1  martin # %d1 (volatile register). __udivsi3 in libgcc does not, and therefore
    178  1.35.4.1  martin # mixing them up results in mess.
    179  1.35.4.1  martin GENERIC_SRCS+= \
    180  1.35.4.1  martin 	modsi3.c \
    181      1.22    matt 	umodsi3.c
    182  1.35.4.1  martin . endif
    183      1.22    matt 
    184      1.24    matt . if ${LIBC_MACHINE_CPU} != "sh3"
    185      1.17     uwe # On sh3 __udivsi3 is gcc "millicode" with special calling convention
    186      1.17     uwe # (less registers clobbered than usual).  Each DSO that needs it gets
    187      1.17     uwe # its own hidden copy from libgcc.a.
    188      1.17     uwe GENERIC_SRCS+= \
    189      1.17     uwe 	udivsi3.c
    190      1.22    matt . endif
    191      1.17     uwe .endif
    192      1.17     uwe 
    193      1.22    matt 
    194       1.4   joerg GENERIC_SRCS+= \
    195       1.5    matt 	absvdi2.c \
    196       1.5    matt 	addvdi3.c \
    197       1.5    matt 	mulodi4.c \
    198       1.5    matt 	mulvdi3.c \
    199       1.5    matt 	negvdi2.c \
    200       1.5    matt 	paritydi2.c \
    201       1.5    matt 	popcountdi2.c \
    202       1.5    matt 	subvdi3.c
    203       1.5    matt 
    204      1.22    matt # These have h/w instructions which are always used.
    205      1.24    matt .if ${LIBC_MACHINE_ARCH} != "alpha" && ${LIBC_MACHINE_CPU} != "powerpc64" \
    206      1.27    matt     && ${LIBC_MACHINE_ARCH} != "aarch64" && ${LIBC_MACHINE_CPU} != "or1k"
    207      1.22    matt GENERIC_SRCS+= \
    208      1.22    matt 	clzdi2.c \
    209      1.22    matt 	ctzdi2.c \
    210      1.22    matt 	ffsdi2.c
    211      1.22    matt .endif
    212      1.22    matt 
    213      1.22    matt # Don't need these on 64-bit machines.
    214      1.12   joerg .if empty(LIBC_MACHINE_ARCH:M*64*) && ${LIBC_MACHINE_ARCH} != "alpha"
    215       1.5    matt GENERIC_SRCS+= \
    216       1.5    matt 	cmpdi2.c \
    217       1.5    matt 	ashldi3.c \
    218       1.5    matt 	ashrdi3.c \
    219       1.5    matt 	divdi3.c \
    220       1.5    matt 	divmoddi4.c \
    221       1.5    matt 	lshrdi3.c \
    222       1.5    matt 	moddi3.c \
    223       1.5    matt 	muldi3.c \
    224       1.5    matt 	negdi2.c \
    225       1.5    matt 	ucmpdi2.c \
    226       1.5    matt 	udivdi3.c \
    227       1.5    matt 	udivmoddi4.c \
    228       1.5    matt 	umoddi3.c
    229       1.5    matt .endif
    230       1.5    matt 
    231       1.5    matt GENERIC_SRCS+= \
    232       1.4   joerg 	GCDAProfiling.c \
    233      1.18   joerg 	InstrProfiling.c \
    234      1.18   joerg 	InstrProfilingBuffer.c \
    235      1.18   joerg 	InstrProfilingFile.c \
    236      1.28   joerg 	InstrProfilingPlatformLinux.c \
    237      1.28   joerg 	InstrProfilingUtil.c \
    238      1.28   joerg 	InstrProfilingValue.c \
    239      1.28   joerg 	InstrProfilingWriter.c
    240      1.28   joerg 
    241      1.29    adam .if ${MKPROFILE} != "no"
    242      1.28   joerg POBJS+= InstrProfilingRuntime.po
    243      1.29    adam .endif
    244       1.4   joerg 
    245      1.25   joerg .if ${LIBC_MACHINE_ARCH} == "powerpc" || ${LIBC_MACHINE_ARCH} == "powerpc64"
    246       1.1   joerg GENERIC_SRCS+= \
    247       1.1   joerg 	fixtfdi.c \
    248       1.1   joerg 	fixunstfdi.c \
    249       1.1   joerg 	floatditf.c \
    250       1.1   joerg 	floatunditf.c \
    251       1.1   joerg 	gcc_qadd.c \
    252       1.1   joerg 	gcc_qdiv.c \
    253       1.1   joerg 	gcc_qmul.c \
    254       1.1   joerg 	gcc_qsub.c
    255       1.1   joerg .endif
    256       1.1   joerg 
    257      1.24    matt .if ${LIBC_MACHINE_CPU} == "aarch64"
    258      1.22    matt GENERIC_SRCS+= \
    259      1.22    matt 	clear_cache.c
    260      1.22    matt .endif
    261      1.22    matt 
    262      1.34   joerg .if ${LIBC_MACHINE_ARCH} == "powerpc" || ${LIBC_MACHINE_ARCH} == "powerpc64"
    263      1.34   joerg GENERIC_SRCS+= \
    264      1.34   joerg 	clear_cache.c
    265      1.34   joerg .endif
    266      1.34   joerg 
    267      1.33   joerg .if ${LIBC_MACHINE_ARCH} == "sparc" || ${LIBC_MACHINE_ARCH} == "sparc64"
    268      1.32   joerg GENERIC_SRCS+= \
    269      1.32   joerg 	clear_cache.c
    270      1.32   joerg .endif
    271      1.32   joerg 
    272      1.24    matt .if ${LIBC_MACHINE_CPU} == "arm"
    273       1.2   joerg .if !empty(LIBC_MACHINE_ARCH:Mearm*)
    274       1.2   joerg GENERIC_SRCS+= \
    275       1.2   joerg 	aeabi_idivmod.S \
    276       1.2   joerg 	aeabi_ldivmod.S \
    277       1.2   joerg 	aeabi_uidivmod.S \
    278       1.2   joerg 	aeabi_uldivmod.S
    279       1.2   joerg .endif
    280      1.13   joerg GENERIC_SRCS+= \
    281      1.13   joerg 	clear_cache.c
    282       1.9   joerg # Not yet, overlaps with softfloat
    283       1.9   joerg #	aeabi_dcmp.S \
    284       1.9   joerg #	aeabi_fcmp.S
    285       1.3   joerg # Not yet, requires ARMv6
    286       1.3   joerg #GENERIC_SRCS+= \
    287       1.3   joerg #	bswapdi2.S \
    288       1.3   joerg #	bswapsi2.S
    289       1.2   joerg .endif
    290       1.2   joerg 
    291       1.1   joerg .for src in ${GENERIC_SRCS}
    292       1.1   joerg .  if exists(${COMPILER_RT_CPU_DIR}/${src:R}.S) || \
    293       1.1   joerg       exists(${COMPILER_RT_ARCH_DIR}/${src:R}.S)
    294       1.1   joerg SRCS+=	${src:R}.S
    295       1.1   joerg .  else
    296       1.1   joerg SRCS+=	${src}
    297      1.19   joerg .    if ${src:E} != "cc"
    298       1.2   joerg COPTS.${src}+=	-Wno-missing-prototypes \
    299       1.2   joerg 		-Wno-old-style-definition \
    300       1.2   joerg 		-Wno-strict-prototypes \
    301      1.20   joerg 		-Wno-uninitialized \
    302      1.20   joerg 		-Wno-cast-qual
    303      1.19   joerg .    endif
    304       1.1   joerg .  endif
    305      1.30  martin .if ${MKSOFTFLOAT:Uno} != "no"
    306      1.30  martin COPTS.${src}+=	-D__SOFT_FP__
    307      1.30  martin .endif
    308       1.1   joerg .endfor
    309