Skip to content

Commit aa1dc09

Browse files
committed
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
2 parents a91ff1c + 657f1cf commit aa1dc09

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

src/compiletest/runtest.rs

+7-5
Original file line numberDiff line numberDiff line change
@@ -1229,11 +1229,13 @@ fn compose_and_run_compiler(config: &Config, props: &TestProps,
12291229
// for the test suite (otherwise including libstd statically in all
12301230
// executables takes up quite a bit of space).
12311231
//
1232-
// For targets like MUSL, however, there is no support for dynamic
1233-
// libraries so we just go back to building a normal library. Note,
1234-
// however, that if the library is built with `force_host` then it's
1235-
// ok to be a dylib as the host should always support dylibs.
1236-
if config.target.contains("musl") && !aux_props.force_host {
1232+
// For targets like MUSL or Emscripten, however, there is no support for
1233+
// dynamic libraries so we just go back to building a normal library. Note,
1234+
// however, that for MUSL if the library is built with `force_host` then
1235+
// it's ok to be a dylib as the host should always support dylibs.
1236+
if (config.target.contains("musl") && !aux_props.force_host) ||
1237+
config.target.contains("emscripten")
1238+
{
12371239
vec!("--crate-type=lib".to_owned())
12381240
} else {
12391241
vec!("--crate-type=dylib".to_owned())

src/libstd/sys/unix/fd.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,14 @@ impl FileDesc {
5151
Ok(ret as usize)
5252
}
5353

54-
#[cfg(not(any(target_env = "newlib", target_os = "solaris")))]
54+
#[cfg(not(any(target_env = "newlib", target_os = "solaris", target_os = "emscripten")))]
5555
pub fn set_cloexec(&self) {
5656
unsafe {
5757
let ret = libc::ioctl(self.fd, libc::FIOCLEX);
5858
debug_assert_eq!(ret, 0);
5959
}
6060
}
61-
#[cfg(any(target_env = "newlib", target_os = "solaris"))]
61+
#[cfg(any(target_env = "newlib", target_os = "solaris", target_os = "emscripten"))]
6262
pub fn set_cloexec(&self) {
6363
unsafe {
6464
let previous = libc::fcntl(self.fd, libc::F_GETFD);

src/test/run-pass/x86stdcall.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,6 @@ pub fn main() {
3838
target_os = "netbsd",
3939
target_os = "openbsd",
4040
target_os = "android",
41-
target_os = "solaris"))]
41+
target_os = "solaris",
42+
target_os = "emscripten"))]
4243
pub fn main() { }

0 commit comments

Comments
 (0)