about summary refs log tree commit diff
path: root/compiler/rustc_target
diff options
context:
space:
mode:
authorDan Gohman <dev@sunfishcode.online>2021-03-08 17:46:03 -0800
committerDan Gohman <dev@sunfishcode.online>2021-03-08 17:49:34 -0800
commitfdb899ba4bd5dffab4eec9ea575991ec5499a527 (patch)
treeafecf6570b564ea715d79e918ffe39aa2cd8d3df /compiler/rustc_target
parent8f349be27815d43d462a32faeb270a22a68486b6 (diff)
downloadrust-fdb899ba4bd5dffab4eec9ea575991ec5499a527.tar.gz
rust-fdb899ba4bd5dffab4eec9ea575991ec5499a527.zip
WASI: Switch to crt1-command.o to enable support for new-style commands
This switches Rust's WASI target to use crt1-command.o instead of
crt1.o, which enables support for new-style commands. By default,
new-style commands work the same way as old-style commands, so nothing
immediately changes here, but this will be needed by later changes to
enable support for typed arguments.

See here for more information on new-style commands:
 - https://github.com/WebAssembly/wasi-libc/pull/203
 - https://reviews.llvm.org/D81689
Diffstat (limited to 'compiler/rustc_target')
-rw-r--r--compiler/rustc_target/src/spec/crt_objects.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/compiler/rustc_target/src/spec/crt_objects.rs b/compiler/rustc_target/src/spec/crt_objects.rs
index 51a48147e6b..2fc9ab29f92 100644
--- a/compiler/rustc_target/src/spec/crt_objects.rs
+++ b/compiler/rustc_target/src/spec/crt_objects.rs
@@ -108,11 +108,13 @@ pub(super) fn post_mingw() -> CrtObjects {
 }
 
 pub(super) fn pre_wasi_fallback() -> CrtObjects {
+    // Use crt1-command.o instead of crt1.o to enable support for new-style
+    // commands. See https://reviews.llvm.org/D81689 for more info.
     new(&[
-        (LinkOutputKind::DynamicNoPicExe, &["crt1.o"]),
-        (LinkOutputKind::DynamicPicExe, &["crt1.o"]),
-        (LinkOutputKind::StaticNoPicExe, &["crt1.o"]),
-        (LinkOutputKind::StaticPicExe, &["crt1.o"]),
+        (LinkOutputKind::DynamicNoPicExe, &["crt1-command.o"]),
+        (LinkOutputKind::DynamicPicExe, &["crt1-command.o"]),
+        (LinkOutputKind::StaticNoPicExe, &["crt1-command.o"]),
+        (LinkOutputKind::StaticPicExe, &["crt1-command.o"]),
         (LinkOutputKind::WasiReactorExe, &["crt1-reactor.o"]),
     ])
 }