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
This commit is contained in:
commit
aa1dc0975a
3 changed files with 11 additions and 8 deletions
|
@ -1229,11 +1229,13 @@ fn compose_and_run_compiler(config: &Config, props: &TestProps,
|
||||||
// for the test suite (otherwise including libstd statically in all
|
// for the test suite (otherwise including libstd statically in all
|
||||||
// executables takes up quite a bit of space).
|
// executables takes up quite a bit of space).
|
||||||
//
|
//
|
||||||
// For targets like MUSL, however, there is no support for dynamic
|
// For targets like MUSL or Emscripten, however, there is no support for
|
||||||
// libraries so we just go back to building a normal library. Note,
|
// 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
|
// however, that for MUSL if the library is built with `force_host` then
|
||||||
// ok to be a dylib as the host should always support dylibs.
|
// it's ok to be a dylib as the host should always support dylibs.
|
||||||
if config.target.contains("musl") && !aux_props.force_host {
|
if (config.target.contains("musl") && !aux_props.force_host) ||
|
||||||
|
config.target.contains("emscripten")
|
||||||
|
{
|
||||||
vec!("--crate-type=lib".to_owned())
|
vec!("--crate-type=lib".to_owned())
|
||||||
} else {
|
} else {
|
||||||
vec!("--crate-type=dylib".to_owned())
|
vec!("--crate-type=dylib".to_owned())
|
||||||
|
|
|
@ -51,14 +51,14 @@ impl FileDesc {
|
||||||
Ok(ret as usize)
|
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) {
|
pub fn set_cloexec(&self) {
|
||||||
unsafe {
|
unsafe {
|
||||||
let ret = libc::ioctl(self.fd, libc::FIOCLEX);
|
let ret = libc::ioctl(self.fd, libc::FIOCLEX);
|
||||||
debug_assert_eq!(ret, 0);
|
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) {
|
pub fn set_cloexec(&self) {
|
||||||
unsafe {
|
unsafe {
|
||||||
let previous = libc::fcntl(self.fd, libc::F_GETFD);
|
let previous = libc::fcntl(self.fd, libc::F_GETFD);
|
||||||
|
|
|
@ -38,5 +38,6 @@ pub fn main() {
|
||||||
target_os = "netbsd",
|
target_os = "netbsd",
|
||||||
target_os = "openbsd",
|
target_os = "openbsd",
|
||||||
target_os = "android",
|
target_os = "android",
|
||||||
target_os = "solaris"))]
|
target_os = "solaris",
|
||||||
|
target_os = "emscripten"))]
|
||||||
pub fn main() { }
|
pub fn main() { }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue