@@ -2739,7 +2739,6 @@ fn test_emscripten(target: &str) {
2739
2739
cfg. define ( "_GNU_SOURCE" , None ) ; // FIXME: ??
2740
2740
2741
2741
headers ! { cfg:
2742
- "aio.h" ,
2743
2742
"ctype.h" ,
2744
2743
"dirent.h" ,
2745
2744
"dlfcn.h" ,
@@ -2780,32 +2779,21 @@ fn test_emscripten(target: &str) {
2780
2779
"stdio.h" ,
2781
2780
"stdlib.h" ,
2782
2781
"string.h" ,
2783
- "sys/epoll.h" ,
2784
- "sys/eventfd.h" ,
2785
2782
"sys/file.h" ,
2786
2783
"sys/ioctl.h" ,
2787
2784
"sys/ipc.h" ,
2788
2785
"sys/mman.h" ,
2789
2786
"sys/mount.h" ,
2790
2787
"sys/msg.h" ,
2791
- "sys/personality.h" ,
2792
- "sys/prctl.h" ,
2793
- "sys/ptrace.h" ,
2794
- "sys/quota.h" ,
2795
- "sys/reboot.h" ,
2796
2788
"sys/resource.h" ,
2797
2789
"sys/sem.h" ,
2798
2790
"sys/shm.h" ,
2799
- "sys/signalfd.h" ,
2800
2791
"sys/socket.h" ,
2801
2792
"sys/stat.h" ,
2802
2793
"sys/statvfs.h" ,
2803
- "sys/swap.h" ,
2804
2794
"sys/syscall.h" ,
2805
- "sys/sysctl.h" ,
2806
2795
"sys/sysinfo.h" ,
2807
2796
"sys/time.h" ,
2808
- "sys/timerfd.h" ,
2809
2797
"sys/times.h" ,
2810
2798
"sys/types.h" ,
2811
2799
"sys/uio.h" ,
@@ -2831,9 +2819,7 @@ fn test_emscripten(target: &str) {
2831
2819
// Just pass all these through, no need for a "struct" prefix
2832
2820
"FILE" | "fd_set" | "Dl_info" | "DIR" => ty. to_string ( ) ,
2833
2821
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
2837
2823
// https://github.com/emscripten-core/emscripten/pull/19812
2838
2824
"off64_t" => "off_t" . to_string ( ) ,
2839
2825
@@ -2857,7 +2843,7 @@ fn test_emscripten(target: &str) {
2857
2843
s if s. ends_with ( "_nsec" ) && struct_. starts_with ( "stat" ) => {
2858
2844
s. replace ( "e_nsec" , ".tv_nsec" )
2859
2845
}
2860
- // FIXME: appears that `epoll_event.data` is an union
2846
+ // Rust struct uses raw u64, rather than union
2861
2847
"u64" if struct_ == "epoll_event" => "data.u64" . to_string ( ) ,
2862
2848
s => s. to_string ( ) ,
2863
2849
}
@@ -2869,10 +2855,11 @@ fn test_emscripten(target: &str) {
2869
2855
// FIXME: is this necessary?
2870
2856
"sighandler_t" => true ,
2871
2857
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 ,
2874
2861
2875
- // LFS64 types have been removed in Emscripten 3.1.44+
2862
+ // LFS64 types have been removed in Emscripten 3.1.44
2876
2863
// https://github.com/emscripten-core/emscripten/pull/19812
2877
2864
t => t. ends_with ( "64" ) || t. ends_with ( "64_t" ) ,
2878
2865
}
@@ -2881,29 +2868,19 @@ fn test_emscripten(target: &str) {
2881
2868
cfg. skip_struct ( move |ty| {
2882
2869
match ty {
2883
2870
// This is actually a union, not a struct
2884
- // FIXME: is this necessary?
2885
2871
"sigval" => true ,
2886
2872
2887
- // FIXME: It was removed in
2888
- // emscripten-core/emscripten@953e414
2889
- "pthread_mutexattr_t" => true ,
2890
-
2891
2873
// FIXME: Investigate why the test fails.
2892
2874
// Skip for now to unblock CI.
2893
2875
"pthread_condattr_t" => true ,
2876
+ "pthread_mutexattr_t" => true ,
2894
2877
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 ,
2905
2882
2906
- // LFS64 types have been removed in Emscripten 3.1.44+
2883
+ // LFS64 types have been removed in Emscripten 3.1.44
2907
2884
// https://github.com/emscripten-core/emscripten/pull/19812
2908
2885
ty => ty. ends_with ( "64" ) || ty. ends_with ( "64_t" ) ,
2909
2886
}
@@ -2912,12 +2889,9 @@ fn test_emscripten(target: &str) {
2912
2889
cfg. skip_fn ( move |name| {
2913
2890
match name {
2914
2891
// 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
2916
2893
"execv" | "execve" | "execvp" | "execvpe" | "fexecve" | "wait4" => true ,
2917
2894
2918
- // FIXME: Remove after emscripten-core/emscripten#18492 is released (> 3.1.30).
2919
- "clearenv" => true ,
2920
-
2921
2895
_ => false ,
2922
2896
}
2923
2897
} ) ;
@@ -2931,23 +2905,35 @@ fn test_emscripten(target: &str) {
2931
2905
// FIXME: emscripten uses different constants to constructs these
2932
2906
n if n. contains ( "__SIZEOF_PTHREAD" ) => true ,
2933
2907
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
2936
2924
"SYS_gettid" => true ,
2937
2925
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 ,
2949
2931
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
2951
2937
// https://github.com/emscripten-core/emscripten/pull/19812
2952
2938
n if n. starts_with ( "RLIM64" ) => true ,
2953
2939
@@ -2957,38 +2943,19 @@ fn test_emscripten(target: &str) {
2957
2943
2958
2944
cfg. skip_field_type ( move |struct_, field| {
2959
2945
// This is a weird union, don't check the type.
2960
- // FIXME: is this necessary?
2961
2946
( struct_ == "ifaddrs" && field == "ifa_ifu" ) ||
2962
2947
// sighandler_t type is super weird
2963
- // FIXME: is this necessary?
2964
2948
( struct_ == "sigaction" && field == "sa_sigaction" ) ||
2965
2949
// 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" )
2971
2951
} ) ;
2972
2952
2973
2953
cfg. skip_field ( move |struct_, field| {
2974
2954
// this is actually a union on linux, so we can't represent it well and
2975
2955
// just insert some padding.
2976
- // FIXME: is this necessary?
2977
2956
( struct_ == "siginfo_t" && field == "_pad" ) ||
2978
2957
// musl names this __dummy1 but it's still there
2979
- // FIXME: is this necessary?
2980
2958
( 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" ) ) ||
2992
2959
// FIXME: After musl 1.1.24, it have only one field `sched_priority`,
2993
2960
// while other fields become reserved.
2994
2961
( struct_ == "sched_param" && [
@@ -2999,7 +2966,6 @@ fn test_emscripten(target: &str) {
2999
2966
] . contains ( & field) )
3000
2967
} ) ;
3001
2968
3002
- // FIXME: test linux like
3003
2969
cfg. generate ( "../src/lib.rs" , "main.rs" ) ;
3004
2970
}
3005
2971
0 commit comments