Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion expected/wasm32-wasip2/defined-symbols.txt
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,6 @@ explicit_bzero
expm1
expm1f
expm1l
exports_wasi_cli_run_run
fabs
fabsf
fabsl
Expand Down
13 changes: 13 additions & 0 deletions libc-bottom-half/crt/crt1-command.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#endif

#include <wasi/api.h>
#include <stdbool.h>

extern void __wasi_init_tp(void);
extern void __wasm_call_ctors(void);
Expand Down Expand Up @@ -58,3 +59,15 @@ void _start(void) {
}
#endif
}


#ifdef __wasip2__
#include <wasi/libc-environ.h>

// The wasi:cli/run export for wasip2 components. This is only linked for
// command-style executables, not reactors.
bool exports_wasi_cli_run_run(void) {
__wasilibc_initialize_environ();
return __main_void() == 0;
}
#endif
9 changes: 0 additions & 9 deletions libc-bottom-half/sources/__main_void.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,3 @@ __attribute__((__weak__, nodebug)) int __main_void(void) {
return __main_argc_argv(argc, argv);
#endif
}

#ifdef __wasip2__
bool exports_wasi_cli_run_run(void) {
// TODO: this is supposed to be unnecessary, but functional/env.c fails
// without it
Comment on lines -114 to -115
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this TODO might still be applicable? Mind carrying it over?

__wasilibc_initialize_environ();
return __main_void() == 0;
}
#endif
Loading