about summary refs log tree commit diff
path: root/src/libstd/os
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/os
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/os')
-rw-r--r--src/libstd/os/linux/raw.rs12
-rw-r--r--src/libstd/os/mod.rs5
-rw-r--r--src/libstd/os/raw.rs2
3 files changed, 17 insertions, 2 deletions
diff --git a/src/libstd/os/linux/raw.rs b/src/libstd/os/linux/raw.rs
index cc7fa23546b..10d37f9f597 100644
--- a/src/libstd/os/linux/raw.rs
+++ b/src/libstd/os/linux/raw.rs
@@ -26,7 +26,8 @@ pub use self::arch::{off_t, ino_t, nlink_t, blksize_t, blkcnt_t, stat, time_t};
 #[cfg(any(target_arch = "x86",
           target_arch = "le32",
           target_arch = "powerpc",
-          target_arch = "arm"))]
+          target_arch = "arm",
+          target_arch = "asmjs"))]
 mod arch {
     use super::{dev_t, mode_t};
     use os::raw::{c_long, c_short};
@@ -34,7 +35,14 @@ mod arch {
 
     #[stable(feature = "raw_ext", since = "1.1.0")] pub type blkcnt_t = i32;
     #[stable(feature = "raw_ext", since = "1.1.0")] pub type blksize_t = i32;
-    #[stable(feature = "raw_ext", since = "1.1.0")] pub type ino_t = u32;
+
+    #[stable(feature = "raw_ext", since = "1.1.0")]
+    #[cfg(not(any(target_env = "musl", target_arch = "asmjs")))]
+    pub type ino_t = u32;
+    #[stable(feature = "raw_ext", since = "1.1.0")]
+    #[cfg(any(target_env = "musl", target_arch = "asmjs"))]
+    pub type ino_t = u64;
+
     #[stable(feature = "raw_ext", since = "1.1.0")] pub type nlink_t = u32;
     #[stable(feature = "raw_ext", since = "1.1.0")] pub type off_t = i32;
     #[stable(feature = "raw_ext", since = "1.1.0")] pub type time_t = i32;
diff --git a/src/libstd/os/mod.rs b/src/libstd/os/mod.rs
index 5606c127dcb..e15c8d67a8a 100644
--- a/src/libstd/os/mod.rs
+++ b/src/libstd/os/mod.rs
@@ -32,4 +32,9 @@ pub use sys::ext as windows;
 #[cfg(target_os = "openbsd")]   pub mod openbsd;
 #[cfg(target_os = "solaris")]   pub mod solaris;
 
+// Emscripten is just like linux
+#[cfg(target_os = "emscripten")]
+#[path = "linux/mod.rs"]
+pub mod emscripten;
+
 pub mod raw;
diff --git a/src/libstd/os/raw.rs b/src/libstd/os/raw.rs
index bd353f066cf..4200e105cea 100644
--- a/src/libstd/os/raw.rs
+++ b/src/libstd/os/raw.rs
@@ -13,12 +13,14 @@
 #![stable(feature = "raw_os", since = "1.1.0")]
 
 #[cfg(any(target_os = "android",
+          target_os = "emscripten",
           all(target_os = "linux", any(target_arch = "aarch64",
                                        target_arch = "arm",
                                        target_arch = "powerpc",
                                        target_arch = "powerpc64"))))]
 #[stable(feature = "raw_os", since = "1.1.0")] pub type c_char = u8;
 #[cfg(not(any(target_os = "android",
+              target_os = "emscripten",
               all(target_os = "linux", any(target_arch = "aarch64",
                                            target_arch = "arm",
                                            target_arch = "powerpc",