about summary refs log tree commit diff
path: root/compiler/rustc_codegen_cranelift/example/alloc_example.rs
diff options
context:
space:
mode:
authorbjorn3 <bjorn3@users.noreply.github.com>2021-02-01 10:11:46 +0100
committerbjorn3 <bjorn3@users.noreply.github.com>2021-02-01 10:11:46 +0100
commit27855331e8fc27163bac49c9dc10ab0fe6a04d5a (patch)
treeb019249ee1989c6d0ef7dc62dc18df644619c4ec /compiler/rustc_codegen_cranelift/example/alloc_example.rs
parentfee0d31397c5ac46d08867e903131d1d73825a9e (diff)
parentd556c56f792756dd7cfec742b9f2e07612dc10f4 (diff)
downloadrust-27855331e8fc27163bac49c9dc10ab0fe6a04d5a.tar.gz
rust-27855331e8fc27163bac49c9dc10ab0fe6a04d5a.zip
Merge commit 'd556c56f792756dd7cfec742b9f2e07612dc10f4' into sync_cg_clif-2021-02-01
Diffstat (limited to 'compiler/rustc_codegen_cranelift/example/alloc_example.rs')
-rw-r--r--compiler/rustc_codegen_cranelift/example/alloc_example.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/rustc_codegen_cranelift/example/alloc_example.rs b/compiler/rustc_codegen_cranelift/example/alloc_example.rs
index dc2ad4c676e..f59600ebb33 100644
--- a/compiler/rustc_codegen_cranelift/example/alloc_example.rs
+++ b/compiler/rustc_codegen_cranelift/example/alloc_example.rs
@@ -11,7 +11,8 @@ use alloc_system::System;
 #[global_allocator]
 static ALLOC: System = System;
 
-#[link(name = "c")]
+#[cfg_attr(unix, link(name = "c"))]
+#[cfg_attr(target_env = "msvc", link(name = "msvcrt"))]
 extern "C" {
     fn puts(s: *const u8) -> i32;
 }