about summary refs log tree commit diff
path: root/src/libstd/sys/common
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2016-02-06 21:18:50 +0000
committerbors <bors@rust-lang.org>2016-02-06 21:18:50 +0000
commit8c604dc940c35e4ac36012aa85375250f2e6e07e (patch)
treef3beddb6caac90034b3410c7249745f1386e1dd2 /src/libstd/sys/common
parent915fa2a378a22d197ed85f2d563f443edb10b713 (diff)
parent7afb56f51e52030fbdda07c38f9ae09a1daeed9f (diff)
downloadrust-8c604dc940c35e4ac36012aa85375250f2e6e07e.tar.gz
rust-8c604dc940c35e4ac36012aa85375250f2e6e07e.zip
Auto merge of #30629 - brson:emscripten-upstream, r=alexcrichton
Here's another go at adding emscripten support. This needs to wait again on new [libc definitions](https://github.com/rust-lang-nursery/libc/pull/122) landing. To get the libc definitions right I had to add support for i686-unknown-linux-musl, which are very similar to emscripten's, which are derived from arm/musl.

This branch additionally removes the makefile dependency on the `EMSCRIPTEN` environment variable by not building the unused compiler-rt.

Again, this is not sufficient for actually compiling to asmjs since it needs additional LLVM patches.

r? @alexcrichton
Diffstat (limited to 'src/libstd/sys/common')
-rw-r--r--src/libstd/sys/common/args.rs3
-rw-r--r--src/libstd/sys/common/libunwind.rs4
-rw-r--r--src/libstd/sys/common/mod.rs2
3 files changed, 7 insertions, 2 deletions
diff --git a/src/libstd/sys/common/args.rs b/src/libstd/sys/common/args.rs
index 4600983eb3b..58417540664 100644
--- a/src/libstd/sys/common/args.rs
+++ b/src/libstd/sys/common/args.rs
@@ -39,7 +39,8 @@ pub fn clone() -> Option<Vec<Vec<u8>>> { imp::clone() }
           target_os = "bitrig",
           target_os = "netbsd",
           target_os = "openbsd",
-          target_os = "solaris"))]
+          target_os = "solaris",
+          target_os = "emscripten"))]
 mod imp {
     use prelude::v1::*;
 
diff --git a/src/libstd/sys/common/libunwind.rs b/src/libstd/sys/common/libunwind.rs
index 956f6005f1c..3f70afe6ad7 100644
--- a/src/libstd/sys/common/libunwind.rs
+++ b/src/libstd/sys/common/libunwind.rs
@@ -86,6 +86,10 @@ pub const unwinder_private_data_size: usize = 2;
 #[cfg(any(target_arch = "powerpc", target_arch = "powerpc64"))]
 pub const unwinder_private_data_size: usize = 2;
 
+#[cfg(target_arch = "asmjs")]
+// FIXME: Copied from arm. Need to confirm.
+pub const unwinder_private_data_size: usize = 20;
+
 #[repr(C)]
 pub struct _Unwind_Exception {
     pub exception_class: _Unwind_Exception_Class,
diff --git a/src/libstd/sys/common/mod.rs b/src/libstd/sys/common/mod.rs
index 5062be8cd63..56628a4c754 100644
--- a/src/libstd/sys/common/mod.rs
+++ b/src/libstd/sys/common/mod.rs
@@ -45,7 +45,7 @@ pub mod unwind;
 pub mod util;
 pub mod wtf8;
 
-#[cfg(any(all(unix, not(any(target_os = "macos", target_os = "ios"))),
+#[cfg(any(all(unix, not(any(target_os = "macos", target_os = "ios", target_os = "emscripten"))),
           all(windows, target_env = "gnu")))]
 pub mod gnu;