Skip to content

Commit 71e623d

Browse files
authored
Merge pull request #3962 from kleisauke/update-emscripten-version
emscripten: Upgrade emsdk to 3.1.68
2 parents c025f57 + 3e82531 commit 71e623d

File tree

4 files changed

+55
-313
lines changed

4 files changed

+55
-313
lines changed

ci/emscripten.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
set -ex
44

5-
# FIXME: 3.1.21 removed a lot of header files (https://github.com/emscripten-core/emscripten/pull/17704).
6-
# We have to tweak libc-test (and deprecate unsupported items, maybe) when updating emsdk.
7-
EMSDK_VERSION=3.1.20
5+
# Note: keep in sync with:
6+
# https://github.com/rust-lang/rust/blob/master/src/ci/docker/scripts/emscripten.sh
7+
EMSDK_VERSION=3.1.68
88

99
git clone https://github.com/emscripten-core/emsdk.git /emsdk-portable
1010
cd /emsdk-portable

libc-test/build.rs

+40-74
Original file line numberDiff line numberDiff line change
@@ -2739,7 +2739,6 @@ fn test_emscripten(target: &str) {
27392739
cfg.define("_GNU_SOURCE", None); // FIXME: ??
27402740

27412741
headers! { cfg:
2742-
"aio.h",
27432742
"ctype.h",
27442743
"dirent.h",
27452744
"dlfcn.h",
@@ -2780,32 +2779,21 @@ fn test_emscripten(target: &str) {
27802779
"stdio.h",
27812780
"stdlib.h",
27822781
"string.h",
2783-
"sys/epoll.h",
2784-
"sys/eventfd.h",
27852782
"sys/file.h",
27862783
"sys/ioctl.h",
27872784
"sys/ipc.h",
27882785
"sys/mman.h",
27892786
"sys/mount.h",
27902787
"sys/msg.h",
2791-
"sys/personality.h",
2792-
"sys/prctl.h",
2793-
"sys/ptrace.h",
2794-
"sys/quota.h",
2795-
"sys/reboot.h",
27962788
"sys/resource.h",
27972789
"sys/sem.h",
27982790
"sys/shm.h",
2799-
"sys/signalfd.h",
28002791
"sys/socket.h",
28012792
"sys/stat.h",
28022793
"sys/statvfs.h",
2803-
"sys/swap.h",
28042794
"sys/syscall.h",
2805-
"sys/sysctl.h",
28062795
"sys/sysinfo.h",
28072796
"sys/time.h",
2808-
"sys/timerfd.h",
28092797
"sys/times.h",
28102798
"sys/types.h",
28112799
"sys/uio.h",
@@ -2831,9 +2819,7 @@ fn test_emscripten(target: &str) {
28312819
// Just pass all these through, no need for a "struct" prefix
28322820
"FILE" | "fd_set" | "Dl_info" | "DIR" => ty.to_string(),
28332821

2834-
"os_unfair_lock" => "struct os_unfair_lock_s".to_string(),
2835-
2836-
// LFS64 types have been removed in Emscripten 3.1.44+
2822+
// LFS64 types have been removed in Emscripten 3.1.44
28372823
// https://github.com/emscripten-core/emscripten/pull/19812
28382824
"off64_t" => "off_t".to_string(),
28392825

@@ -2857,7 +2843,7 @@ fn test_emscripten(target: &str) {
28572843
s if s.ends_with("_nsec") && struct_.starts_with("stat") => {
28582844
s.replace("e_nsec", ".tv_nsec")
28592845
}
2860-
// FIXME: appears that `epoll_event.data` is an union
2846+
// Rust struct uses raw u64, rather than union
28612847
"u64" if struct_ == "epoll_event" => "data.u64".to_string(),
28622848
s => s.to_string(),
28632849
}
@@ -2869,10 +2855,11 @@ fn test_emscripten(target: &str) {
28692855
// FIXME: is this necessary?
28702856
"sighandler_t" => true,
28712857

2872-
// FIXME: The size has been changed due to musl's time64
2873-
"time_t" => true,
2858+
// No epoll support
2859+
// https://github.com/emscripten-core/emscripten/issues/5033
2860+
ty if ty.starts_with("epoll") => true,
28742861

2875-
// LFS64 types have been removed in Emscripten 3.1.44+
2862+
// LFS64 types have been removed in Emscripten 3.1.44
28762863
// https://github.com/emscripten-core/emscripten/pull/19812
28772864
t => t.ends_with("64") || t.ends_with("64_t"),
28782865
}
@@ -2881,29 +2868,19 @@ fn test_emscripten(target: &str) {
28812868
cfg.skip_struct(move |ty| {
28822869
match ty {
28832870
// This is actually a union, not a struct
2884-
// FIXME: is this necessary?
28852871
"sigval" => true,
28862872

2887-
// FIXME: It was removed in
2888-
// emscripten-core/emscripten@953e414
2889-
"pthread_mutexattr_t" => true,
2890-
28912873
// FIXME: Investigate why the test fails.
28922874
// Skip for now to unblock CI.
28932875
"pthread_condattr_t" => true,
2876+
"pthread_mutexattr_t" => true,
28942877

2895-
// FIXME: The size has been changed when upgraded to musl 1.2.2
2896-
"pthread_mutex_t" => true,
2897-
2898-
// FIXME: Lowered from 16 to 8 bytes in
2899-
// llvm/llvm-project@d1a96e9
2900-
"max_align_t" => true,
2901-
2902-
// FIXME: The size has been changed due to time64
2903-
"utimbuf" | "timeval" | "timespec" | "rusage" | "itimerval" | "sched_param"
2904-
| "stat" | "stat64" | "shmid_ds" | "msqid_ds" => true,
2878+
// No epoll support
2879+
// https://github.com/emscripten-core/emscripten/issues/5033
2880+
ty if ty.starts_with("epoll") => true,
2881+
ty if ty.starts_with("signalfd") => true,
29052882

2906-
// LFS64 types have been removed in Emscripten 3.1.44+
2883+
// LFS64 types have been removed in Emscripten 3.1.44
29072884
// https://github.com/emscripten-core/emscripten/pull/19812
29082885
ty => ty.ends_with("64") || ty.ends_with("64_t"),
29092886
}
@@ -2912,12 +2889,9 @@ fn test_emscripten(target: &str) {
29122889
cfg.skip_fn(move |name| {
29132890
match name {
29142891
// Emscripten does not support fork/exec/wait or any kind of multi-process support
2915-
// https://github.com/emscripten-core/emscripten/blob/3.1.30/tools/system_libs.py#L973
2892+
// https://github.com/emscripten-core/emscripten/blob/3.1.68/tools/system_libs.py#L1100
29162893
"execv" | "execve" | "execvp" | "execvpe" | "fexecve" | "wait4" => true,
29172894

2918-
// FIXME: Remove after emscripten-core/emscripten#18492 is released (> 3.1.30).
2919-
"clearenv" => true,
2920-
29212895
_ => false,
29222896
}
29232897
});
@@ -2931,23 +2905,35 @@ fn test_emscripten(target: &str) {
29312905
// FIXME: emscripten uses different constants to constructs these
29322906
n if n.contains("__SIZEOF_PTHREAD") => true,
29332907

2934-
// FIXME: `SYS_gettid` was removed in
2935-
// emscripten-core/emscripten@6d6474e
2908+
// No epoll support
2909+
// https://github.com/emscripten-core/emscripten/issues/5033
2910+
n if n.starts_with("EPOLL") => true,
2911+
2912+
// No ptrace.h
2913+
// https://github.com/emscripten-core/emscripten/pull/17704
2914+
n if n.starts_with("PTRACE_") => true,
2915+
2916+
// No quota.h
2917+
// https://github.com/emscripten-core/emscripten/pull/17704
2918+
n if n.starts_with("QIF_") => true,
2919+
"USRQUOTA" | "GRPQUOTA" | "Q_GETFMT" | "Q_GETINFO" | "Q_SETINFO" | "Q_SYNC"
2920+
| "Q_QUOTAON" | "Q_QUOTAOFF" | "Q_GETQUOTA" | "Q_SETQUOTA" => true,
2921+
2922+
// `SYS_gettid` was removed in Emscripten v1.39.9
2923+
// https://github.com/emscripten-core/emscripten/pull/10439
29362924
"SYS_gettid" => true,
29372925

2938-
// FIXME: These values have been changed
2939-
| "POSIX_MADV_DONTNEED" // to 4
2940-
| "RLIMIT_NLIMITS" // to 16
2941-
| "RLIM_NLIMITS" // to 16
2942-
| "IPPROTO_MAX" // to 263
2943-
| "F_GETLK" // to 5
2944-
| "F_SETLK" // to 6
2945-
| "F_SETLKW" // to 7
2946-
| "O_TMPFILE" // to 65
2947-
| "SIG_IGN" // -1
2948-
=> true,
2926+
// No personality.h
2927+
// https://github.com/emscripten-core/emscripten/pull/17704
2928+
"ADDR_NO_RANDOMIZE" | "MMAP_PAGE_ZERO" | "ADDR_COMPAT_LAYOUT" | "READ_IMPLIES_EXEC"
2929+
| "ADDR_LIMIT_32BIT" | "SHORT_INODE" | "WHOLE_SECONDS" | "STICKY_TIMEOUTS"
2930+
| "ADDR_LIMIT_3GB" => true,
29492931

2950-
// LFS64 types have been removed in Emscripten 3.1.44+
2932+
// `SIG_IGN` has been changed to -2 since 1 is a valid function address
2933+
// https://github.com/emscripten-core/emscripten/pull/14883
2934+
"SIG_IGN" => true,
2935+
2936+
// LFS64 types have been removed in Emscripten 3.1.44
29512937
// https://github.com/emscripten-core/emscripten/pull/19812
29522938
n if n.starts_with("RLIM64") => true,
29532939

@@ -2957,38 +2943,19 @@ fn test_emscripten(target: &str) {
29572943

29582944
cfg.skip_field_type(move |struct_, field| {
29592945
// This is a weird union, don't check the type.
2960-
// FIXME: is this necessary?
29612946
(struct_ == "ifaddrs" && field == "ifa_ifu") ||
29622947
// sighandler_t type is super weird
2963-
// FIXME: is this necessary?
29642948
(struct_ == "sigaction" && field == "sa_sigaction") ||
29652949
// sigval is actually a union, but we pretend it's a struct
2966-
// FIXME: is this necessary?
2967-
(struct_ == "sigevent" && field == "sigev_value") ||
2968-
// aio_buf is "volatile void*" and Rust doesn't understand volatile
2969-
// FIXME: is this necessary?
2970-
(struct_ == "aiocb" && field == "aio_buf")
2950+
(struct_ == "sigevent" && field == "sigev_value")
29712951
});
29722952

29732953
cfg.skip_field(move |struct_, field| {
29742954
// this is actually a union on linux, so we can't represent it well and
29752955
// just insert some padding.
2976-
// FIXME: is this necessary?
29772956
(struct_ == "siginfo_t" && field == "_pad") ||
29782957
// musl names this __dummy1 but it's still there
2979-
// FIXME: is this necessary?
29802958
(struct_ == "glob_t" && field == "gl_flags") ||
2981-
// musl seems to define this as an *anonymous* bitfield
2982-
// FIXME: is this necessary?
2983-
(struct_ == "statvfs" && field == "__f_unused") ||
2984-
// sigev_notify_thread_id is actually part of a sigev_un union
2985-
(struct_ == "sigevent" && field == "sigev_notify_thread_id") ||
2986-
// signalfd had SIGSYS fields added in Linux 4.18, but no libc release has them yet.
2987-
(struct_ == "signalfd_siginfo" && (field == "ssi_addr_lsb" ||
2988-
field == "_pad2" ||
2989-
field == "ssi_syscall" ||
2990-
field == "ssi_call_addr" ||
2991-
field == "ssi_arch")) ||
29922959
// FIXME: After musl 1.1.24, it have only one field `sched_priority`,
29932960
// while other fields become reserved.
29942961
(struct_ == "sched_param" && [
@@ -2999,7 +2966,6 @@ fn test_emscripten(target: &str) {
29992966
].contains(&field))
30002967
});
30012968

3002-
// FIXME: test linux like
30032969
cfg.generate("../src/lib.rs", "main.rs");
30042970
}
30052971

src/unix/linux_like/emscripten/align.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ macro_rules! expand_align {
3838
}
3939

4040
#[allow(missing_debug_implementations)]
41-
#[repr(align(16))]
41+
#[repr(align(8))]
4242
pub struct max_align_t {
43-
priv_: [f64; 4]
43+
priv_: [f64; 3]
4444
}
4545

4646
}

0 commit comments

Comments
 (0)