1set(TARGET_LIBC_ENTRYPOINTS
2    # ctype.h entrypoints
3    libc.src.ctype.isalnum
4    libc.src.ctype.isalpha
5    libc.src.ctype.isascii
6    libc.src.ctype.isblank
7    libc.src.ctype.iscntrl
8    libc.src.ctype.isdigit
9    libc.src.ctype.isgraph
10    libc.src.ctype.islower
11    libc.src.ctype.isprint
12    libc.src.ctype.ispunct
13    libc.src.ctype.isspace
14    libc.src.ctype.isupper
15    libc.src.ctype.isxdigit
16    libc.src.ctype.toascii
17    libc.src.ctype.tolower
18    libc.src.ctype.toupper
19
20    # fcntl.h entrypoints
21    libc.src.fcntl.creat
22    libc.src.fcntl.open
23    libc.src.fcntl.openat
24
25    # string.h entrypoints
26    libc.src.string.bcmp
27    libc.src.string.bzero
28    libc.src.string.memccpy
29    libc.src.string.memchr
30    libc.src.string.memcmp
31    libc.src.string.memcpy
32    libc.src.string.memmove
33    libc.src.string.mempcpy
34    libc.src.string.memrchr
35    libc.src.string.memset
36    libc.src.string.stpcpy
37    libc.src.string.stpncpy
38    libc.src.string.strcat
39    libc.src.string.strchr
40    libc.src.string.strcmp
41    libc.src.string.strcpy
42    libc.src.string.strcspn
43    libc.src.string.strlcat
44    libc.src.string.strlcpy
45    libc.src.string.strlen
46    libc.src.string.strncat
47    libc.src.string.strncmp
48    libc.src.string.strncpy
49    libc.src.string.strnlen
50    libc.src.string.strpbrk
51    libc.src.string.strrchr
52    libc.src.string.strspn
53    libc.src.string.strstr
54    libc.src.string.strtok
55    libc.src.string.strtok_r
56
57    # string.h entrypoints that depend on malloc
58    libc.src.string.strdup
59    libc.src.string.strndup
60
61    # inttypes.h entrypoints
62    libc.src.inttypes.imaxabs
63    libc.src.inttypes.imaxdiv
64    libc.src.inttypes.strtoimax
65    libc.src.inttypes.strtoumax
66
67    # stdlib.h entrypoints
68    libc.src.stdlib.abs
69    libc.src.stdlib.atoi
70    libc.src.stdlib.atof
71    libc.src.stdlib.atol
72    libc.src.stdlib.atoll
73    libc.src.stdlib.bsearch
74    libc.src.stdlib.div
75    libc.src.stdlib.labs
76    libc.src.stdlib.ldiv
77    libc.src.stdlib.llabs
78    libc.src.stdlib.lldiv
79    libc.src.stdlib.qsort
80    libc.src.stdlib.strtod
81    libc.src.stdlib.strtof
82    libc.src.stdlib.strtol
83    libc.src.stdlib.strtold
84    libc.src.stdlib.strtoll
85    libc.src.stdlib.strtoul
86    libc.src.stdlib.strtoull
87
88    # stdlib.h external entrypoints
89    libc.src.stdlib.malloc
90    libc.src.stdlib.calloc
91    libc.src.stdlib.realloc
92    libc.src.stdlib.free
93
94    # sys/stat.h entrypoints
95    libc.src.sys.stat.mkdir
96    libc.src.sys.stat.mkdirat
97
98    # unistd.h entrypoints
99    libc.src.unistd.close
100    libc.src.unistd.fsync
101    libc.src.unistd.lseek
102    libc.src.unistd.read
103    libc.src.unistd.rmdir
104    libc.src.unistd.unlink
105    libc.src.unistd.unlinkat
106    libc.src.unistd.write
107)
108
109set(TARGET_LIBM_ENTRYPOINTS
110    # fenv.h entrypoints
111    libc.src.fenv.feclearexcept
112    libc.src.fenv.fedisableexcept
113    libc.src.fenv.feenableexcept
114    libc.src.fenv.fegetenv
115    libc.src.fenv.fegetexcept
116    libc.src.fenv.fegetexceptflag
117    libc.src.fenv.fegetround
118    libc.src.fenv.feholdexcept
119    libc.src.fenv.fesetenv
120    libc.src.fenv.fesetexceptflag
121    libc.src.fenv.fesetround
122    libc.src.fenv.feraiseexcept
123    libc.src.fenv.fetestexcept
124    libc.src.fenv.feupdateenv
125
126    # math.h entrypoints
127    libc.src.math.copysign
128    libc.src.math.copysignf
129    libc.src.math.copysignl
130    libc.src.math.ceil
131    libc.src.math.ceilf
132    libc.src.math.ceill
133    libc.src.math.cosf
134    libc.src.math.expf
135    libc.src.math.exp2f
136    libc.src.math.expm1f
137    libc.src.math.fabs
138    libc.src.math.fabsf
139    libc.src.math.fabsl
140    libc.src.math.fdim
141    libc.src.math.fdimf
142    libc.src.math.fdiml
143    libc.src.math.floor
144    libc.src.math.floorf
145    libc.src.math.floorl
146    libc.src.math.fma
147    libc.src.math.fmaf
148    libc.src.math.fmax
149    libc.src.math.fmaxf
150    libc.src.math.fmaxl
151    libc.src.math.fmin
152    libc.src.math.fminf
153    libc.src.math.fminl
154    libc.src.math.fmod
155    libc.src.math.fmodf
156    libc.src.math.frexp
157    libc.src.math.frexpf
158    libc.src.math.frexpl
159    libc.src.math.hypot
160    libc.src.math.hypotf
161    libc.src.math.ilogb
162    libc.src.math.ilogbf
163    libc.src.math.ilogbl
164    libc.src.math.llrint
165    libc.src.math.llrintf
166    libc.src.math.llrintl
167    libc.src.math.llround
168    libc.src.math.llroundf
169    libc.src.math.llroundl
170    libc.src.math.lrint
171    libc.src.math.lrintf
172    libc.src.math.lrintl
173    libc.src.math.lround
174    libc.src.math.lroundf
175    libc.src.math.lroundl
176    libc.src.math.ldexp
177    libc.src.math.ldexpf
178    libc.src.math.ldexpl
179    libc.src.math.log10f
180    libc.src.math.log1pf
181    libc.src.math.log2f
182    libc.src.math.logf
183    libc.src.math.logb
184    libc.src.math.logbf
185    libc.src.math.logbl
186    libc.src.math.modf
187    libc.src.math.modff
188    libc.src.math.modfl
189    libc.src.math.nearbyint
190    libc.src.math.nearbyintf
191    libc.src.math.nearbyintl
192    libc.src.math.nextafter
193    libc.src.math.nextafterf
194    libc.src.math.nextafterl
195    libc.src.math.remainderf
196    libc.src.math.remainder
197    libc.src.math.remainderl
198    libc.src.math.remquof
199    libc.src.math.remquo
200    libc.src.math.remquol
201    libc.src.math.rint
202    libc.src.math.rintf
203    libc.src.math.rintl
204    libc.src.math.round
205    libc.src.math.roundf
206    libc.src.math.roundl
207    libc.src.math.sincosf
208    libc.src.math.sinf
209    libc.src.math.sqrt
210    libc.src.math.sqrtf
211    libc.src.math.sqrtl
212    libc.src.math.trunc
213    libc.src.math.truncf
214    libc.src.math.truncl
215
216    # sys/mman.h entrypoints
217    libc.src.sys.mman.mmap
218    libc.src.sys.mman.munmap
219)
220
221if(LLVM_LIBC_FULL_BUILD)
222  list(APPEND TARGET_LIBC_ENTRYPOINTS
223    # stdio.h entrypoints
224    libc.src.stdio.clearerr
225    libc.src.stdio.clearerr_unlocked
226    libc.src.stdio.fclose
227    libc.src.stdio.flockfile
228    libc.src.stdio.feof
229    libc.src.stdio.feof_unlocked
230    libc.src.stdio.ferror
231    libc.src.stdio.ferror_unlocked
232    libc.src.stdio.fflush
233    libc.src.stdio.fopen
234    libc.src.stdio.fopencookie
235    libc.src.stdio.fread
236    libc.src.stdio.fread_unlocked
237    libc.src.stdio.fseek
238    libc.src.stdio.funlockfile
239    libc.src.stdio.fwrite
240    libc.src.stdio.fwrite_unlocked
241    libc.src.stdio.sprintf
242    libc.src.stdio.snprintf
243    libc.src.stdio.fprintf
244    libc.src.stdio.printf
245    libc.src.stdio.stderr
246    libc.src.stdio.stdout
247
248    # stdlib.h entrypoints
249    libc.src.stdlib._Exit
250    libc.src.stdlib.atexit
251    libc.src.stdlib.exit
252    libc.src.stdlib.getenv
253
254    # threads.h entrypoints
255    libc.src.threads.call_once
256    libc.src.threads.cnd_broadcast
257    libc.src.threads.cnd_destroy
258    libc.src.threads.cnd_init
259    libc.src.threads.cnd_signal
260    libc.src.threads.cnd_wait
261    libc.src.threads.mtx_destroy
262    libc.src.threads.mtx_init
263    libc.src.threads.mtx_lock
264    libc.src.threads.mtx_unlock
265    libc.src.threads.thrd_create
266    libc.src.threads.thrd_current
267    libc.src.threads.thrd_detach
268    libc.src.threads.thrd_equal
269    libc.src.threads.thrd_join
270
271    # pthread.h entrypoints
272    libc.src.pthread.pthread_attr_destroy
273    libc.src.pthread.pthread_attr_init
274    libc.src.pthread.pthread_attr_getdetachstate
275    libc.src.pthread.pthread_attr_getguardsize
276    libc.src.pthread.pthread_attr_getstack
277    libc.src.pthread.pthread_attr_getstacksize
278    libc.src.pthread.pthread_attr_setdetachstate
279    libc.src.pthread.pthread_attr_setguardsize
280    libc.src.pthread.pthread_attr_setstack
281    libc.src.pthread.pthread_attr_setstacksize
282    libc.src.pthread.pthread_create
283    libc.src.pthread.pthread_detach
284    libc.src.pthread.pthread_equal
285    libc.src.pthread.pthread_join
286    libc.src.pthread.pthread_self
287    libc.src.pthread.pthread_mutex_destroy
288    libc.src.pthread.pthread_mutex_init
289    libc.src.pthread.pthread_mutex_lock
290    libc.src.pthread.pthread_mutex_unlock
291    libc.src.pthread.pthread_mutexattr_destroy
292    libc.src.pthread.pthread_mutexattr_init
293    libc.src.pthread.pthread_mutexattr_getpshared
294    libc.src.pthread.pthread_mutexattr_getrobust
295    libc.src.pthread.pthread_mutexattr_gettype
296    libc.src.pthread.pthread_mutexattr_setpshared
297    libc.src.pthread.pthread_mutexattr_setrobust
298    libc.src.pthread.pthread_mutexattr_settype
299
300    # time.h entrypoints
301    libc.src.time.asctime
302    libc.src.time.asctime_r
303    libc.src.time.gmtime
304    libc.src.time.gmtime_r
305    libc.src.time.mktime
306  )
307endif()
308
309set(TARGET_LLVMLIBC_ENTRYPOINTS
310  ${TARGET_LIBC_ENTRYPOINTS}
311  ${TARGET_LIBM_ENTRYPOINTS}
312)
313