about summary refs log tree commit diff
path: root/src/test/auxiliary
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2013-11-16 02:02:07 -0800
committerAlex Crichton <alex@alexcrichton.com>2013-11-29 18:36:14 -0800
commit9fbba7b2eeabd073f9518f2dbd50f4eabb621c67 (patch)
treedc6501789d9d004f5806714a706416c92f68cfdd /src/test/auxiliary
parente338a4154b134fc1d4628496d4ccf85b7af7c443 (diff)
downloadrust-9fbba7b2eeabd073f9518f2dbd50f4eabb621c67.tar.gz
rust-9fbba7b2eeabd073f9518f2dbd50f4eabb621c67.zip
Statically link librustrt to libstd
This commit alters the build process of the compiler to build a static
librustrt.a instead of a dynamic version. This means that we can stop
distributing librustrt as well as default linking against it in the compiler.

This also means that if you attempt to build rust code without libstd, it will
no longer work if there are any landing pads in play. The reason for this is
that LLVM and rustc will emit calls to the various upcalls in librustrt used to
manage exception handling. In theory we could split librustrt into librustrt and
librustupcall. We would then distribute librustupcall and link to it for all
programs using landing pads, but I would rather see just one librustrt artifact
and simplify the build process.

The major benefit of doing this is that building a static rust library for use
in embedded situations all of a sudden just became a whole lot more feasible.

Closes #3361
Diffstat (limited to 'src/test/auxiliary')
-rw-r--r--src/test/auxiliary/anon-extern-mod-cross-crate-1.rs5
-rw-r--r--src/test/auxiliary/extern-crosscrate-source.rs1
-rw-r--r--src/test/auxiliary/foreign_lib.rs1
3 files changed, 4 insertions, 3 deletions
diff --git a/src/test/auxiliary/anon-extern-mod-cross-crate-1.rs b/src/test/auxiliary/anon-extern-mod-cross-crate-1.rs
index ca9c6eb79f9..01a90f1ad44 100644
--- a/src/test/auxiliary/anon-extern-mod-cross-crate-1.rs
+++ b/src/test/auxiliary/anon-extern-mod-cross-crate-1.rs
@@ -8,14 +8,13 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#[link_name = "rustrt"];
-#[link(name = "anonexternmod",
-       vers = "0.1")];
+#[link(name = "anonexternmod", vers = "0.1")];
 
 #[crate_type = "lib"];
 
 use std::libc;
 
 extern {
+    #[link(name = "rustrt")]
     pub fn rust_get_test_int() -> libc::intptr_t;
 }
diff --git a/src/test/auxiliary/extern-crosscrate-source.rs b/src/test/auxiliary/extern-crosscrate-source.rs
index e77efce7f58..89317a45171 100644
--- a/src/test/auxiliary/extern-crosscrate-source.rs
+++ b/src/test/auxiliary/extern-crosscrate-source.rs
@@ -18,6 +18,7 @@ use std::libc;
 pub mod rustrt {
     use std::libc;
 
+    #[link(name = "rustrt")]
     extern {
         pub fn rust_dbg_call(cb: extern "C" fn(libc::uintptr_t) -> libc::uintptr_t,
                              data: libc::uintptr_t)
diff --git a/src/test/auxiliary/foreign_lib.rs b/src/test/auxiliary/foreign_lib.rs
index d67e329b04e..4705d13cd96 100644
--- a/src/test/auxiliary/foreign_lib.rs
+++ b/src/test/auxiliary/foreign_lib.rs
@@ -13,6 +13,7 @@
 pub mod rustrt {
     use std::libc;
 
+    #[link(name = "rustrt")]
     extern {
         fn rust_get_test_int() -> libc::intptr_t;
     }