mirror of
https://git.proxmox.com/git/wasi-libc
synced 2025-07-15 05:28:17 +00:00

This adds support for the `__main_argc_argv` change, while preserving compatibility with `__original_main`. This is needed by the LTO build because the `__original_main` hack works in LLVM codegen, which is after LTO. The `__main_argc_argv` change is implemented in clang, which makes it properly visible to LTO.
11 lines
417 B
C
11 lines
417 B
C
// New compilers define `__main_argc_argv`. If that doesn't exist, we
|
|
// may get called here. Old compilers define `main` expecting an
|
|
// argv/argc, so call that.
|
|
// TODO: Remove this layer when we no longer have to support old compilers.
|
|
int __wasilibc_main(int argc, char *argv[]) asm("main");
|
|
|
|
__attribute__((weak, nodebug))
|
|
int __main_argc_argv(int argc, char *argv[]) {
|
|
return __wasilibc_main(argc, argv);
|
|
}
|