@@ -2072,6 +2072,18 @@ fn test_android(target: &str) {
20722072 // Added in API level 28, but some tests use level 24.
20732073 "fread_unlocked" | "fwrite_unlocked" | "fgets_unlocked" | "fflush_unlocked" => true ,
20742074
2075+ // Added in API level 28, but some tests use level 24.
2076+ "aligned_alloc" => true ,
2077+
2078+ // Added in API level 26, but some tests use level 24.
2079+ "getgrent" => true ,
2080+
2081+ // Added in API level 26, but some tests use level 24.
2082+ "setgrent" => true ,
2083+
2084+ // Added in API level 26, but some tests use level 24.
2085+ "endgrent" => true ,
2086+
20752087 // FIXME: bad function pointers:
20762088 "isalnum" | "isalpha" | "iscntrl" | "isdigit" | "isgraph" | "islower" | "isprint"
20772089 | "ispunct" | "isspace" | "isupper" | "isxdigit" | "isblank" | "tolower"
@@ -2782,7 +2794,6 @@ fn test_emscripten(target: &str) {
27822794 cfg. define ( "_GNU_SOURCE" , None ) ; // FIXME: ??
27832795
27842796 headers ! { cfg:
2785- "aio.h" ,
27862797 "ctype.h" ,
27872798 "dirent.h" ,
27882799 "dlfcn.h" ,
@@ -2823,32 +2834,21 @@ fn test_emscripten(target: &str) {
28232834 "stdio.h" ,
28242835 "stdlib.h" ,
28252836 "string.h" ,
2826- "sys/epoll.h" ,
2827- "sys/eventfd.h" ,
28282837 "sys/file.h" ,
28292838 "sys/ioctl.h" ,
28302839 "sys/ipc.h" ,
28312840 "sys/mman.h" ,
28322841 "sys/mount.h" ,
28332842 "sys/msg.h" ,
2834- "sys/personality.h" ,
2835- "sys/prctl.h" ,
2836- "sys/ptrace.h" ,
2837- "sys/quota.h" ,
2838- "sys/reboot.h" ,
28392843 "sys/resource.h" ,
28402844 "sys/sem.h" ,
28412845 "sys/shm.h" ,
2842- "sys/signalfd.h" ,
28432846 "sys/socket.h" ,
28442847 "sys/stat.h" ,
28452848 "sys/statvfs.h" ,
2846- "sys/swap.h" ,
28472849 "sys/syscall.h" ,
2848- "sys/sysctl.h" ,
28492850 "sys/sysinfo.h" ,
28502851 "sys/time.h" ,
2851- "sys/timerfd.h" ,
28522852 "sys/times.h" ,
28532853 "sys/types.h" ,
28542854 "sys/uio.h" ,
@@ -2874,9 +2874,7 @@ fn test_emscripten(target: &str) {
28742874 // Just pass all these through, no need for a "struct" prefix
28752875 "FILE" | "fd_set" | "Dl_info" | "DIR" => ty. to_string ( ) ,
28762876
2877- "os_unfair_lock" => "struct os_unfair_lock_s" . to_string ( ) ,
2878-
2879- // LFS64 types have been removed in Emscripten 3.1.44+
2877+ // LFS64 types have been removed in Emscripten 3.1.44
28802878 // https://github.com/emscripten-core/emscripten/pull/19812
28812879 "off64_t" => "off_t" . to_string ( ) ,
28822880
@@ -2900,7 +2898,7 @@ fn test_emscripten(target: &str) {
29002898 s if s. ends_with ( "_nsec" ) && struct_. starts_with ( "stat" ) => {
29012899 s. replace ( "e_nsec" , ".tv_nsec" )
29022900 }
2903- // FIXME: appears that `epoll_event.data` is an union
2901+ // Rust struct uses raw u64, rather than union
29042902 "u64" if struct_ == "epoll_event" => "data.u64" . to_string ( ) ,
29052903 s => s. to_string ( ) ,
29062904 }
@@ -2912,10 +2910,11 @@ fn test_emscripten(target: &str) {
29122910 // FIXME: is this necessary?
29132911 "sighandler_t" => true ,
29142912
2915- // FIXME: The size has been changed due to musl's time64
2916- "time_t" => true ,
2913+ // No epoll support
2914+ // https://github.com/emscripten-core/emscripten/issues/5033
2915+ ty if ty. starts_with ( "epoll" ) => true ,
29172916
2918- // LFS64 types have been removed in Emscripten 3.1.44+
2917+ // LFS64 types have been removed in Emscripten 3.1.44
29192918 // https://github.com/emscripten-core/emscripten/pull/19812
29202919 t => t. ends_with ( "64" ) || t. ends_with ( "64_t" ) ,
29212920 }
@@ -2924,29 +2923,19 @@ fn test_emscripten(target: &str) {
29242923 cfg. skip_struct ( move |ty| {
29252924 match ty {
29262925 // This is actually a union, not a struct
2927- // FIXME: is this necessary?
29282926 "sigval" => true ,
29292927
2930- // FIXME: It was removed in
2931- // emscripten-core/emscripten@953e414
2932- "pthread_mutexattr_t" => true ,
2933-
29342928 // FIXME: Investigate why the test fails.
29352929 // Skip for now to unblock CI.
29362930 "pthread_condattr_t" => true ,
2931+ "pthread_mutexattr_t" => true ,
29372932
2938- // FIXME: The size has been changed when upgraded to musl 1.2.2
2939- "pthread_mutex_t" => true ,
2940-
2941- // FIXME: Lowered from 16 to 8 bytes in
2942- // llvm/llvm-project@d1a96e9
2943- "max_align_t" => true ,
2944-
2945- // FIXME: The size has been changed due to time64
2946- "utimbuf" | "timeval" | "timespec" | "rusage" | "itimerval" | "sched_param"
2947- | "stat" | "stat64" | "shmid_ds" | "msqid_ds" => true ,
2933+ // No epoll support
2934+ // https://github.com/emscripten-core/emscripten/issues/5033
2935+ ty if ty. starts_with ( "epoll" ) => true ,
2936+ ty if ty. starts_with ( "signalfd" ) => true ,
29482937
2949- // LFS64 types have been removed in Emscripten 3.1.44+
2938+ // LFS64 types have been removed in Emscripten 3.1.44
29502939 // https://github.com/emscripten-core/emscripten/pull/19812
29512940 ty => ty. ends_with ( "64" ) || ty. ends_with ( "64_t" ) ,
29522941 }
@@ -2955,12 +2944,9 @@ fn test_emscripten(target: &str) {
29552944 cfg. skip_fn ( move |name| {
29562945 match name {
29572946 // Emscripten does not support fork/exec/wait or any kind of multi-process support
2958- // https://github.com/emscripten-core/emscripten/blob/3.1.30 /tools/system_libs.py#L973
2947+ // https://github.com/emscripten-core/emscripten/blob/3.1.68 /tools/system_libs.py#L1100
29592948 "execv" | "execve" | "execvp" | "execvpe" | "fexecve" | "wait4" => true ,
29602949
2961- // FIXME: Remove after emscripten-core/emscripten#18492 is released (> 3.1.30).
2962- "clearenv" => true ,
2963-
29642950 _ => false ,
29652951 }
29662952 } ) ;
@@ -2974,23 +2960,35 @@ fn test_emscripten(target: &str) {
29742960 // FIXME: emscripten uses different constants to constructs these
29752961 n if n. contains ( "__SIZEOF_PTHREAD" ) => true ,
29762962
2977- // FIXME: `SYS_gettid` was removed in
2978- // emscripten-core/emscripten@6d6474e
2963+ // No epoll support
2964+ // https://github.com/emscripten-core/emscripten/issues/5033
2965+ n if n. starts_with ( "EPOLL" ) => true ,
2966+
2967+ // No ptrace.h
2968+ // https://github.com/emscripten-core/emscripten/pull/17704
2969+ n if n. starts_with ( "PTRACE_" ) => true ,
2970+
2971+ // No quota.h
2972+ // https://github.com/emscripten-core/emscripten/pull/17704
2973+ n if n. starts_with ( "QIF_" ) => true ,
2974+ "USRQUOTA" | "GRPQUOTA" | "Q_GETFMT" | "Q_GETINFO" | "Q_SETINFO" | "Q_SYNC"
2975+ | "Q_QUOTAON" | "Q_QUOTAOFF" | "Q_GETQUOTA" | "Q_SETQUOTA" => true ,
2976+
2977+ // `SYS_gettid` was removed in Emscripten v1.39.9
2978+ // https://github.com/emscripten-core/emscripten/pull/10439
29792979 "SYS_gettid" => true ,
29802980
2981- // FIXME: These values have been changed
2982- | "POSIX_MADV_DONTNEED" // to 4
2983- | "RLIMIT_NLIMITS" // to 16
2984- | "RLIM_NLIMITS" // to 16
2985- | "IPPROTO_MAX" // to 263
2986- | "F_GETLK" // to 5
2987- | "F_SETLK" // to 6
2988- | "F_SETLKW" // to 7
2989- | "O_TMPFILE" // to 65
2990- | "SIG_IGN" // -1
2991- => true ,
2981+ // No personality.h
2982+ // https://github.com/emscripten-core/emscripten/pull/17704
2983+ "ADDR_NO_RANDOMIZE" | "MMAP_PAGE_ZERO" | "ADDR_COMPAT_LAYOUT" | "READ_IMPLIES_EXEC"
2984+ | "ADDR_LIMIT_32BIT" | "SHORT_INODE" | "WHOLE_SECONDS" | "STICKY_TIMEOUTS"
2985+ | "ADDR_LIMIT_3GB" => true ,
29922986
2993- // LFS64 types have been removed in Emscripten 3.1.44+
2987+ // `SIG_IGN` has been changed to -2 since 1 is a valid function address
2988+ // https://github.com/emscripten-core/emscripten/pull/14883
2989+ "SIG_IGN" => true ,
2990+
2991+ // LFS64 types have been removed in Emscripten 3.1.44
29942992 // https://github.com/emscripten-core/emscripten/pull/19812
29952993 n if n. starts_with ( "RLIM64" ) => true ,
29962994
@@ -3000,38 +2998,19 @@ fn test_emscripten(target: &str) {
30002998
30012999 cfg. skip_field_type ( move |struct_, field| {
30023000 // This is a weird union, don't check the type.
3003- // FIXME: is this necessary?
30043001 ( struct_ == "ifaddrs" && field == "ifa_ifu" ) ||
30053002 // sighandler_t type is super weird
3006- // FIXME: is this necessary?
30073003 ( struct_ == "sigaction" && field == "sa_sigaction" ) ||
30083004 // sigval is actually a union, but we pretend it's a struct
3009- // FIXME: is this necessary?
3010- ( struct_ == "sigevent" && field == "sigev_value" ) ||
3011- // aio_buf is "volatile void*" and Rust doesn't understand volatile
3012- // FIXME: is this necessary?
3013- ( struct_ == "aiocb" && field == "aio_buf" )
3005+ ( struct_ == "sigevent" && field == "sigev_value" )
30143006 } ) ;
30153007
30163008 cfg. skip_field ( move |struct_, field| {
30173009 // this is actually a union on linux, so we can't represent it well and
30183010 // just insert some padding.
3019- // FIXME: is this necessary?
30203011 ( struct_ == "siginfo_t" && field == "_pad" ) ||
30213012 // musl names this __dummy1 but it's still there
3022- // FIXME: is this necessary?
30233013 ( struct_ == "glob_t" && field == "gl_flags" ) ||
3024- // musl seems to define this as an *anonymous* bitfield
3025- // FIXME: is this necessary?
3026- ( struct_ == "statvfs" && field == "__f_unused" ) ||
3027- // sigev_notify_thread_id is actually part of a sigev_un union
3028- ( struct_ == "sigevent" && field == "sigev_notify_thread_id" ) ||
3029- // signalfd had SIGSYS fields added in Linux 4.18, but no libc release has them yet.
3030- ( struct_ == "signalfd_siginfo" && ( field == "ssi_addr_lsb" ||
3031- field == "_pad2" ||
3032- field == "ssi_syscall" ||
3033- field == "ssi_call_addr" ||
3034- field == "ssi_arch" ) ) ||
30353014 // FIXME: After musl 1.1.24, it have only one field `sched_priority`,
30363015 // while other fields become reserved.
30373016 ( struct_ == "sched_param" && [
@@ -3042,7 +3021,6 @@ fn test_emscripten(target: &str) {
30423021 ] . contains ( & field) )
30433022 } ) ;
30443023
3045- // FIXME: test linux like
30463024 cfg. generate ( "../src/lib.rs" , "main.rs" ) ;
30473025}
30483026
0 commit comments