about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPierre Krieger <pierre.krieger1708@gmail.com>2016-02-10 10:28:51 +0100
committerPierre Krieger <pierre.krieger1708@gmail.com>2016-02-10 10:28:51 +0100
commit173037840e77fe59c14391e2bc7941871bc89dde (patch)
tree61714e3fec34a2bb5625a821a1c9a048e55069fe
parent0d410b8d2afc17dd129a498e3304e3c4fe221a94 (diff)
downloadrust-173037840e77fe59c14391e2bc7941871bc89dde.tar.gz
rust-173037840e77fe59c14391e2bc7941871bc89dde.zip
Fix half of emscripten's failing tests
-rw-r--r--src/compiletest/runtest.rs12
-rw-r--r--src/libstd/sys/unix/fd.rs4
2 files changed, 9 insertions, 7 deletions
diff --git a/src/compiletest/runtest.rs b/src/compiletest/runtest.rs
index ada6ea200d1..5eef6b7f24c 100644
--- a/src/compiletest/runtest.rs
+++ b/src/compiletest/runtest.rs
@@ -1229,11 +1229,13 @@ fn compose_and_run_compiler(config: &Config, props: &TestProps,
             // for the test suite (otherwise including libstd statically in all
             // executables takes up quite a bit of space).
             //
-            // For targets like MUSL, however, there is no support for dynamic
-            // libraries so we just go back to building a normal library. Note,
-            // however, that if the library is built with `force_host` then it's
-            // ok to be a dylib as the host should always support dylibs.
-            if config.target.contains("musl") && !aux_props.force_host {
+            // For targets like MUSL or Emscripten, however, there is no support for
+            // dynamic libraries so we just go back to building a normal library. Note,
+            // however, that for MUSL if the library is built with `force_host` then
+            // it's ok to be a dylib as the host should always support dylibs.
+            if (config.target.contains("musl") && !aux_props.force_host) ||
+                config.target.contains("emscripten")
+            {
                 vec!("--crate-type=lib".to_owned())
             } else {
                 vec!("--crate-type=dylib".to_owned())
diff --git a/src/libstd/sys/unix/fd.rs b/src/libstd/sys/unix/fd.rs
index 0eadee54e26..299c6ec2731 100644
--- a/src/libstd/sys/unix/fd.rs
+++ b/src/libstd/sys/unix/fd.rs
@@ -51,14 +51,14 @@ impl FileDesc {
         Ok(ret as usize)
     }
 
-    #[cfg(not(any(target_env = "newlib", target_os = "solaris")))]
+    #[cfg(not(any(target_env = "newlib", target_os = "solaris", target_os = "emscripten")))]
     pub fn set_cloexec(&self) {
         unsafe {
             let ret = libc::ioctl(self.fd, libc::FIOCLEX);
             debug_assert_eq!(ret, 0);
         }
     }
-    #[cfg(any(target_env = "newlib", target_os = "solaris"))]
+    #[cfg(any(target_env = "newlib", target_os = "solaris", target_os = "emscripten"))]
     pub fn set_cloexec(&self) {
         unsafe {
             let previous = libc::fcntl(self.fd, libc::F_GETFD);