mirror of
https://git.proxmox.com/git/wasi-libc
synced 2025-07-15 05:16:48 +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
355 B
C
11 lines
355 B
C
// Old compilers define `__original_main`. If that doesn't exist, we
|
|
// get called here. New compilers define `__main_void`. If that doesn't
|
|
// exist, we'll try something else.
|
|
// TODO: Remove this layer when we no longer have to support old compilers.
|
|
int __main_void(void);
|
|
|
|
__attribute__((weak))
|
|
int __original_main(void) {
|
|
return __main_void();
|
|
}
|