mirror of
https://github.com/rust-lang/rust
synced 2024-11-02 09:18:18 +00:00
Fix half of emscripten's failing tests
This commit is contained in:
parent
0d410b8d2a
commit
173037840e
2 changed files with 9 additions and 7 deletions
|
@ -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())
|
||||
|
|
|
@ -51,14 +51,14 @@ pub fn write(&self, buf: &[u8]) -> io::Result<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) {
|
||||
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);
|
||||
|
|
Loading…
Reference in a new issue