@@ -2703,7 +2703,6 @@ fn test_emscripten(target: &str) {
27032703 cfg. define ( "_GNU_SOURCE" , None ) ; // FIXME: ??
27042704
27052705 headers ! { cfg:
2706- "aio.h" ,
27072706 "ctype.h" ,
27082707 "dirent.h" ,
27092708 "dlfcn.h" ,
@@ -2743,32 +2742,21 @@ fn test_emscripten(target: &str) {
27432742 "stdio.h" ,
27442743 "stdlib.h" ,
27452744 "string.h" ,
2746- "sys/epoll.h" ,
2747- "sys/eventfd.h" ,
27482745 "sys/file.h" ,
27492746 "sys/ioctl.h" ,
27502747 "sys/ipc.h" ,
27512748 "sys/mman.h" ,
27522749 "sys/mount.h" ,
27532750 "sys/msg.h" ,
2754- "sys/personality.h" ,
2755- "sys/prctl.h" ,
2756- "sys/ptrace.h" ,
2757- "sys/quota.h" ,
2758- "sys/reboot.h" ,
27592751 "sys/resource.h" ,
27602752 "sys/sem.h" ,
27612753 "sys/shm.h" ,
2762- "sys/signalfd.h" ,
27632754 "sys/socket.h" ,
27642755 "sys/stat.h" ,
27652756 "sys/statvfs.h" ,
2766- "sys/swap.h" ,
27672757 "sys/syscall.h" ,
2768- "sys/sysctl.h" ,
27692758 "sys/sysinfo.h" ,
27702759 "sys/time.h" ,
2771- "sys/timerfd.h" ,
27722760 "sys/times.h" ,
27732761 "sys/types.h" ,
27742762 "sys/uio.h" ,
@@ -2794,9 +2782,7 @@ fn test_emscripten(target: &str) {
27942782 // Just pass all these through, no need for a "struct" prefix
27952783 "FILE" | "fd_set" | "Dl_info" | "DIR" => ty. to_string ( ) ,
27962784
2797- "os_unfair_lock" => "struct os_unfair_lock_s" . to_string ( ) ,
2798-
2799- // LFS64 types have been removed in Emscripten 3.1.44+
2785+ // LFS64 types have been removed in Emscripten 3.1.44
28002786 // https://github.com/emscripten-core/emscripten/pull/19812
28012787 "off64_t" => "off_t" . to_string ( ) ,
28022788
@@ -2820,7 +2806,7 @@ fn test_emscripten(target: &str) {
28202806 s if s. ends_with ( "_nsec" ) && struct_. starts_with ( "stat" ) => {
28212807 s. replace ( "e_nsec" , ".tv_nsec" )
28222808 }
2823- // FIXME: appears that `epoll_event.data` is an union
2809+ // Rust struct uses raw u64, rather than union
28242810 "u64" if struct_ == "epoll_event" => "data.u64" . to_string ( ) ,
28252811 s => s. to_string ( ) ,
28262812 }
@@ -2832,10 +2818,11 @@ fn test_emscripten(target: &str) {
28322818 // FIXME: is this necessary?
28332819 "sighandler_t" => true ,
28342820
2835- // FIXME: The size has been changed due to musl's time64
2836- "time_t" => true ,
2821+ // No epoll support
2822+ // https://github.com/emscripten-core/emscripten/issues/5033
2823+ ty if ty. starts_with ( "epoll" ) => true ,
28372824
2838- // LFS64 types have been removed in Emscripten 3.1.44+
2825+ // LFS64 types have been removed in Emscripten 3.1.44
28392826 // https://github.com/emscripten-core/emscripten/pull/19812
28402827 t => t. ends_with ( "64" ) || t. ends_with ( "64_t" ) ,
28412828 }
@@ -2844,29 +2831,19 @@ fn test_emscripten(target: &str) {
28442831 cfg. skip_struct ( move |ty| {
28452832 match ty {
28462833 // This is actually a union, not a struct
2847- // FIXME: is this necessary?
28482834 "sigval" => true ,
28492835
2850- // FIXME: It was removed in
2851- // emscripten-core/emscripten@953e414
2852- "pthread_mutexattr_t" => true ,
2853-
28542836 // FIXME: Investigate why the test fails.
28552837 // Skip for now to unblock CI.
28562838 "pthread_condattr_t" => true ,
2839+ "pthread_mutexattr_t" => true ,
28572840
2858- // FIXME: The size has been changed when upgraded to musl 1.2.2
2859- "pthread_mutex_t" => true ,
2860-
2861- // FIXME: Lowered from 16 to 8 bytes in
2862- // llvm/llvm-project@d1a96e9
2863- "max_align_t" => true ,
2864-
2865- // FIXME: The size has been changed due to time64
2866- "utimbuf" | "timeval" | "timespec" | "rusage" | "itimerval" | "sched_param"
2867- | "stat" | "stat64" | "shmid_ds" | "msqid_ds" => true ,
2841+ // No epoll support
2842+ // https://github.com/emscripten-core/emscripten/issues/5033
2843+ ty if ty. starts_with ( "epoll" ) => true ,
2844+ ty if ty. starts_with ( "signalfd" ) => true ,
28682845
2869- // LFS64 types have been removed in Emscripten 3.1.44+
2846+ // LFS64 types have been removed in Emscripten 3.1.44
28702847 // https://github.com/emscripten-core/emscripten/pull/19812
28712848 ty => ty. ends_with ( "64" ) || ty. ends_with ( "64_t" ) ,
28722849 }
@@ -2875,12 +2852,9 @@ fn test_emscripten(target: &str) {
28752852 cfg. skip_fn ( move |name| {
28762853 match name {
28772854 // Emscripten does not support fork/exec/wait or any kind of multi-process support
2878- // https://github.com/emscripten-core/emscripten/blob/3.1.30 /tools/system_libs.py#L973
2855+ // https://github.com/emscripten-core/emscripten/blob/3.1.68 /tools/system_libs.py#L1100
28792856 "execv" | "execve" | "execvp" | "execvpe" | "fexecve" | "wait4" => true ,
28802857
2881- // FIXME: Remove after emscripten-core/emscripten#18492 is released (> 3.1.30).
2882- "clearenv" => true ,
2883-
28842858 _ => false ,
28852859 }
28862860 } ) ;
@@ -2894,23 +2868,35 @@ fn test_emscripten(target: &str) {
28942868 // FIXME: emscripten uses different constants to constructs these
28952869 n if n. contains ( "__SIZEOF_PTHREAD" ) => true ,
28962870
2897- // FIXME: `SYS_gettid` was removed in
2898- // emscripten-core/emscripten@6d6474e
2871+ // No epoll support
2872+ // https://github.com/emscripten-core/emscripten/issues/5033
2873+ n if n. starts_with ( "EPOLL" ) => true ,
2874+
2875+ // No ptrace.h
2876+ // https://github.com/emscripten-core/emscripten/pull/17704
2877+ n if n. starts_with ( "PTRACE_" ) => true ,
2878+
2879+ // No quota.h
2880+ // https://github.com/emscripten-core/emscripten/pull/17704
2881+ n if n. starts_with ( "QIF_" ) => true ,
2882+
2883+ // `SYS_gettid` was removed in Emscripten v1.39.9
2884+ // https://github.com/emscripten-core/emscripten/pull/10439
28992885 "SYS_gettid" => true ,
29002886
2901- // FIXME: These values have been changed
2902- | "POSIX_MADV_DONTNEED" // to 4
2903- | "RLIMIT_NLIMITS" // to 16
2904- | "RLIM_NLIMITS" // to 16
2905- | "IPPROTO_MAX" // to 263
2906- | "F_GETLK" // to 5
2907- | "F_SETLK" // to 6
2908- | "F_SETLKW" // to 7
2909- | "O_TMPFILE" // to 65
2910- | "SIG_IGN" // -1
2911- => true ,
2887+ "ADDR_NO_RANDOMIZE" | "MMAP_PAGE_ZERO" | "ADDR_COMPAT_LAYOUT" | "READ_IMPLIES_EXEC"
2888+ | "ADDR_LIMIT_32BIT" | "SHORT_INODE" | "WHOLE_SECONDS" | "STICKY_TIMEOUTS"
2889+ | "ADDR_LIMIT_3GB" => true ,
2890+
2891+ "USRQUOTA" | "GRPQUOTA" => true ,
29122892
2913- // LFS64 types have been removed in Emscripten 3.1.44+
2893+ "Q_GETFMT" | "Q_GETINFO" | "Q_SETINFO" | "Q_SYNC" | "Q_QUOTAON" | "Q_QUOTAOFF"
2894+ | "Q_GETQUOTA" | "Q_SETQUOTA" => true ,
2895+
2896+ // FIXME: https://github.com/emscripten-core/emscripten/pull/14883
2897+ "SIG_IGN" => true ,
2898+
2899+ // LFS64 types have been removed in Emscripten 3.1.44
29142900 // https://github.com/emscripten-core/emscripten/pull/19812
29152901 n if n. starts_with ( "RLIM64" ) => true ,
29162902
@@ -2920,38 +2906,19 @@ fn test_emscripten(target: &str) {
29202906
29212907 cfg. skip_field_type ( move |struct_, field| {
29222908 // This is a weird union, don't check the type.
2923- // FIXME: is this necessary?
29242909 ( struct_ == "ifaddrs" && field == "ifa_ifu" ) ||
29252910 // sighandler_t type is super weird
2926- // FIXME: is this necessary?
29272911 ( struct_ == "sigaction" && field == "sa_sigaction" ) ||
29282912 // sigval is actually a union, but we pretend it's a struct
2929- // FIXME: is this necessary?
2930- ( struct_ == "sigevent" && field == "sigev_value" ) ||
2931- // aio_buf is "volatile void*" and Rust doesn't understand volatile
2932- // FIXME: is this necessary?
2933- ( struct_ == "aiocb" && field == "aio_buf" )
2913+ ( struct_ == "sigevent" && field == "sigev_value" )
29342914 } ) ;
29352915
29362916 cfg. skip_field ( move |struct_, field| {
29372917 // this is actually a union on linux, so we can't represent it well and
29382918 // just insert some padding.
2939- // FIXME: is this necessary?
29402919 ( struct_ == "siginfo_t" && field == "_pad" ) ||
29412920 // musl names this __dummy1 but it's still there
2942- // FIXME: is this necessary?
29432921 ( struct_ == "glob_t" && field == "gl_flags" ) ||
2944- // musl seems to define this as an *anonymous* bitfield
2945- // FIXME: is this necessary?
2946- ( struct_ == "statvfs" && field == "__f_unused" ) ||
2947- // sigev_notify_thread_id is actually part of a sigev_un union
2948- ( struct_ == "sigevent" && field == "sigev_notify_thread_id" ) ||
2949- // signalfd had SIGSYS fields added in Linux 4.18, but no libc release has them yet.
2950- ( struct_ == "signalfd_siginfo" && ( field == "ssi_addr_lsb" ||
2951- field == "_pad2" ||
2952- field == "ssi_syscall" ||
2953- field == "ssi_call_addr" ||
2954- field == "ssi_arch" ) ) ||
29552922 // FIXME: After musl 1.1.24, it have only one field `sched_priority`,
29562923 // while other fields become reserved.
29572924 ( struct_ == "sched_param" && [
@@ -2962,7 +2929,6 @@ fn test_emscripten(target: &str) {
29622929 ] . contains ( & field) )
29632930 } ) ;
29642931
2965- // FIXME: test linux like
29662932 cfg. generate ( "../src/lib.rs" , "main.rs" ) ;
29672933}
29682934
0 commit comments