@@ -2719,7 +2719,6 @@ fn test_emscripten(target: &str) {
2719
2719
cfg. define ( "_GNU_SOURCE" , None ) ; // FIXME: ??
2720
2720
2721
2721
headers ! { cfg:
2722
- "aio.h" ,
2723
2722
"ctype.h" ,
2724
2723
"dirent.h" ,
2725
2724
"dlfcn.h" ,
@@ -2760,32 +2759,21 @@ fn test_emscripten(target: &str) {
2760
2759
"stdio.h" ,
2761
2760
"stdlib.h" ,
2762
2761
"string.h" ,
2763
- "sys/epoll.h" ,
2764
- "sys/eventfd.h" ,
2765
2762
"sys/file.h" ,
2766
2763
"sys/ioctl.h" ,
2767
2764
"sys/ipc.h" ,
2768
2765
"sys/mman.h" ,
2769
2766
"sys/mount.h" ,
2770
2767
"sys/msg.h" ,
2771
- "sys/personality.h" ,
2772
- "sys/prctl.h" ,
2773
- "sys/ptrace.h" ,
2774
- "sys/quota.h" ,
2775
- "sys/reboot.h" ,
2776
2768
"sys/resource.h" ,
2777
2769
"sys/sem.h" ,
2778
2770
"sys/shm.h" ,
2779
- "sys/signalfd.h" ,
2780
2771
"sys/socket.h" ,
2781
2772
"sys/stat.h" ,
2782
2773
"sys/statvfs.h" ,
2783
- "sys/swap.h" ,
2784
2774
"sys/syscall.h" ,
2785
- "sys/sysctl.h" ,
2786
2775
"sys/sysinfo.h" ,
2787
2776
"sys/time.h" ,
2788
- "sys/timerfd.h" ,
2789
2777
"sys/times.h" ,
2790
2778
"sys/types.h" ,
2791
2779
"sys/uio.h" ,
@@ -2811,9 +2799,7 @@ fn test_emscripten(target: &str) {
2811
2799
// Just pass all these through, no need for a "struct" prefix
2812
2800
"FILE" | "fd_set" | "Dl_info" | "DIR" => ty. to_string ( ) ,
2813
2801
2814
- "os_unfair_lock" => "struct os_unfair_lock_s" . to_string ( ) ,
2815
-
2816
- // LFS64 types have been removed in Emscripten 3.1.44+
2802
+ // LFS64 types have been removed in Emscripten 3.1.44
2817
2803
// https://github.com/emscripten-core/emscripten/pull/19812
2818
2804
"off64_t" => "off_t" . to_string ( ) ,
2819
2805
@@ -2837,7 +2823,7 @@ fn test_emscripten(target: &str) {
2837
2823
s if s. ends_with ( "_nsec" ) && struct_. starts_with ( "stat" ) => {
2838
2824
s. replace ( "e_nsec" , ".tv_nsec" )
2839
2825
}
2840
- // FIXME: appears that `epoll_event.data` is an union
2826
+ // Rust struct uses raw u64, rather than union
2841
2827
"u64" if struct_ == "epoll_event" => "data.u64" . to_string ( ) ,
2842
2828
s => s. to_string ( ) ,
2843
2829
}
@@ -2849,10 +2835,11 @@ fn test_emscripten(target: &str) {
2849
2835
// FIXME: is this necessary?
2850
2836
"sighandler_t" => true ,
2851
2837
2852
- // FIXME: The size has been changed due to musl's time64
2853
- "time_t" => true ,
2838
+ // No epoll support
2839
+ // https://github.com/emscripten-core/emscripten/issues/5033
2840
+ ty if ty. starts_with ( "epoll" ) => true ,
2854
2841
2855
- // LFS64 types have been removed in Emscripten 3.1.44+
2842
+ // LFS64 types have been removed in Emscripten 3.1.44
2856
2843
// https://github.com/emscripten-core/emscripten/pull/19812
2857
2844
t => t. ends_with ( "64" ) || t. ends_with ( "64_t" ) ,
2858
2845
}
@@ -2861,29 +2848,19 @@ fn test_emscripten(target: &str) {
2861
2848
cfg. skip_struct ( move |ty| {
2862
2849
match ty {
2863
2850
// This is actually a union, not a struct
2864
- // FIXME: is this necessary?
2865
2851
"sigval" => true ,
2866
2852
2867
- // FIXME: It was removed in
2868
- // emscripten-core/emscripten@953e414
2869
- "pthread_mutexattr_t" => true ,
2870
-
2871
2853
// FIXME: Investigate why the test fails.
2872
2854
// Skip for now to unblock CI.
2873
2855
"pthread_condattr_t" => true ,
2856
+ "pthread_mutexattr_t" => true ,
2874
2857
2875
- // FIXME: The size has been changed when upgraded to musl 1.2.2
2876
- "pthread_mutex_t" => true ,
2877
-
2878
- // FIXME: Lowered from 16 to 8 bytes in
2879
- // llvm/llvm-project@d1a96e9
2880
- "max_align_t" => true ,
2881
-
2882
- // FIXME: The size has been changed due to time64
2883
- "utimbuf" | "timeval" | "timespec" | "rusage" | "itimerval" | "sched_param"
2884
- | "stat" | "stat64" | "shmid_ds" | "msqid_ds" => true ,
2858
+ // No epoll support
2859
+ // https://github.com/emscripten-core/emscripten/issues/5033
2860
+ ty if ty. starts_with ( "epoll" ) => true ,
2861
+ ty if ty. starts_with ( "signalfd" ) => true ,
2885
2862
2886
- // LFS64 types have been removed in Emscripten 3.1.44+
2863
+ // LFS64 types have been removed in Emscripten 3.1.44
2887
2864
// https://github.com/emscripten-core/emscripten/pull/19812
2888
2865
ty => ty. ends_with ( "64" ) || ty. ends_with ( "64_t" ) ,
2889
2866
}
@@ -2892,12 +2869,9 @@ fn test_emscripten(target: &str) {
2892
2869
cfg. skip_fn ( move |name| {
2893
2870
match name {
2894
2871
// Emscripten does not support fork/exec/wait or any kind of multi-process support
2895
- // https://github.com/emscripten-core/emscripten/blob/3.1.30 /tools/system_libs.py#L973
2872
+ // https://github.com/emscripten-core/emscripten/blob/3.1.68 /tools/system_libs.py#L1100
2896
2873
"execv" | "execve" | "execvp" | "execvpe" | "fexecve" | "wait4" => true ,
2897
2874
2898
- // FIXME: Remove after emscripten-core/emscripten#18492 is released (> 3.1.30).
2899
- "clearenv" => true ,
2900
-
2901
2875
_ => false ,
2902
2876
}
2903
2877
} ) ;
@@ -2911,23 +2885,35 @@ fn test_emscripten(target: &str) {
2911
2885
// FIXME: emscripten uses different constants to constructs these
2912
2886
n if n. contains ( "__SIZEOF_PTHREAD" ) => true ,
2913
2887
2914
- // FIXME: `SYS_gettid` was removed in
2915
- // emscripten-core/emscripten@6d6474e
2888
+ // No epoll support
2889
+ // https://github.com/emscripten-core/emscripten/issues/5033
2890
+ n if n. starts_with ( "EPOLL" ) => true ,
2891
+
2892
+ // No ptrace.h
2893
+ // https://github.com/emscripten-core/emscripten/pull/17704
2894
+ n if n. starts_with ( "PTRACE_" ) => true ,
2895
+
2896
+ // No quota.h
2897
+ // https://github.com/emscripten-core/emscripten/pull/17704
2898
+ n if n. starts_with ( "QIF_" ) => true ,
2899
+
2900
+ // `SYS_gettid` was removed in Emscripten v1.39.9
2901
+ // https://github.com/emscripten-core/emscripten/pull/10439
2916
2902
"SYS_gettid" => true ,
2917
2903
2918
- // FIXME: These values have been changed
2919
- | "POSIX_MADV_DONTNEED" // to 4
2920
- | "RLIMIT_NLIMITS" // to 16
2921
- | "RLIM_NLIMITS" // to 16
2922
- | "IPPROTO_MAX" // to 263
2923
- | "F_GETLK" // to 5
2924
- | "F_SETLK" // to 6
2925
- | "F_SETLKW" // to 7
2926
- | "O_TMPFILE" // to 65
2927
- | "SIG_IGN" // -1
2928
- => true ,
2904
+ "ADDR_NO_RANDOMIZE" | "MMAP_PAGE_ZERO" | "ADDR_COMPAT_LAYOUT" | "READ_IMPLIES_EXEC"
2905
+ | "ADDR_LIMIT_32BIT" | "SHORT_INODE" | "WHOLE_SECONDS" | "STICKY_TIMEOUTS"
2906
+ | "ADDR_LIMIT_3GB" => true ,
2907
+
2908
+ "USRQUOTA" | "GRPQUOTA" => true ,
2929
2909
2930
- // LFS64 types have been removed in Emscripten 3.1.44+
2910
+ "Q_GETFMT" | "Q_GETINFO" | "Q_SETINFO" | "Q_SYNC" | "Q_QUOTAON" | "Q_QUOTAOFF"
2911
+ | "Q_GETQUOTA" | "Q_SETQUOTA" => true ,
2912
+
2913
+ // FIXME: https://github.com/emscripten-core/emscripten/pull/14883
2914
+ "SIG_IGN" => true ,
2915
+
2916
+ // LFS64 types have been removed in Emscripten 3.1.44
2931
2917
// https://github.com/emscripten-core/emscripten/pull/19812
2932
2918
n if n. starts_with ( "RLIM64" ) => true ,
2933
2919
@@ -2937,38 +2923,19 @@ fn test_emscripten(target: &str) {
2937
2923
2938
2924
cfg. skip_field_type ( move |struct_, field| {
2939
2925
// This is a weird union, don't check the type.
2940
- // FIXME: is this necessary?
2941
2926
( struct_ == "ifaddrs" && field == "ifa_ifu" ) ||
2942
2927
// sighandler_t type is super weird
2943
- // FIXME: is this necessary?
2944
2928
( struct_ == "sigaction" && field == "sa_sigaction" ) ||
2945
2929
// sigval is actually a union, but we pretend it's a struct
2946
- // FIXME: is this necessary?
2947
- ( struct_ == "sigevent" && field == "sigev_value" ) ||
2948
- // aio_buf is "volatile void*" and Rust doesn't understand volatile
2949
- // FIXME: is this necessary?
2950
- ( struct_ == "aiocb" && field == "aio_buf" )
2930
+ ( struct_ == "sigevent" && field == "sigev_value" )
2951
2931
} ) ;
2952
2932
2953
2933
cfg. skip_field ( move |struct_, field| {
2954
2934
// this is actually a union on linux, so we can't represent it well and
2955
2935
// just insert some padding.
2956
- // FIXME: is this necessary?
2957
2936
( struct_ == "siginfo_t" && field == "_pad" ) ||
2958
2937
// musl names this __dummy1 but it's still there
2959
- // FIXME: is this necessary?
2960
2938
( struct_ == "glob_t" && field == "gl_flags" ) ||
2961
- // musl seems to define this as an *anonymous* bitfield
2962
- // FIXME: is this necessary?
2963
- ( struct_ == "statvfs" && field == "__f_unused" ) ||
2964
- // sigev_notify_thread_id is actually part of a sigev_un union
2965
- ( struct_ == "sigevent" && field == "sigev_notify_thread_id" ) ||
2966
- // signalfd had SIGSYS fields added in Linux 4.18, but no libc release has them yet.
2967
- ( struct_ == "signalfd_siginfo" && ( field == "ssi_addr_lsb" ||
2968
- field == "_pad2" ||
2969
- field == "ssi_syscall" ||
2970
- field == "ssi_call_addr" ||
2971
- field == "ssi_arch" ) ) ||
2972
2939
// FIXME: After musl 1.1.24, it have only one field `sched_priority`,
2973
2940
// while other fields become reserved.
2974
2941
( struct_ == "sched_param" && [
@@ -2979,7 +2946,6 @@ fn test_emscripten(target: &str) {
2979
2946
] . contains ( & field) )
2980
2947
} ) ;
2981
2948
2982
- // FIXME: test linux like
2983
2949
cfg. generate ( "../src/lib.rs" , "main.rs" ) ;
2984
2950
}
2985
2951
0 commit comments