Makefile.compiler-rt revision 1.8
11.8Smrg# $NetBSD: Makefile.compiler-rt,v 1.8 2019/02/07 10:44:54 mrg Exp $
21.1Sjoerg
31.1SjoergCOMPILER_RT_SRCDIR=	${NETBSDSRCDIR}/sys/external/bsd/compiler_rt/dist
41.1Sjoerg
51.1Sjoerg.if ${MACHINE_ARCH} == "powerpc"
61.4SjoergCOMPILER_RT_CPU_DIR=	${COMPILER_RT_SRCDIR}/lib/builtins/ppc
71.4SjoergCOMPILER_RT_ARCH_DIR=	${COMPILER_RT_SRCDIR}/lib/builtins/ppc
81.1Sjoerg.else
91.4SjoergCOMPILER_RT_CPU_DIR=	${COMPILER_RT_SRCDIR}/lib/builtins/${MACHINE_CPU}
101.4SjoergCOMPILER_RT_ARCH_DIR=	${COMPILER_RT_SRCDIR}/lib/builtins/${MACHINE_ARCH}
111.1Sjoerg.endif
121.1Sjoerg
131.1Sjoerg.PATH: ${COMPILER_RT_CPU_DIR}
141.1Sjoerg.PATH: ${COMPILER_RT_ARCH_DIR}
151.4Sjoerg.PATH: ${COMPILER_RT_SRCDIR}/lib/builtins
161.1Sjoerg
171.1SjoergGENERIC_SRCS+= \
181.1Sjoerg	absvdi2.c \
191.1Sjoerg	absvsi2.c \
201.1Sjoerg	absvti2.c \
211.1Sjoerg	addvdi3.c \
221.1Sjoerg	addvsi3.c \
231.1Sjoerg	addvti3.c \
241.1Sjoerg	ashlti3.c \
251.1Sjoerg	ashrti3.c \
261.1Sjoerg	clzti2.c \
271.1Sjoerg	cmpti2.c \
281.1Sjoerg	ctzti2.c \
291.1Sjoerg	divti3.c \
301.1Sjoerg	ffsti2.c \
311.1Sjoerg	int_util.c \
321.1Sjoerg	lshrti3.c \
331.1Sjoerg	modti3.c \
341.1Sjoerg	mulodi4.c \
351.1Sjoerg	mulosi4.c \
361.1Sjoerg	muloti4.c \
371.1Sjoerg	multi3.c \
381.1Sjoerg	mulvdi3.c \
391.1Sjoerg	mulvsi3.c \
401.1Sjoerg	mulvti3.c \
411.1Sjoerg	negti2.c \
421.1Sjoerg	negvdi2.c \
431.1Sjoerg	negvsi2.c \
441.1Sjoerg	negvti2.c \
451.1Sjoerg	paritydi2.c \
461.1Sjoerg	paritysi2.c \
471.1Sjoerg	parityti2.c \
481.1Sjoerg	popcountdi2.c \
491.1Sjoerg	popcountsi2.c \
501.1Sjoerg	popcountti2.c \
511.1Sjoerg	subvdi3.c \
521.1Sjoerg	subvsi3.c \
531.1Sjoerg	subvti3.c \
541.1Sjoerg	ucmpti2.c \
551.1Sjoerg	udivmodti4.c \
561.1Sjoerg	udivti3.c \
571.1Sjoerg	umodti3.c
581.1Sjoerg
591.5Smatt.if ${MACHINE_CPU} != "aarch64" && ${MACHINE} != "alpha"
601.5SmattGENERIC_SRCS+= \
611.5Smatt	clzsi2.c \
621.5Smatt	ctzsi2.c
631.5Smatt.endif
641.5Smatt
651.5Smatt.if ${MACHINE_CPU} != "aarch64" && ${MACHINE} != "alpha"
661.5SmattGENERIC_SRCS+= \
671.5Smatt	divmodsi4.c \
681.5Smatt	divsi3.c \
691.5Smatt	modsi3.c \
701.5Smatt	udivmodsi4.c \
711.5Smatt	udivsi3.c \
721.5Smatt	umodsi3.c
731.5Smatt.endif
741.5Smatt
751.5Smatt.if ${MACHINE_CPU} != "aarch64" && ${MACHINE} != "alpha"
761.5SmattGENERIC_SRCS+= \
771.5Smatt	clzdi2.c \
781.5Smatt	ctzdi2.c \
791.5Smatt	ffsdi2.c
801.5Smatt.endif
811.5Smatt
821.5Smatt.if ${MACHINE_CPU} != "aarch64" && ${MACHINE} != "alpha"
831.5SmattGENERIC_SRCS+= \
841.5Smatt	ashldi3.c \
851.5Smatt	ashrdi3.c \
861.5Smatt	lshrdi3.c
871.5Smatt.endif
881.5Smatt
891.5Smatt.if ${MACHINE_CPU} != "aarch64" && ${MACHINE} != "alpha"
901.5SmattGENERIC_SRCS+= \
911.5Smatt	cmpdi2.c \
921.5Smatt	divdi3.c \
931.5Smatt	divmoddi4.c \
941.5Smatt	moddi3.c \
951.5Smatt	muldi3.c \
961.5Smatt	negdi2.c \
971.5Smatt	ucmpdi2.c \
981.5Smatt	udivdi3.c \
991.5Smatt	udivmoddi4.c \
1001.5Smatt	umoddi3.c
1011.5Smatt.endif
1021.5Smatt
1031.1Sjoerg.if ${MACHINE_CPU} == "arm"
1041.2Sjoerg.  if !empty(MACHINE_ARCH:Mearm*)
1051.1SjoergGENERIC_SRCS+= \
1061.1Sjoerg	aeabi_idivmod.S \
1071.1Sjoerg	aeabi_ldivmod.S \
1081.1Sjoerg	aeabi_uidivmod.S \
1091.3Sjoerg	aeabi_uldivmod.S \
1101.3Sjoerg	__aeabi_idiv0.c \
1111.3Sjoerg	__aeabi_ldiv0.c
1121.1Sjoerg.  endif
1131.1Sjoerg.endif
1141.1Sjoerg
1151.1Sjoerg.for src in ${GENERIC_SRCS}
1161.1Sjoerg.  if exists(${COMPILER_RT_CPU_DIR}/${src:R}.S) || \
1171.1Sjoerg      exists(${COMPILER_RT_ARCH_DIR}/${src:R}.S)
1181.1SjoergSRCS+=	${src:R}.S
1191.1Sjoerg.  else
1201.1SjoergSRCS+=	${src}
1211.1SjoergCOPTS.${src}+=	-Wno-missing-prototypes \
1221.1Sjoerg		-Wno-old-style-definition \
1231.1Sjoerg		-Wno-strict-prototypes \
1241.1Sjoerg		-Wno-uninitialized
1251.1Sjoerg.  endif
1261.1Sjoerg.endfor
1271.1Sjoerg
1281.1SjoergCPPFLAGS.int_util.c+=	-DKERNEL_USE
1291.6Smrg
1301.6Smrg# XXX Explicit divide by zero in udivmoddi4.c -> abort().
1311.6Smrg.if defined(HAVE_GCC) && ${HAVE_GCC} == 7 && ${ACTIVE_CC} == "gcc"
1321.8Smrg. if ${MACHINE_CPU} != "arm"
1331.6SmrgCOPTS.udivmoddi4.c+=	-fnon-call-exceptions
1341.8Smrg. endif
1351.6Smrg.endif
136