Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix half of emscripten's failing tests #31532

Merged
merged 2 commits into from Feb 11, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 7 additions & 5 deletions src/compiletest/runtest.rs
Expand Up @@ -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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why isn't the force_host statement also true for emscripten?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment says if the library is built with force_host then it's ok to be a dylib as the host should always support dylibs, but emscripten doesn't support dynamic libraries at all (the "libraries" are just hidden javascript files).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, but the host can never be emscripten, right? That would mean we'd have a rustc that runs on emscripten.

I think force_host is just for rustc's unit tests when compiling a compiler plugin.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would mean we'd have a rustc that runs on emscripten.

Well, why not? 🐷

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())
Expand Down
4 changes: 2 additions & 2 deletions src/libstd/sys/unix/fd.rs
Expand Up @@ -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);
Expand Down
3 changes: 2 additions & 1 deletion src/test/run-pass/x86stdcall.rs
Expand Up @@ -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() { }