Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemathinc
GitHub Repository: sagemathinc/wapython
Path: blob/main/core/dylink/src/libc.ts
1067 views
1
/*
2
Create a .c file that exports a function that returns a pointer to
3
all libc function. You must include this C code with any other code
4
you're compiling to build your main file if you want the dynamic
5
libraries you link to have access to libc.
6
7
This adds about 650KB to the wasm file (after stripping), which sucks,
8
but it is what it is.
9
*/
10
11
import wasmExport from "./wasm-export";
12
13
function main() {
14
let s = `
15
/* DO NOT EDIT: THIS CODE IS AUTOGENERATED. */
16
17
#define _WASI_EMULATED_MMAN
18
#define _WASI_EMULATED_SIGNAL
19
#define _WASI_EMULATED_PROCESS_CLOCKS
20
#define _WASI_EMULATED_GETPID
21
#define _GNU_SOURCE
22
`;
23
24
for (const header of headers.split("\n")) {
25
if (!header.trim()) continue;
26
s += `#include<${header}>\n`;
27
}
28
29
// Some symbols aren't declared in headers that you can import without
30
// causing trouble, but are still built, so we declare them here:
31
// They aren't declared in the headers due to
32
// #ifdef __wasilibc_unmodified_upstream or #ifdef _GNU_SOURCE
33
// Some (like iprintf) are just due to weak_alias.
34
35
s += `
36
// Undeclared things that do exist in libc-wasi-zig:
37
38
char *ecvt(double, int, int *, int *);
39
char *fcvt(double, int, int *, int *);
40
char *gcvt(double, int, char *);
41
char *secure_getenv(const char *);
42
double exp10(double);
43
float exp10f(float);
44
long double exp10l(long double);
45
void sincos(double, double*, double*);
46
void sincosf(float, float*, float*);
47
void sincosl(long double, long double*, long double*);
48
double pow10(double);
49
float pow10f(float);
50
long double pow10l(long double);
51
int getdomainname(char *, size_t);
52
void *memmem(const void *, size_t, const void *, size_t);
53
char *strcasestr(const char *, const char *);
54
int strverscmp (const char *, const char *);
55
void tdestroy(void *, void (*)(void *));
56
int versionsort(const struct dirent **, const struct dirent **);
57
int iprintf(const char *__restrict, ...);
58
int __small_printf(const char *__restrict, ...);
59
extern char **environ;
60
extern char **_environ;
61
char *fgets_unlocked(char *, int, FILE *);
62
int fputs_unlocked(const char *, FILE *);
63
wint_t fgetwc_unlocked (FILE *);
64
wchar_t *fgetws_unlocked (wchar_t *__restrict, int, FILE *__restrict);
65
int fpurge(FILE *);
66
void *memrchr(const void *, int, size_t);
67
wint_t fputwc_unlocked (wchar_t, FILE *);
68
int fputws_unlocked (const wchar_t *__restrict, FILE *__restrict);
69
wint_t getwc_unlocked (FILE *);
70
wint_t getwchar_unlocked (void);
71
int hcreate_r(size_t, struct hsearch_data *);
72
void hdestroy_r(struct hsearch_data *);
73
int hsearch_r(ENTRY, ACTION, ENTRY **, struct hsearch_data *);
74
long double lgammal_r(long double, int*);
75
extern char *program_invocation_short_name, *program_invocation_name;
76
wint_t putwc_unlocked (wchar_t, FILE *);
77
wint_t putwchar_unlocked (wchar_t);
78
void qsort_r(void *base, size_t nmemb, size_t size,
79
int (*compar)(const void *, const void *, void *),
80
void *arg);
81
void __qsort_r(void *base, size_t nmemb, size_t size,
82
int (*compar)(const void *, const void *, void *),
83
void *arg);
84
char *strchrnul(const char *, int);
85
extern char *__wasilibc_cwd;
86
extern char **__wasilibc_environ;
87
88
extern int __stack_chk_guard;
89
void __stack_chk_fail(void);
90
91
92
void *mempcpy(void *, const void *, size_t);
93
94
int mkstemp(char *template);
95
int mkstemps(char *template, int suffixlen);
96
void __SIG_IGN(int);
97
double __extenddftf2(long double);
98
// lib/compiler_rt/trunctfdf2.zig:pub fn __trunctfdf2(a: f128) callconv(.C) f64
99
double __trunctfdf2(long double);
100
// lib/compiler_rt/multf3.zig:pub fn __multf3(a: f128, b: f128) callconv(.C) f128 {
101
long double __multf3(long double a, long double b);
102
// lib/compiler_rt/addtf3.zig:pub fn __addtf3(a: f128, b: f128) callconv(.C) f128 {
103
long double __addtf3(long double a, long double b);
104
// lib/compiler_rt/shift.zig
105
long double __ashlti3(long double, int);
106
// lib/compiler_rt/getf2.zig:fn __gttf2(a: f128, b: f128) callconv(.C) i32 {
107
int __gttf2(long double a, long double b);
108
// lib/compiler_rt/getf2.zig:fn __getf2(a: f128, b: f128) callconv(.C) i32 {
109
int __getf2(long double, long double);
110
// lib/compiler_rt/divtf3.zig:pub fn __divtf3(a: f128, b: f128) callconv(.C) f128 {
111
long double __divtf3(long double, long double);
112
// lib/compiler_rt/cmptf2.zig:fn __lttf2(a: f128, b: f128) callconv(.C) i32 {
113
int __lttf2(long double, long double);
114
// lib/compiler_rt/fixtfsi.zig:pub fn __fixtfsi(a: f128) callconv(.C) i32 {
115
int __fixtfsi(long double);
116
// lib/compiler_rt/floatsitf.zig:pub fn __floatsitf(a: i32) callconv(.C) f128 {
117
long double __floatsitf(int);
118
// lib/compiler_rt/subtf3.zig:pub fn __subtf3(a: f128, b: f128) callconv(.C) f128 {
119
long double __subtf3(long double, long double);
120
// lib/compiler_rt/floatditf.zig:pub fn __floatditf(a: i64) callconv(.C) f128 {
121
long double __floatditf(double a);
122
// __unordtf2(a: f128, b: f128) callconv(.C) i32
123
int __unordtf2(long double, long double);
124
// fn __letf2(a: f128, b: f128) callconv(.C) i32
125
int __letf2(long double, long double);
126
// pub fn __trunctfsf2(a: f128) callconv(.C) f32
127
float __trunctfsf2(long double);
128
// pub fn __fixtfdi(a: f128) callconv(.C) i64
129
long __fixtfdi(long double);
130
// pub fn __floatunsitf(a: u32) callconv(.C) f128
131
long double __floatunsitf(unsigned int);
132
// pub fn __floatunditf(a: u64) callconv(.C) f128
133
long double __floatunditf(unsigned long);
134
// pub fn __extendsftf2(a: f32) callconv(.C) f128
135
long double __extendsftf2(float);
136
// fn __netf2(a: f128, b: f128) callconv(.C) i32
137
int __netf2(long double, long double);
138
// pub fn __fixunstfsi(a: f128) callconv(.C) u32
139
unsigned int __fixunstfsi(long double);
140
// pub fn __fixunstfdi(a: f128) callconv(.C) u64
141
unsigned long __fixunstfdi(long double);
142
// fn __eqtf2(a: f128, b: f128) callconv(.C) i32
143
int __eqtf2(long double,long double);
144
145
// pub fn __multi3(a: i128, b: i128) callconv(.C) i128
146
long long __multi3(long long, long long);
147
148
// pub fn __udivti3(a: u128, b: u128) callconv(.C) u128
149
unsigned long long __udivti3(unsigned long long, unsigned long long);
150
151
// fn __eqtf2(a: f128, b: f128) callconv(.C) i32
152
int __eqtf2(long double, long double);
153
154
// pub fn __fixunstfdi(a: f128) callconv(.C) u64
155
unsigned long __fixunstfdi(long double);
156
157
// pub fn __fixunstfsi(a: f128) callconv(.C) u32
158
unsigned int __fixunstfsi(long double);
159
160
long double strtold_l(const char *__restrict, char **__restrict, struct __locale_struct *);
161
162
// TODO - move to posix-wasm, obviously...
163
extern const char *__progname;
164
const char *getprogname() { return __progname; }
165
void setprogname(const char *progname) {
166
int i;
167
for(i=strlen(progname)-1;i>=0 && progname[i] != '/';i--){}
168
__progname = progname+i+1;
169
}
170
171
void freeaddrinfo(struct addrinfo *res);
172
void _Py_CheckEmscriptenSignalsPeriodically();
173
void _Py_CheckEmscriptenSignals();
174
int emscripten_return_address(int);
175
176
// NULL for these two means "no info".
177
struct group *getgrgid(gid_t) { return NULL; }
178
struct group *getgrnam(const char *) { return NULL; }
179
180
// _Znwm is operator new.
181
// _ZdlPv is operator delete.
182
void _ZdlPv();
183
void _Znwm();
184
void __cxa_allocate_exception();
185
void _ZNSt20bad_array_new_lengthC1Ev();
186
void _ZNSt20bad_array_new_lengthD1Ev();
187
void _ZTISt20bad_array_new_length();
188
void __cxa_throw();
189
`;
190
s += "\n";
191
s += wasmExport((symbols + "\n" + posix).split("\n"));
192
s += "WASM_EXPORT(__stack_chk_guard, __stack_chk_guard);";
193
console.log(s);
194
}
195
196
// Extra things we added to our posix compat layer, since they are
197
// missing from wasi-zig-libc:
198
const posix = `
199
ngettext
200
dngettext
201
dcngettext
202
_Znwm
203
_ZdlPv
204
__cxa_allocate_exception
205
_ZNSt20bad_array_new_lengthC1Ev
206
_ZNSt20bad_array_new_lengthD1Ev
207
_ZTISt20bad_array_new_length
208
__cxa_throw
209
cowasm_fstat
210
cowasm_lstat
211
cowasm_stat
212
cowasm_fstatat
213
getgrgid
214
getgrnam
215
heapsort
216
mergesort
217
setmode
218
getmode
219
_Py_CheckEmscriptenSignalsPeriodically
220
_Py_CheckEmscriptenSignals
221
emscripten_return_address
222
fopencookie
223
tmpfile
224
strtold_l
225
__ashlti3
226
__fixunstfsi
227
__fixunstfdi
228
__eqtf2
229
__udivti3
230
__multi3
231
__letf2
232
__trunctfsf2
233
__fixtfdi
234
__floatunsitf
235
__floatunditf
236
__extendsftf2
237
__netf2
238
__fixunstfsi
239
__fixunstfdi
240
__eqtf2
241
__unordtf2
242
__floatditf
243
__floatsitf
244
__fixtfsi
245
__lttf2
246
__divtf3
247
__getf2
248
__gttf2
249
__subtf3
250
__multf3
251
__addtf3
252
__extenddftf2
253
__trunctfdf2
254
qsort
255
flockfile
256
ftrylockfile
257
funlockfile
258
freeaddrinfo
259
strsignal
260
__stack_chk_fail
261
secure_getenv
262
strunvis
263
strnvis
264
strvis
265
cfgetispeed
266
cfgetospeed
267
tcgetattr
268
tcsetattr
269
textdomain
270
gettext
271
dgettext
272
dcgettext
273
getpagesize
274
mkstemp
275
mkstemps
276
sigemptyset
277
bindtextdomain
278
mmap
279
munmap
280
geteuid
281
fchown
282
popen
283
pclose
284
getrusage
285
longjmp
286
setjmp
287
siglongjmp
288
sigsetjmp
289
`;
290
291
// All headers from zig/dist/lib/zig/libc/include/wasm-wasi-musl except signal/thread ones.
292
// Also, include our posix-wasm.h, which fills in declarations for things in posix that are
293
// missing from libc-wasi-zig.
294
const headers = `
295
posix-wasm.h
296
alloca.h
297
ar.h
298
arpa/telnet.h
299
arpa/ftp.h
300
arpa/inet.h
301
arpa/tftp.h
302
arpa/nameser.h
303
arpa/nameser_compat.h
304
assert.h
305
bits/ipcstat.h
306
bits/ioctl.h
307
bits/reg.h
308
bits/ioctl_fix.h
309
bits/float.h
310
bits/limits.h
311
bits/fcntl.h
312
bits/stat.h
313
bits/signal.h
314
bits/dirent.h
315
bits/mman.h
316
bits/io.h
317
bits/posix.h
318
bits/resource.h
319
bits/poll.h
320
bits/alltypes.h
321
bits/socket.h
322
bits/stdint.h
323
bits/hwcap.h
324
byteswap.h
325
complex.h
326
cpio.h
327
crypt.h
328
ctype.h
329
dirent.h
330
endian.h
331
err.h
332
errno.h
333
fcntl.h
334
features.h
335
fenv.h
336
float.h
337
fmtmsg.h
338
fnmatch.h
339
fts.h
340
ftw.h
341
getopt.h
342
glob.h
343
iconv.h
344
ifaddrs.h
345
inttypes.h
346
iso646.h
347
langinfo.h
348
libgen.h
349
libintl.h
350
limits.h
351
locale.h
352
malloc.h
353
math.h
354
memory.h
355
monetary.h
356
mqueue.h
357
netinet/tcp.h
358
netinet/ip_icmp.h
359
netinet/igmp.h
360
netinet/in.h
361
netinet/ip6.h
362
netinet/icmp6.h
363
netinet/ip.h
364
netinet/in_systm.h
365
netinet/udp.h
366
netpacket/packet.h
367
nl_types.h
368
poll.h
369
pthread.h
370
regex.h
371
sched.h
372
search.h
373
semaphore.h
374
spawn.h
375
stdalign.h
376
stdbool.h
377
stdc-predef.h
378
stdint.h
379
stdio.h
380
stdio_ext.h
381
stdlib.h
382
stdnoreturn.h
383
string.h
384
strings.h
385
stropts.h
386
syscall.h
387
sysexits.h
388
sys/time.h
389
sys/ioctl.h
390
sys/reg.h
391
sys/timeb.h
392
sys/uio.h
393
sys/types.h
394
sys/times.h
395
sys/eventfd.h
396
sys/sysinfo.h
397
sys/fcntl.h
398
sys/file.h
399
sys/stat.h
400
sys/mman.h
401
sys/stropts.h
402
sys/un.h
403
sys/utsname.h
404
sys/timex.h
405
sys/param.h
406
sys/ttydefaults.h
407
sys/resource.h
408
sys/errno.h
409
sys/poll.h
410
sys/syscall.h
411
sys/socket.h
412
sys/dir.h
413
sys/random.h
414
sys/select.h
415
tar.h
416
tgmath.h
417
time.h
418
uchar.h
419
unistd.h
420
utime.h
421
values.h
422
wasi/libc-environ.h
423
wasi/libc-find-relpath.h
424
wasi/libc-nocwd.h
425
wasi/api.h
426
wasi/libc.h
427
wchar.h
428
wctype.h
429
`;
430
431
// I copied libc.a by watching the output of zig build something targeting
432
// wasm-wasi with an empty cache. Then this gets ALL symbols that are defined
433
// in the wasm32-wasi library from clang/musl/zig that don't start with a double
434
// underscore or _IO_ (no clue what those are). The symbols ending in 64 seems
435
// to all be #defined to the non-64 ones, so we exclude those.
436
//
437
// nm -gU libc.a |grep -v : | awk '{print $3}' |sort|uniq |grep -v ^__ |grep -v ^_IO_ |grep -v 64$ > all-symbols.txt && nm -gU libc.a |grep -v : | awk '{print $3}' |sort|uniq |grep ^__wasi >> all-symbols.txt
438
//
439
// NOTE: I'm often finding that excluding symbols starting with dunder __ was a mistake,
440
// since they often pop up with new dynamic libraries, presumably since they are the
441
// targets of #define.
442
443
const symbols = `
444
pthread_attr_init
445
pthread_attr_destroy
446
pthread_attr_setstacksize
447
pthread_attr_getstacksize
448
pthread_cond_init
449
pthread_cond_destroy
450
pthread_cond_signal
451
pthread_condattr_init
452
pthread_condattr_setclock
453
pthread_getspecific
454
pthread_setspecific
455
pthread_key_create
456
pthread_key_delete
457
pthread_mutex_init
458
pthread_mutex_destroy
459
pthread_mutex_lock
460
pthread_mutex_unlock
461
pthread_mutex_trylock
462
pthread_self
463
pthread_create
464
pthread_detach
465
pthread_exit
466
pthread_cond_timedwait
467
pthread_cond_wait
468
pthread_getcpuclockid
469
fchmod
470
cfsetispeed
471
cfsetospeed
472
__assert_fail
473
sigaction
474
signal
475
__SIG_ERR
476
__SIG_IGN
477
__ctype_get_mb_cur_max
478
_CLOCK_MONOTONIC
479
_CLOCK_REALTIME
480
_CLOCK_PROCESS_CPUTIME_ID
481
_CLOCK_THREAD_CPUTIME_ID
482
_Exit
483
_environ
484
_exit
485
_flushlbf
486
a64l
487
abort
488
abs
489
access
490
acos
491
acosf
492
acosh
493
acoshf
494
acoshl
495
acosl
496
aligned_alloc
497
alphasort
498
arc4random
499
arc4random_buf
500
arc4random_uniform
501
asctime
502
asctime_r
503
asin
504
asinf
505
asinh
506
asinhf
507
asinhl
508
asinl
509
asprintf
510
at_quick_exit
511
atan
512
atan2
513
atan2f
514
atan2l
515
atanf
516
atanh
517
atanhf
518
atanhl
519
atanl
520
atexit
521
atof
522
atoi
523
atol
524
atoll
525
basename
526
bcmp
527
bcopy
528
bsearch
529
btowc
530
bzero
531
c16rtomb
532
c32rtomb
533
cabs
534
cabsf
535
cabsl
536
cacos
537
cacosf
538
cacosh
539
cacoshf
540
cacoshl
541
cacosl
542
calloc
543
carg
544
cargf
545
cargl
546
casin
547
casinf
548
casinh
549
casinhf
550
casinhl
551
casinl
552
catan
553
catanf
554
catanh
555
catanhf
556
catanhl
557
catanl
558
catclose
559
catgets
560
catopen
561
cbrt
562
cbrtf
563
cbrtl
564
ccos
565
ccosf
566
ccosh
567
ccoshf
568
ccoshl
569
ccosl
570
ceil
571
ceilf
572
ceill
573
cexp
574
cexpf
575
cexpl
576
chdir
577
cimag
578
cimagf
579
cimagl
580
clearenv
581
clearerr
582
clearerr_unlocked
583
clock
584
clock_getres
585
clock_gettime
586
clock_nanosleep
587
clog
588
clogf
589
clogl
590
close
591
closedir
592
confstr
593
conj
594
conjf
595
conjl
596
copysign
597
copysignf
598
copysignl
599
cos
600
cosf
601
cosh
602
coshf
603
coshl
604
cosl
605
cpow
606
cpowf
607
cpowl
608
cproj
609
cprojf
610
cprojl
611
creal
612
crealf
613
creall
614
creat
615
crypt
616
crypt_r
617
csin
618
csinf
619
csinh
620
csinhf
621
csinhl
622
csinl
623
csqrt
624
csqrtf
625
csqrtl
626
ctan
627
ctanf
628
ctanh
629
ctanhf
630
ctanhl
631
ctanl
632
ctime
633
ctime_r
634
difftime
635
dirfd
636
dirname
637
div
638
dprintf
639
drand48
640
drem
641
dremf
642
duplocale
643
ecvt
644
encrypt
645
environ
646
erand48
647
erf
648
erfc
649
erfcf
650
erfcl
651
erff
652
erfl
653
err
654
errx
655
verr
656
verrx
657
errno
658
exit
659
exp
660
exp10
661
exp10f
662
exp10l
663
exp2
664
exp2f
665
exp2l
666
expf
667
expl
668
explicit_bzero
669
expm1
670
expm1f
671
expm1l
672
fabs
673
fabsf
674
fabsl
675
faccessat
676
fclose
677
fcntl
678
fcvt
679
fdatasync
680
fdclosedir
681
fdim
682
fdimf
683
fdiml
684
fdopen
685
fdopendir
686
feclearexcept
687
fegetenv
688
fegetexceptflag
689
fegetround
690
feholdexcept
691
feof
692
feof_unlocked
693
feraiseexcept
694
ferror
695
ferror_unlocked
696
fesetenv
697
fesetexceptflag
698
fesetround
699
fetestexcept
700
feupdateenv
701
fflush
702
fflush_unlocked
703
ffs
704
ffsl
705
ffsll
706
fgetc
707
fgetc_unlocked
708
fgetln
709
fgetpos
710
fgets
711
fgets_unlocked
712
fgetwc
713
fgetwc_unlocked
714
fgetws
715
fgetws_unlocked
716
fileno
717
fileno_unlocked
718
finite
719
finitef
720
floor
721
floorf
722
floorl
723
fma
724
fmaf
725
fmal
726
fmax
727
fmaxf
728
fmaxl
729
fmemopen
730
fmin
731
fminf
732
fminl
733
fmod
734
fmodf
735
fmodl
736
fmtmsg
737
fnmatch
738
fopen
739
fpathconf
740
fprintf
741
fpurge
742
fputc
743
fputc_unlocked
744
fputs
745
fputs_unlocked
746
fputwc
747
fputwc_unlocked
748
fputws
749
fputws_unlocked
750
fread
751
fread_unlocked
752
free
753
freelocale
754
freopen
755
frexp
756
frexpf
757
frexpl
758
fscanf
759
fseek
760
fseeko
761
fsetpos
762
fstat
763
fstatat
764
fsync
765
ftell
766
ftello
767
ftime
768
ftruncate
769
fts_children
770
fts_close
771
fts_open
772
fts_read
773
fts_set
774
futimens
775
fwide
776
fwprintf
777
fwrite
778
fwrite_unlocked
779
fwscanf
780
gcvt
781
get_avphys_pages
782
get_nprocs
783
get_nprocs_conf
784
get_phys_pages
785
getc
786
getc_unlocked
787
getchar
788
getchar_unlocked
789
getcwd
790
getdate
791
getdate_err
792
getdelim
793
getdomainname
794
getentropy
795
getenv
796
gethostid
797
getline
798
getopt
799
getopt_long
800
getopt_long_only
801
setprogname
802
getprogname
803
__progname
804
getsockopt
805
getsubopt
806
gettimeofday
807
getw
808
getwc
809
getwc_unlocked
810
getwchar
811
getwchar_unlocked
812
glob
813
globfree
814
gmtime
815
gmtime_r
816
hcreate
817
hcreate_r
818
hdestroy
819
hdestroy_r
820
hsearch
821
hsearch_r
822
htonl
823
htons
824
hypot
825
hypotf
826
hypotl
827
iconv
828
iconv_close
829
iconv_open
830
ilogb
831
ilogbf
832
ilogbl
833
imaxabs
834
imaxdiv
835
in6addr_any
836
in6addr_loopback
837
index
838
inet_aton
839
inet_ntop
840
inet_pton
841
initstate
842
insque
843
ioctl
844
iprintf
845
__small_printf
846
__small_sprintf
847
isalnum
848
isalnum_l
849
isalpha
850
isalpha_l
851
isascii
852
isatty
853
isblank
854
isblank_l
855
iscntrl
856
iscntrl_l
857
isdigit
858
isdigit_l
859
isgraph
860
isgraph_l
861
islower
862
islower_l
863
isprint
864
isprint_l
865
ispunct
866
ispunct_l
867
isspace
868
isspace_l
869
isupper
870
isupper_l
871
iswalnum
872
iswalnum_l
873
iswalpha
874
iswalpha_l
875
iswblank
876
iswblank_l
877
iswcntrl
878
iswcntrl_l
879
iswctype
880
iswctype_l
881
iswdigit
882
iswdigit_l
883
iswgraph
884
iswgraph_l
885
iswlower
886
iswlower_l
887
iswprint
888
iswprint_l
889
iswpunct
890
iswpunct_l
891
iswspace
892
iswspace_l
893
iswupper
894
iswupper_l
895
iswxdigit
896
iswxdigit_l
897
isxdigit
898
isxdigit_l
899
j0
900
j0f
901
j1
902
j1f
903
jn
904
jnf
905
jrand48
906
l64a
907
labs
908
lcong48
909
ldexp
910
ldexpf
911
ldexpl
912
ldiv
913
lfind
914
lgamma
915
lgamma_r
916
lgammaf
917
lgammaf_r
918
lgammal
919
lgammal_r
920
link
921
linkat
922
llabs
923
lldiv
924
llrint
925
llrintf
926
llrintl
927
llround
928
llroundf
929
llroundl
930
localeconv
931
localtime
932
localtime_r
933
log
934
log10
935
log10f
936
log10l
937
log1p
938
log1pf
939
log1pl
940
log2
941
log2f
942
log2l
943
logb
944
logbf
945
logbl
946
logf
947
logl
948
lrand48
949
lrint
950
lrintf
951
lrintl
952
lround
953
lroundf
954
lroundl
955
lsearch
956
lseek
957
lstat
958
malloc
959
malloc_usable_size
960
mblen
961
mbrlen
962
mbrtoc16
963
mbrtoc32
964
mbrtowc
965
mbsinit
966
mbsnrtowcs
967
mbsrtowcs
968
mbstowcs
969
mbtowc
970
memccpy
971
memchr
972
memcmp
973
memcpy
974
memmem
975
memmove
976
mempcpy
977
memrchr
978
memset
979
mkdir
980
mkdirat
981
mkdtemp
982
mktime
983
modf
984
modff
985
modfl
986
mrand48
987
nan
988
nanf
989
nanl
990
nanosleep
991
nearbyint
992
nearbyintf
993
nearbyintl
994
newlocale
995
nextafter
996
nextafterf
997
nextafterl
998
nexttoward
999
nexttowardf
1000
nexttowardl
1001
nftw
1002
nl_langinfo
1003
nl_langinfo_l
1004
nrand48
1005
ntohl
1006
ntohs
1007
open
1008
openlog
1009
open_memstream
1010
open_wmemstream
1011
openat
1012
opendir
1013
opendirat
1014
optarg
1015
opterr
1016
optind
1017
optopt
1018
optreset
1019
pathconf
1020
perror
1021
poll
1022
posix_close
1023
posix_fadvise
1024
posix_fallocate
1025
posix_memalign
1026
pow
1027
pow10
1028
pow10f
1029
pow10l
1030
powf
1031
powl
1032
pread
1033
preadv
1034
printf
1035
program_invocation_name
1036
program_invocation_short_name
1037
pselect
1038
putc
1039
putc_unlocked
1040
putchar
1041
putchar_unlocked
1042
putenv
1043
puts
1044
putw
1045
putwc
1046
putwc_unlocked
1047
putwchar
1048
putwchar_unlocked
1049
pwrite
1050
pwritev
1051
qsort_r
1052
__qsort_r
1053
quick_exit
1054
rand
1055
rand_r
1056
random
1057
read
1058
readdir
1059
readlink
1060
readlinkat
1061
readv
1062
realloc
1063
reallocarray
1064
recv
1065
regcomp
1066
regerror
1067
regexec
1068
regfree
1069
remainder
1070
remainderf
1071
remainderl
1072
remove
1073
remque
1074
remquo
1075
remquof
1076
remquol
1077
rename
1078
renameat
1079
rewind
1080
rewinddir
1081
rindex
1082
rint
1083
rintf
1084
rintl
1085
rmdir
1086
round
1087
roundf
1088
roundl
1089
rpmatch
1090
sbrk
1091
scalb
1092
scalbf
1093
scalbln
1094
scalblnf
1095
scalblnl
1096
scalbn
1097
scalbnf
1098
scalbnl
1099
scandir
1100
scandirat
1101
scanf
1102
sched_yield
1103
seed48
1104
seekdir
1105
select
1106
send
1107
setbuf
1108
setbuffer
1109
setenv
1110
setkey
1111
setlinebuf
1112
setlocale
1113
setstate
1114
setvbuf
1115
shutdown
1116
signgam
1117
significand
1118
significandf
1119
sin
1120
sincos
1121
sincosf
1122
sincosl
1123
sinf
1124
sinh
1125
sinhf
1126
sinhl
1127
sinl
1128
sleep
1129
snprintf
1130
sprintf
1131
sqrt
1132
sqrtf
1133
sqrtl
1134
srand
1135
srand48
1136
srandom
1137
sscanf
1138
stat
1139
stderr
1140
stdin
1141
stdout
1142
stpcpy
1143
stpncpy
1144
strcasecmp
1145
strcasecmp_l
1146
strcasestr
1147
strcat
1148
strchr
1149
strchrnul
1150
strcmp
1151
strcoll
1152
strcoll_l
1153
strcpy
1154
strcspn
1155
strdup
1156
strerror
1157
strerror_l
1158
strerror_r
1159
strfmon
1160
strfmon_l
1161
strftime
1162
strftime_l
1163
strlcat
1164
strlcpy
1165
strlen
1166
strncasecmp
1167
strncasecmp_l
1168
strncat
1169
strncmp
1170
strncpy
1171
strndup
1172
strnlen
1173
strpbrk
1174
strptime
1175
strrchr
1176
strsep
1177
strspn
1178
strstr
1179
strtod
1180
strtof
1181
strtoq
1182
strtoimax
1183
strtonum
1184
strtok
1185
strtok_r
1186
strtol
1187
strtold
1188
strtoll
1189
strtoul
1190
strtoull
1191
strtoumax
1192
strverscmp
1193
strxfrm
1194
strxfrm_l
1195
swab
1196
swprintf
1197
swscanf
1198
symlink
1199
symlinkat
1200
sysconf
1201
tan
1202
tanf
1203
tanh
1204
tanhf
1205
tanhl
1206
tanl
1207
tcdrain
1208
tcflow
1209
tcflush
1210
tcsendbreak
1211
tdelete
1212
tdestroy
1213
telldir
1214
tfind
1215
tgamma
1216
tgammaf
1217
tgammal
1218
time
1219
times
1220
timegm
1221
timespec_get
1222
tmpnam
1223
toascii
1224
tolower
1225
tolower_l
1226
toupper
1227
toupper_l
1228
towctrans
1229
towctrans_l
1230
towlower
1231
towlower_l
1232
towupper
1233
towupper_l
1234
trunc
1235
truncate
1236
truncf
1237
truncl
1238
tsearch
1239
twalk
1240
uname
1241
ungetc
1242
ungetwc
1243
unlink
1244
unlinkat
1245
unsetenv
1246
uselocale
1247
usleep
1248
utime
1249
utimensat
1250
utimes
1251
vasprintf
1252
vdprintf
1253
versionsort
1254
vfprintf
1255
vfscanf
1256
vfwprintf
1257
vfwscanf
1258
vprintf
1259
vscanf
1260
vsnprintf
1261
vsprintf
1262
vsscanf
1263
vswprintf
1264
vswscanf
1265
vwprintf
1266
vwscanf
1267
vwarn
1268
vwarnx
1269
warn
1270
warnx
1271
wcpcpy
1272
wcpncpy
1273
wcrtomb
1274
wcscasecmp
1275
wcscasecmp_l
1276
wcscat
1277
wcschr
1278
wcscmp
1279
wcscoll
1280
wcscoll_l
1281
wcscpy
1282
wcscspn
1283
wcsdup
1284
wcsftime
1285
wcsftime_l
1286
wcslen
1287
wcsncasecmp
1288
wcsncasecmp_l
1289
wcsncat
1290
wcsncmp
1291
wcsncpy
1292
wcsnlen
1293
wcsnrtombs
1294
wcspbrk
1295
wcsrchr
1296
wcsrtombs
1297
wcsspn
1298
wcsstr
1299
wcstod
1300
wcstof
1301
wcstoimax
1302
wcstok
1303
wcstol
1304
wcstold
1305
wcstoll
1306
wcstombs
1307
wcstoul
1308
wcstoull
1309
wcstoumax
1310
wcswcs
1311
wcswidth
1312
wcsxfrm
1313
wcsxfrm_l
1314
wctob
1315
wctomb
1316
wctrans
1317
wctrans_l
1318
wctype
1319
wctype_l
1320
wcwidth
1321
wmemchr
1322
wmemcmp
1323
wmemcpy
1324
wmemmove
1325
wmemset
1326
wprintf
1327
write
1328
writev
1329
wscanf
1330
y0
1331
y0f
1332
y1
1333
y1f
1334
yn
1335
ynf
1336
__wasi_args_get
1337
__wasi_args_sizes_get
1338
__wasi_clock_res_get
1339
__wasi_clock_time_get
1340
__wasi_environ_get
1341
__wasi_environ_sizes_get
1342
__wasi_fd_advise
1343
__wasi_fd_allocate
1344
__wasi_fd_close
1345
__wasi_fd_datasync
1346
__wasi_fd_fdstat_get
1347
__wasi_fd_fdstat_set_flags
1348
__wasi_fd_fdstat_set_rights
1349
__wasi_fd_filestat_get
1350
__wasi_fd_filestat_set_size
1351
__wasi_fd_filestat_set_times
1352
__wasi_fd_pread
1353
__wasi_fd_prestat_dir_name
1354
__wasi_fd_prestat_get
1355
__wasi_fd_pwrite
1356
__wasi_fd_read
1357
__wasi_fd_readdir
1358
__wasi_fd_renumber
1359
__wasi_fd_seek
1360
__wasi_fd_sync
1361
__wasi_fd_tell
1362
__wasi_fd_write
1363
__wasi_path_create_directory
1364
__wasi_path_filestat_get
1365
__wasi_path_filestat_set_times
1366
__wasi_path_link
1367
__wasi_path_open
1368
__wasi_path_readlink
1369
__wasi_path_remove_directory
1370
__wasi_path_rename
1371
__wasi_path_symlink
1372
__wasi_path_unlink_file
1373
__wasi_poll_oneoff
1374
__wasi_proc_exit
1375
__wasi_random_get
1376
__wasi_sched_yield
1377
__wasi_sock_recv
1378
__wasi_sock_send
1379
__wasi_sock_shutdown
1380
__wasilibc_access
1381
__wasilibc_cwd
1382
__wasilibc_ensure_environ
1383
__wasilibc_environ
1384
__wasilibc_fd_renumber
1385
__wasilibc_find_abspath
1386
__wasilibc_find_relpath
1387
__wasilibc_find_relpath_alloc
1388
__wasilibc_initialize_environ
1389
__wasilibc_link
1390
__wasilibc_link_newat
1391
__wasilibc_link_oldat
1392
__wasilibc_nocwd___wasilibc_rmdirat
1393
__wasilibc_nocwd___wasilibc_unlinkat
1394
__wasilibc_nocwd_faccessat
1395
__wasilibc_nocwd_fstatat
1396
__wasilibc_nocwd_linkat
1397
__wasilibc_nocwd_mkdirat_nomode
1398
__wasilibc_nocwd_openat_nomode
1399
__wasilibc_nocwd_opendirat
1400
__wasilibc_nocwd_readlinkat
1401
__wasilibc_nocwd_renameat
1402
__wasilibc_nocwd_scandirat
1403
__wasilibc_nocwd_symlinkat
1404
__wasilibc_nocwd_utimensat
1405
__wasilibc_open_nomode
1406
__wasilibc_register_preopened_fd
1407
__wasilibc_rename_newat
1408
__wasilibc_rename_oldat
1409
__wasilibc_rmdirat
1410
__wasilibc_stat
1411
__wasilibc_tell
1412
__wasilibc_unlinkat
1413
__wasilibc_utimens
1414
1415
1416
`;
1417
1418
main();
1419
export {};
1420
1421