blob: 43d1b700ae5d8c73edb979999cd2bfb0045e9abf (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
|
# $NetBSD: Makefile.compiler-rt,v 1.13 2021/06/16 05:21:09 rin Exp $
COMPILER_RT_DIR= ${NETBSDSRCDIR}/sys/external/bsd/compiler_rt
COMPILER_RT_SRCDIR= ${COMPILER_RT_DIR}/dist
.if ${MACHINE_ARCH} == "powerpc"
COMPILER_RT_CPU_DIR= ${COMPILER_RT_SRCDIR}/lib/builtins/ppc
COMPILER_RT_ARCH_DIR= ${COMPILER_RT_SRCDIR}/lib/builtins/ppc
.else
COMPILER_RT_CPU_DIR= ${COMPILER_RT_SRCDIR}/lib/builtins/${MACHINE_CPU}
COMPILER_RT_ARCH_DIR= ${COMPILER_RT_SRCDIR}/lib/builtins/${MACHINE_ARCH}
.endif
.PATH: ${COMPILER_RT_CPU_DIR}
.PATH: ${COMPILER_RT_ARCH_DIR}
.PATH: ${COMPILER_RT_SRCDIR}/lib/builtins
GENERIC_SRCS+= \
absvdi2.c \
absvsi2.c \
absvti2.c \
addvdi3.c \
addvsi3.c \
addvti3.c \
ashlti3.c \
ashrti3.c \
clzti2.c \
cmpti2.c \
ctzti2.c \
divti3.c \
ffsti2.c \
int_util.c \
lshrti3.c \
modti3.c \
mulodi4.c \
mulosi4.c \
muloti4.c \
multi3.c \
mulvdi3.c \
mulvsi3.c \
mulvti3.c \
negti2.c \
negvdi2.c \
negvsi2.c \
negvti2.c \
paritydi2.c \
paritysi2.c \
parityti2.c \
popcountdi2.c \
popcountsi2.c \
popcountti2.c \
subvdi3.c \
subvsi3.c \
subvti3.c \
ucmpti2.c \
udivmodti4.c \
udivti3.c \
umodti3.c
.if ${MACHINE_CPU} != "aarch64" && ${MACHINE} != "alpha"
GENERIC_SRCS+= \
clzsi2.c \
ctzsi2.c
.endif
.if ${MACHINE_CPU} != "aarch64" && ${MACHINE} != "alpha" && \
${MACHINE_ARCH} != "m68k"
GENERIC_SRCS+= \
divmodsi4.c \
divsi3.c \
modsi3.c \
udivmodsi4.c \
udivsi3.c \
umodsi3.c
.endif
.if ${MACHINE_CPU} != "aarch64"
GENERIC_SRCS+= \
clzdi2.c \
ctzdi2.c \
ffsdi2.c
.endif
.if ${MACHINE_CPU} != "aarch64" && ${MACHINE} != "alpha"
GENERIC_SRCS+= \
ashldi3.c \
ashrdi3.c \
lshrdi3.c
.endif
.if ${MACHINE_CPU} != "aarch64" && ${MACHINE} != "alpha"
GENERIC_SRCS+= \
cmpdi2.c \
divdi3.c \
divmoddi4.c \
moddi3.c \
muldi3.c \
negdi2.c \
ucmpdi2.c \
udivdi3.c \
udivmoddi4.c \
umoddi3.c
.endif
.if ${MACHINE_CPU} == "arm"
. if !empty(MACHINE_ARCH:Mearm*)
GENERIC_SRCS+= \
aeabi_idivmod.S \
aeabi_ldivmod.S \
aeabi_uidivmod.S \
aeabi_uldivmod.S \
__aeabi_idiv0.c \
__aeabi_ldiv0.c
. endif
.endif
.for src in ${GENERIC_SRCS}
. if exists(${COMPILER_RT_CPU_DIR}/${src:R}.S) || \
exists(${COMPILER_RT_ARCH_DIR}/${src:R}.S)
SRCS+= ${src:R}.S
. else
SRCS+= ${src}
COPTS.${src}+= -Wno-missing-prototypes \
-Wno-old-style-definition \
-Wno-strict-prototypes \
-Wno-uninitialized
. endif
.endfor
CPPFLAGS.int_util.c+= -DKERNEL_USE
# XXX Explicit divide by zero in udivmoddi4.c -> abort().
.if defined(HAVE_GCC) && ${HAVE_GCC} >= 7 && ${ACTIVE_CC} == "gcc"
. if ${MACHINE_CPU} != "arm"
COPTS.udivmoddi4.c+= -fnon-call-exceptions
. endif
.endif
# XXX This makes no binary changes at the moment.
.include "${COMPILER_RT_DIR}/abi.mk"
|