about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2016-02-11 16:49:20 +0000
committerbors <bors@rust-lang.org>2016-02-11 16:49:20 +0000
commitaa1dc0975a43e224386ec0ed1bb7ae09cfd0dd7e (patch)
tree13d6901dcf2b6b97b5d50352f70089f6c44a9c67 /src
parenta91ff1c9d1842918329ef7a81afd3848854d53c7 (diff)
parent657f1cf0e0c4302827f24084dd1822385944f5ef (diff)
downloadrust-aa1dc0975a43e224386ec0ed1bb7ae09cfd0dd7e.tar.gz
rust-aa1dc0975a43e224386ec0ed1bb7ae09cfd0dd7e.zip
Auto merge of #31532 - tomaka:fix-emscripten, r=brson
Before this PR:

> test result: FAILED. 2039 passed; 327 failed; 2 ignored; 0 measured

After:

> test result: FAILED. 2232 passed; 134 failed; 2 ignored; 0 measured

r? @brson
Diffstat (limited to 'src')
-rw-r--r--src/compiletest/runtest.rs12
-rw-r--r--src/libstd/sys/unix/fd.rs4
-rw-r--r--src/test/run-pass/x86stdcall.rs3
3 files changed, 11 insertions, 8 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);
diff --git a/src/test/run-pass/x86stdcall.rs b/src/test/run-pass/x86stdcall.rs
index c8c96b299fa..106bf8ce7df 100644
--- a/src/test/run-pass/x86stdcall.rs
+++ b/src/test/run-pass/x86stdcall.rs
@@ -38,5 +38,6 @@ pub fn main() {
           target_os = "netbsd",
           target_os = "openbsd",
           target_os = "android",
-          target_os = "solaris"))]
+          target_os = "solaris",
+          target_os = "emscripten"))]
 pub fn main() { }