@@ -2072,6 +2072,18 @@ fn test_android(target: &str) {
2072
2072
// Added in API level 28, but some tests use level 24.
2073
2073
"fread_unlocked" | "fwrite_unlocked" | "fgets_unlocked" | "fflush_unlocked" => true ,
2074
2074
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
+
2075
2087
// FIXME: bad function pointers:
2076
2088
"isalnum" | "isalpha" | "iscntrl" | "isdigit" | "isgraph" | "islower" | "isprint"
2077
2089
| "ispunct" | "isspace" | "isupper" | "isxdigit" | "isblank" | "tolower"
@@ -2782,7 +2794,6 @@ fn test_emscripten(target: &str) {
2782
2794
cfg. define ( "_GNU_SOURCE" , None ) ; // FIXME: ??
2783
2795
2784
2796
headers ! { cfg:
2785
- "aio.h" ,
2786
2797
"ctype.h" ,
2787
2798
"dirent.h" ,
2788
2799
"dlfcn.h" ,
@@ -2823,32 +2834,21 @@ fn test_emscripten(target: &str) {
2823
2834
"stdio.h" ,
2824
2835
"stdlib.h" ,
2825
2836
"string.h" ,
2826
- "sys/epoll.h" ,
2827
- "sys/eventfd.h" ,
2828
2837
"sys/file.h" ,
2829
2838
"sys/ioctl.h" ,
2830
2839
"sys/ipc.h" ,
2831
2840
"sys/mman.h" ,
2832
2841
"sys/mount.h" ,
2833
2842
"sys/msg.h" ,
2834
- "sys/personality.h" ,
2835
- "sys/prctl.h" ,
2836
- "sys/ptrace.h" ,
2837
- "sys/quota.h" ,
2838
- "sys/reboot.h" ,
2839
2843
"sys/resource.h" ,
2840
2844
"sys/sem.h" ,
2841
2845
"sys/shm.h" ,
2842
- "sys/signalfd.h" ,
2843
2846
"sys/socket.h" ,
2844
2847
"sys/stat.h" ,
2845
2848
"sys/statvfs.h" ,
2846
- "sys/swap.h" ,
2847
2849
"sys/syscall.h" ,
2848
- "sys/sysctl.h" ,
2849
2850
"sys/sysinfo.h" ,
2850
2851
"sys/time.h" ,
2851
- "sys/timerfd.h" ,
2852
2852
"sys/times.h" ,
2853
2853
"sys/types.h" ,
2854
2854
"sys/uio.h" ,
@@ -2874,9 +2874,7 @@ fn test_emscripten(target: &str) {
2874
2874
// Just pass all these through, no need for a "struct" prefix
2875
2875
"FILE" | "fd_set" | "Dl_info" | "DIR" => ty. to_string ( ) ,
2876
2876
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
2880
2878
// https://github.com/emscripten-core/emscripten/pull/19812
2881
2879
"off64_t" => "off_t" . to_string ( ) ,
2882
2880
@@ -2900,7 +2898,7 @@ fn test_emscripten(target: &str) {
2900
2898
s if s. ends_with ( "_nsec" ) && struct_. starts_with ( "stat" ) => {
2901
2899
s. replace ( "e_nsec" , ".tv_nsec" )
2902
2900
}
2903
- // FIXME: appears that `epoll_event.data` is an union
2901
+ // Rust struct uses raw u64, rather than union
2904
2902
"u64" if struct_ == "epoll_event" => "data.u64" . to_string ( ) ,
2905
2903
s => s. to_string ( ) ,
2906
2904
}
@@ -2912,10 +2910,11 @@ fn test_emscripten(target: &str) {
2912
2910
// FIXME: is this necessary?
2913
2911
"sighandler_t" => true ,
2914
2912
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 ,
2917
2916
2918
- // LFS64 types have been removed in Emscripten 3.1.44+
2917
+ // LFS64 types have been removed in Emscripten 3.1.44
2919
2918
// https://github.com/emscripten-core/emscripten/pull/19812
2920
2919
t => t. ends_with ( "64" ) || t. ends_with ( "64_t" ) ,
2921
2920
}
@@ -2924,29 +2923,19 @@ fn test_emscripten(target: &str) {
2924
2923
cfg. skip_struct ( move |ty| {
2925
2924
match ty {
2926
2925
// This is actually a union, not a struct
2927
- // FIXME: is this necessary?
2928
2926
"sigval" => true ,
2929
2927
2930
- // FIXME: It was removed in
2931
- // emscripten-core/emscripten@953e414
2932
- "pthread_mutexattr_t" => true ,
2933
-
2934
2928
// FIXME: Investigate why the test fails.
2935
2929
// Skip for now to unblock CI.
2936
2930
"pthread_condattr_t" => true ,
2931
+ "pthread_mutexattr_t" => true ,
2937
2932
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 ,
2948
2937
2949
- // LFS64 types have been removed in Emscripten 3.1.44+
2938
+ // LFS64 types have been removed in Emscripten 3.1.44
2950
2939
// https://github.com/emscripten-core/emscripten/pull/19812
2951
2940
ty => ty. ends_with ( "64" ) || ty. ends_with ( "64_t" ) ,
2952
2941
}
@@ -2955,12 +2944,9 @@ fn test_emscripten(target: &str) {
2955
2944
cfg. skip_fn ( move |name| {
2956
2945
match name {
2957
2946
// 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
2959
2948
"execv" | "execve" | "execvp" | "execvpe" | "fexecve" | "wait4" => true ,
2960
2949
2961
- // FIXME: Remove after emscripten-core/emscripten#18492 is released (> 3.1.30).
2962
- "clearenv" => true ,
2963
-
2964
2950
_ => false ,
2965
2951
}
2966
2952
} ) ;
@@ -2974,23 +2960,35 @@ fn test_emscripten(target: &str) {
2974
2960
// FIXME: emscripten uses different constants to constructs these
2975
2961
n if n. contains ( "__SIZEOF_PTHREAD" ) => true ,
2976
2962
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
2979
2979
"SYS_gettid" => true ,
2980
2980
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 ,
2992
2986
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
2994
2992
// https://github.com/emscripten-core/emscripten/pull/19812
2995
2993
n if n. starts_with ( "RLIM64" ) => true ,
2996
2994
@@ -3000,38 +2998,19 @@ fn test_emscripten(target: &str) {
3000
2998
3001
2999
cfg. skip_field_type ( move |struct_, field| {
3002
3000
// This is a weird union, don't check the type.
3003
- // FIXME: is this necessary?
3004
3001
( struct_ == "ifaddrs" && field == "ifa_ifu" ) ||
3005
3002
// sighandler_t type is super weird
3006
- // FIXME: is this necessary?
3007
3003
( struct_ == "sigaction" && field == "sa_sigaction" ) ||
3008
3004
// 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" )
3014
3006
} ) ;
3015
3007
3016
3008
cfg. skip_field ( move |struct_, field| {
3017
3009
// this is actually a union on linux, so we can't represent it well and
3018
3010
// just insert some padding.
3019
- // FIXME: is this necessary?
3020
3011
( struct_ == "siginfo_t" && field == "_pad" ) ||
3021
3012
// musl names this __dummy1 but it's still there
3022
- // FIXME: is this necessary?
3023
3013
( 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" ) ) ||
3035
3014
// FIXME: After musl 1.1.24, it have only one field `sched_priority`,
3036
3015
// while other fields become reserved.
3037
3016
( struct_ == "sched_param" && [
@@ -3042,7 +3021,6 @@ fn test_emscripten(target: &str) {
3042
3021
] . contains ( & field) )
3043
3022
} ) ;
3044
3023
3045
- // FIXME: test linux like
3046
3024
cfg. generate ( "../src/lib.rs" , "main.rs" ) ;
3047
3025
}
3048
3026
0 commit comments