mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-16 04:55:22 +03:00
Disable main_needs_argc_argv for Wasm
This commit is contained in:
@@ -118,6 +118,13 @@ macro_rules! args {
|
||||
// with unwinding.
|
||||
llvm_args: cvs!["-wasm-use-legacy-eh=false"],
|
||||
|
||||
// WASI's `sys::args::init` function ignores its arguments; instead,
|
||||
// `args::args()` makes the WASI API calls itself.
|
||||
//
|
||||
// Other Wasm targets make no use of `std::env` entirely.
|
||||
// Emscripten enables it explicitly.
|
||||
main_needs_argc_argv: false,
|
||||
|
||||
..Default::default()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@ pub(crate) fn target() -> Target {
|
||||
crt_static_respected: true,
|
||||
crt_static_default: true,
|
||||
crt_static_allows_dylibs: true,
|
||||
main_needs_argc_argv: true,
|
||||
panic_strategy: PanicStrategy::Unwind,
|
||||
no_default_libraries: false,
|
||||
families: cvs!["unix", "wasm"],
|
||||
|
||||
@@ -41,10 +41,6 @@ pub(crate) fn target() -> Target {
|
||||
// without a main function.
|
||||
options.crt_static_allows_dylibs = true;
|
||||
|
||||
// WASI's `sys::args::init` function ignores its arguments; instead,
|
||||
// `args::args()` makes the WASI API calls itself.
|
||||
options.main_needs_argc_argv = false;
|
||||
|
||||
// And, WASI mangles the name of "main" to distinguish between different
|
||||
// signatures.
|
||||
options.entry_name = "__main_void".into();
|
||||
|
||||
@@ -52,10 +52,6 @@ pub(crate) fn target() -> Target {
|
||||
// without a main function.
|
||||
options.crt_static_allows_dylibs = true;
|
||||
|
||||
// WASI's `sys::args::init` function ignores its arguments; instead,
|
||||
// `args::args()` makes the WASI API calls itself.
|
||||
options.main_needs_argc_argv = false;
|
||||
|
||||
// And, WASI mangles the name of "main" to distinguish between different
|
||||
// signatures.
|
||||
options.entry_name = "__main_void".into();
|
||||
|
||||
@@ -46,10 +46,6 @@ pub(crate) fn target() -> Target {
|
||||
// without a main function.
|
||||
options.crt_static_allows_dylibs = true;
|
||||
|
||||
// WASI's `sys::args::init` function ignores its arguments; instead,
|
||||
// `args::args()` makes the WASI API calls itself.
|
||||
options.main_needs_argc_argv = false;
|
||||
|
||||
// And, WASI mangles the name of "main" to distinguish between different
|
||||
// signatures.
|
||||
options.entry_name = "__main_void".into();
|
||||
|
||||
Reference in New Issue
Block a user