@@ -2703,7 +2703,6 @@ fn test_emscripten(target: &str) {
2703
2703
cfg. define ( "_GNU_SOURCE" , None ) ; // FIXME: ??
2704
2704
2705
2705
headers ! { cfg:
2706
- "aio.h" ,
2707
2706
"ctype.h" ,
2708
2707
"dirent.h" ,
2709
2708
"dlfcn.h" ,
@@ -2743,32 +2742,21 @@ fn test_emscripten(target: &str) {
2743
2742
"stdio.h" ,
2744
2743
"stdlib.h" ,
2745
2744
"string.h" ,
2746
- "sys/epoll.h" ,
2747
- "sys/eventfd.h" ,
2748
2745
"sys/file.h" ,
2749
2746
"sys/ioctl.h" ,
2750
2747
"sys/ipc.h" ,
2751
2748
"sys/mman.h" ,
2752
2749
"sys/mount.h" ,
2753
2750
"sys/msg.h" ,
2754
- "sys/personality.h" ,
2755
- "sys/prctl.h" ,
2756
- "sys/ptrace.h" ,
2757
- "sys/quota.h" ,
2758
- "sys/reboot.h" ,
2759
2751
"sys/resource.h" ,
2760
2752
"sys/sem.h" ,
2761
2753
"sys/shm.h" ,
2762
- "sys/signalfd.h" ,
2763
2754
"sys/socket.h" ,
2764
2755
"sys/stat.h" ,
2765
2756
"sys/statvfs.h" ,
2766
- "sys/swap.h" ,
2767
2757
"sys/syscall.h" ,
2768
- "sys/sysctl.h" ,
2769
2758
"sys/sysinfo.h" ,
2770
2759
"sys/time.h" ,
2771
- "sys/timerfd.h" ,
2772
2760
"sys/times.h" ,
2773
2761
"sys/types.h" ,
2774
2762
"sys/uio.h" ,
@@ -2794,9 +2782,7 @@ fn test_emscripten(target: &str) {
2794
2782
// Just pass all these through, no need for a "struct" prefix
2795
2783
"FILE" | "fd_set" | "Dl_info" | "DIR" => ty. to_string ( ) ,
2796
2784
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
2800
2786
// https://github.com/emscripten-core/emscripten/pull/19812
2801
2787
"off64_t" => "off_t" . to_string ( ) ,
2802
2788
@@ -2820,7 +2806,7 @@ fn test_emscripten(target: &str) {
2820
2806
s if s. ends_with ( "_nsec" ) && struct_. starts_with ( "stat" ) => {
2821
2807
s. replace ( "e_nsec" , ".tv_nsec" )
2822
2808
}
2823
- // FIXME: appears that `epoll_event.data` is an union
2809
+ // Rust struct uses raw u64, rather than union
2824
2810
"u64" if struct_ == "epoll_event" => "data.u64" . to_string ( ) ,
2825
2811
s => s. to_string ( ) ,
2826
2812
}
@@ -2832,10 +2818,11 @@ fn test_emscripten(target: &str) {
2832
2818
// FIXME: is this necessary?
2833
2819
"sighandler_t" => true ,
2834
2820
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 ,
2837
2824
2838
- // LFS64 types have been removed in Emscripten 3.1.44+
2825
+ // LFS64 types have been removed in Emscripten 3.1.44
2839
2826
// https://github.com/emscripten-core/emscripten/pull/19812
2840
2827
t => t. ends_with ( "64" ) || t. ends_with ( "64_t" ) ,
2841
2828
}
@@ -2844,29 +2831,19 @@ fn test_emscripten(target: &str) {
2844
2831
cfg. skip_struct ( move |ty| {
2845
2832
match ty {
2846
2833
// This is actually a union, not a struct
2847
- // FIXME: is this necessary?
2848
2834
"sigval" => true ,
2849
2835
2850
- // FIXME: It was removed in
2851
- // emscripten-core/emscripten@953e414
2852
- "pthread_mutexattr_t" => true ,
2853
-
2854
2836
// FIXME: Investigate why the test fails.
2855
2837
// Skip for now to unblock CI.
2856
2838
"pthread_condattr_t" => true ,
2839
+ "pthread_mutexattr_t" => true ,
2857
2840
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 ,
2868
2845
2869
- // LFS64 types have been removed in Emscripten 3.1.44+
2846
+ // LFS64 types have been removed in Emscripten 3.1.44
2870
2847
// https://github.com/emscripten-core/emscripten/pull/19812
2871
2848
ty => ty. ends_with ( "64" ) || ty. ends_with ( "64_t" ) ,
2872
2849
}
@@ -2875,12 +2852,9 @@ fn test_emscripten(target: &str) {
2875
2852
cfg. skip_fn ( move |name| {
2876
2853
match name {
2877
2854
// 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
2879
2856
"execv" | "execve" | "execvp" | "execvpe" | "fexecve" | "wait4" => true ,
2880
2857
2881
- // FIXME: Remove after emscripten-core/emscripten#18492 is released (> 3.1.30).
2882
- "clearenv" => true ,
2883
-
2884
2858
_ => false ,
2885
2859
}
2886
2860
} ) ;
@@ -2894,23 +2868,35 @@ fn test_emscripten(target: &str) {
2894
2868
// FIXME: emscripten uses different constants to constructs these
2895
2869
n if n. contains ( "__SIZEOF_PTHREAD" ) => true ,
2896
2870
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
2899
2885
"SYS_gettid" => true ,
2900
2886
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 ,
2912
2892
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
2914
2900
// https://github.com/emscripten-core/emscripten/pull/19812
2915
2901
n if n. starts_with ( "RLIM64" ) => true ,
2916
2902
@@ -2920,38 +2906,19 @@ fn test_emscripten(target: &str) {
2920
2906
2921
2907
cfg. skip_field_type ( move |struct_, field| {
2922
2908
// This is a weird union, don't check the type.
2923
- // FIXME: is this necessary?
2924
2909
( struct_ == "ifaddrs" && field == "ifa_ifu" ) ||
2925
2910
// sighandler_t type is super weird
2926
- // FIXME: is this necessary?
2927
2911
( struct_ == "sigaction" && field == "sa_sigaction" ) ||
2928
2912
// 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" )
2934
2914
} ) ;
2935
2915
2936
2916
cfg. skip_field ( move |struct_, field| {
2937
2917
// this is actually a union on linux, so we can't represent it well and
2938
2918
// just insert some padding.
2939
- // FIXME: is this necessary?
2940
2919
( struct_ == "siginfo_t" && field == "_pad" ) ||
2941
2920
// musl names this __dummy1 but it's still there
2942
- // FIXME: is this necessary?
2943
2921
( 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" ) ) ||
2955
2922
// FIXME: After musl 1.1.24, it have only one field `sched_priority`,
2956
2923
// while other fields become reserved.
2957
2924
( struct_ == "sched_param" && [
@@ -2962,7 +2929,6 @@ fn test_emscripten(target: &str) {
2962
2929
] . contains ( & field) )
2963
2930
} ) ;
2964
2931
2965
- // FIXME: test linux like
2966
2932
cfg. generate ( "../src/lib.rs" , "main.rs" ) ;
2967
2933
}
2968
2934
0 commit comments