File tree 1 file changed +3
-9
lines changed 1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change 2
2
extern void __wasm_call_ctors (void );
3
3
extern int __original_main (void );
4
4
extern void __wasm_call_dtors (void );
5
+ _Noreturn void exit (int );
5
6
6
7
__attribute__((export_name ("_start" )))
7
8
void _start (void ) {
8
- // The linker synthesizes this to call constructors.
9
- __wasm_call_ctors ();
10
-
11
9
// Call `__original_main` which will either be the application's zero-argument
12
10
// `__original_main` function or a libc routine which calls `__main_void`.
13
11
// TODO: Call `main` directly once we no longer have to support old compilers.
14
12
int r = __original_main ();
15
13
16
- // Call atexit functions, destructors, stdio cleanup, etc.
17
- __wasm_call_dtors ();
18
-
19
- // If main exited successfully, just return, otherwise call
20
- // `__wasi_proc_exit`.
14
+ // If main exited successfully, just return, otherwise call `exit`.
21
15
if (r != 0 ) {
22
- __wasi_proc_exit (r );
16
+ exit (r );
23
17
}
24
18
}
You can’t perform that action at this time.
0 commit comments