wasi-libc/libc-bottom-half/cloudlibc/src
Dan Gohman afbf94c39e
Call populate_args only if we actually need command-line arguments (#112)
* Link `populate_args` only if we actually need command-line arguments.

This avoids linking in the argv/argc initialization code,
and the __wasi_args_sizes_get and __wasi_args_get imports, in
programs that don't use command-line arguments. The way this works is,
if the user writes `int main(int argc, char *argv[])`, the argument
initialization code is loaded, and if they write `int main(void)`,
it's not loaded.

This promotes the `__original_main` mechanism into an effective contract
between the compiler and libc, which wasn't its original purpose,
however it seems to fit this purpose quite well.

* Document that `__original_main` may be the user's zero-arg `main`.
2019-10-24 17:30:46 -07:00
..
common WASI libc prototype implementation. 2019-03-27 07:59:55 -07:00
include Call populate_args only if we actually need command-line arguments (#112) 2019-10-24 17:30:46 -07:00
libc Miscellaneous cleanups (#113) 2019-10-18 13:53:13 -07:00