Skip to content

Commit a35f212

Browse files
committed
Revert "Fix ABI compatibility with Emscripten >= 3.1.42"
This reverts commit 63b0d67, now that Rust requires Emscripten 3.1.42 or later.
1 parent b0e77d2 commit a35f212

File tree

2 files changed

+0
-35
lines changed

2 files changed

+0
-35
lines changed

build.rs

-29
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ use std::str;
66
// need to know all the possible cfgs that this script will set. If you need to set another cfg
77
// make sure to add it to this list as well.
88
const ALLOWED_CFGS: &'static [&'static str] = &[
9-
"emscripten_new_stat_abi",
109
"espidf_time32",
1110
"freebsd10",
1211
"freebsd11",
@@ -67,12 +66,6 @@ fn main() {
6766
_ => set_cfg("freebsd15"),
6867
}
6968

70-
match emcc_version_code() {
71-
Some(v) if (v >= 30142) => set_cfg("emscripten_new_stat_abi"),
72-
// Non-Emscripten or version < 3.1.42.
73-
Some(_) | None => (),
74-
}
75-
7669
// On CI: deny all warnings
7770
if libc_ci {
7871
set_cfg("libc_deny_warnings");
@@ -212,28 +205,6 @@ fn which_freebsd() -> Option<i32> {
212205
}
213206
}
214207

215-
fn emcc_version_code() -> Option<u64> {
216-
let output = std::process::Command::new("emcc")
217-
.arg("-dumpversion")
218-
.output()
219-
.ok()?;
220-
if !output.status.success() {
221-
return None;
222-
}
223-
224-
let version = String::from_utf8(output.stdout).ok()?;
225-
226-
// Some Emscripten versions come with `-git` attached, so split the
227-
// version string also on the `-` char.
228-
let mut pieces = version.trim().split(['.', '-']);
229-
230-
let major = pieces.next().and_then(|x| x.parse().ok()).unwrap_or(0);
231-
let minor = pieces.next().and_then(|x| x.parse().ok()).unwrap_or(0);
232-
let patch = pieces.next().and_then(|x| x.parse().ok()).unwrap_or(0);
233-
234-
Some(major * 10000 + minor * 100 + patch)
235-
}
236-
237208
fn set_cfg(cfg: &str) {
238209
if !ALLOWED_CFGS.contains(&cfg) {
239210
panic!("trying to set cfg {}, but it is not in ALLOWED_CFGS", cfg);

src/unix/linux_like/emscripten/mod.rs

-6
Original file line numberDiff line numberDiff line change
@@ -230,17 +230,11 @@ s! {
230230
}
231231
pub struct stat {
232232
pub st_dev: ::dev_t,
233-
#[cfg(not(emscripten_new_stat_abi))]
234-
__st_dev_padding: ::c_int,
235-
#[cfg(not(emscripten_new_stat_abi))]
236-
__st_ino_truncated: ::c_long,
237233
pub st_mode: ::mode_t,
238234
pub st_nlink: ::nlink_t,
239235
pub st_uid: ::uid_t,
240236
pub st_gid: ::gid_t,
241237
pub st_rdev: ::dev_t,
242-
#[cfg(not(emscripten_new_stat_abi))]
243-
__st_rdev_padding: ::c_int,
244238
pub st_size: ::off_t,
245239
pub st_blksize: ::blksize_t,
246240
pub st_blocks: ::blkcnt_t,

0 commit comments

Comments
 (0)