@@ -2473,6 +2473,9 @@ fn test_emscripten(target: &str) {
24732473 // FIXME: is this necessary?
24742474 "sighandler_t" => true ,
24752475
2476+ // FIXME: The size has been changed due to musl's time64
2477+ "time_t" => true ,
2478+
24762479 _ => false ,
24772480 }
24782481 } ) ;
@@ -2491,6 +2494,16 @@ fn test_emscripten(target: &str) {
24912494 // Skip for now to unblock CI.
24922495 "pthread_condattr_t" => true ,
24932496
2497+ // FIXME: The size has been changed when upgraded to musl 1.2.2
2498+ "pthread_mutex_t" => true ,
2499+
2500+ // FIXME: The size has been changed
2501+ "max_align_t" => true ,
2502+
2503+ // FIXME: The size has been changed due to time64
2504+ "utimbuf" | "timeval" | "timespec" | "rusage" | "itimerval" | "sched_param"
2505+ | "stat" | "stat64" | "shmid_ds" | "msqid_ds" => true ,
2506+
24942507 _ => false ,
24952508 }
24962509 } ) ;
@@ -2503,6 +2516,14 @@ fn test_emscripten(target: &str) {
25032516 // FIXME: Investigate why CI is missing it.
25042517 "clearenv" => true ,
25052518
2519+ // FIXME: Somehow the ctest cannot find it on emscripten:
2520+ // = note: error: undefined symbol: wait4 (referenced by top-level compiled C/C++ code)
2521+ // warning: Link with `-sLLD_REPORT_UNDEFINED` to get more information on undefined symbols
2522+ // warning: To disable errors for undefined symbols use `-sERROR_ON_UNDEFINED_SYMBOLS=0`
2523+ // warning: _wait4 may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
2524+ // Error: Aborting compilation due to previous errors
2525+ "wait4" => true ,
2526+
25062527 _ => false ,
25072528 }
25082529 } ) ;
@@ -2520,6 +2541,18 @@ fn test_emscripten(target: &str) {
25202541 // emscripten-core/emscripten@6d6474e
25212542 "SYS_gettid" => true ,
25222543
2544+ // FIXME: These values have been changed
2545+ | "POSIX_MADV_DONTNEED" // to 4
2546+ | "RLIMIT_NLIMITS" // to 16
2547+ | "RLIM_NLIMITS" // to 16
2548+ | "IPPROTO_MAX" // to 263
2549+ | "F_GETLK" // to 5
2550+ | "F_SETLK" // to 6
2551+ | "F_SETLKW" // to 7
2552+ | "O_TMPFILE" // to 65
2553+ | "SIG_IGN" // -1
2554+ => true ,
2555+
25232556 _ => false ,
25242557 }
25252558 } ) ;
@@ -2703,14 +2736,15 @@ fn test_linux(target: &str) {
27032736 let mips = target. contains ( "mips" ) ;
27042737 let mips32 = mips && !target. contains ( "64" ) ;
27052738 let mips64 = mips && target. contains ( "64" ) ;
2739+ let ppc = target. contains ( "powerpc" ) ;
27062740 let ppc64 = target. contains ( "powerpc64" ) ;
27072741 let s390x = target. contains ( "s390x" ) ;
27082742 let sparc64 = target. contains ( "sparc64" ) ;
27092743 let x32 = target. contains ( "x32" ) ;
27102744 let x86_32 = target. contains ( "i686" ) ;
27112745 let x86_64 = target. contains ( "x86_64" ) ;
27122746 let aarch64_musl = target. contains ( "aarch64" ) && musl;
2713- let gnuabihf = target. contains ( "gnueabihf" ) ;
2747+ let gnueabihf = target. contains ( "gnueabihf" ) ;
27142748 let x86_64_gnux32 = target. contains ( "gnux32" ) && x86_64;
27152749 let riscv64 = target. contains ( "riscv64" ) ;
27162750 let uclibc = target. contains ( "uclibc" ) ;
@@ -2815,9 +2849,9 @@ fn test_linux(target: &str) {
28152849 "errno.h" ,
28162850 // `sys/io.h` is only available on x86*, Alpha, IA64, and 32-bit
28172851 // ARM: https://bugzilla.redhat.com/show_bug.cgi?id=1116162
2818- // Also unavailable on gnuabihf with glibc 2.30.
2852+ // Also unavailable on gnueabihf with glibc 2.30.
28192853 // https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=6b33f373c7b9199e00ba5fbafd94ac9bfb4337b1
2820- [ ( x86_64 || x86_32 || arm) && !gnuabihf ] : "sys/io.h" ,
2854+ [ ( x86_64 || x86_32 || arm) && !gnueabihf ] : "sys/io.h" ,
28212855 // `sys/reg.h` is only available on x86 and x86_64
28222856 [ x86_64 || x86_32] : "sys/reg.h" ,
28232857 // sysctl system call is deprecated and not available on musl
@@ -2865,7 +2899,8 @@ fn test_linux(target: &str) {
28652899 "linux/netfilter_ipv6.h" ,
28662900 "linux/netfilter_ipv6/ip6_tables.h" ,
28672901 "linux/netlink.h" ,
2868- "linux/openat2.h" ,
2902+ // FIXME: requires Linux >= 5.6:
2903+ [ !musl && !sparc64] : "linux/openat2.h" ,
28692904 [ !musl] : "linux/ptrace.h" ,
28702905 "linux/quota.h" ,
28712906 "linux/random.h" ,
@@ -2963,6 +2998,11 @@ fn test_linux(target: &str) {
29632998 // For internal use only, to define architecture specific ioctl constants with a libc specific type.
29642999 "Ioctl" => true ,
29653000
3001+ // FIXME: requires >= 5.4.1 kernel headers
3002+ "pgn_t" if musl => true ,
3003+ "priority_t" if musl => true ,
3004+ "name_t" if musl => true ,
3005+
29663006 _ => false ,
29673007 }
29683008 } ) ;
@@ -3024,6 +3064,12 @@ fn test_linux(target: &str) {
30243064 // FIXME: requires >= 5.4.1 kernel headers
30253065 "j1939_filter" if musl => true ,
30263066
3067+ // FIXME: requires >= 5.4 kernel headers
3068+ "sockaddr_can" if musl => true ,
3069+
3070+ // FIXME: Unignore once we update Ubuntu to 22.04
3071+ "mallinfo2" if sparc64 => true ,
3072+
30273073 _ => false ,
30283074 }
30293075 } ) ;
@@ -3062,6 +3108,15 @@ fn test_linux(target: &str) {
30623108 return true ;
30633109 }
30643110 }
3111+ if musl || sparc64 {
3112+ // FIXME: Requires >= 5.4.1 kernel headers
3113+ if name. starts_with ( "J1939" )
3114+ || name. starts_with ( "SO_J1939" )
3115+ || name. starts_with ( "SCM_J1939" )
3116+ {
3117+ return true ;
3118+ }
3119+ }
30653120 match name {
30663121 // These constants are not available if gnu headers have been included
30673122 // and can therefore not be tested here
@@ -3124,6 +3179,9 @@ fn test_linux(target: &str) {
31243179 // Not yet implemented on sparc64
31253180 "SYS_clone3" if mips | sparc64 => true ,
31263181
3182+ // FIXME: Not defined on ARM, gnueabihf, MIPS, musl, PowerPC, riscv64, s390x, and sparc64.
3183+ "SYS_memfd_secret" if arm | gnueabihf | mips | musl | ppc | riscv64 | s390x | sparc64 => true ,
3184+
31273185 // FIXME: Added in Linux 5.16
31283186 // https://github.com/torvalds/linux/commit/039c0ec9bb77446d7ada7f55f90af9299b28ca49
31293187 "SYS_futex_waitv" => true ,
@@ -3195,6 +3253,64 @@ fn test_linux(target: &str) {
31953253 // https://github.com/torvalds/linux/commit/42df6e1d221dddc0f2acf2be37e68d553ad65f96
31963254 "NF_NETDEV_NUMHOOKS" => true ,
31973255
3256+ // FIXME: requires Linux >= 5.6:
3257+ | "RESOLVE_BENEATH"
3258+ | "RESOLVE_CACHED"
3259+ | "RESOLVE_IN_ROOT"
3260+ | "RESOLVE_NO_MAGICLINKS"
3261+ | "RESOLVE_NO_SYMLINKS"
3262+ | "RESOLVE_NO_XDEV" if musl || sparc64 => true ,
3263+
3264+ // FIXME: requires Linux >= 5.4:
3265+ | "CAN_J1939"
3266+ | "CAN_NPROTO" if musl || sparc64 => true ,
3267+
3268+ // FIXME: requires Linux >= 5.6
3269+ "GRND_INSECURE" if musl || sparc64 => true ,
3270+
3271+ // FIXME: requires Linux >= 5.7:
3272+ "MREMAP_DONTUNMAP" if musl || sparc64 => true ,
3273+
3274+ // FIXME: Requires more recent kernel headers (5.9 / 5.11):
3275+ | "CLOSE_RANGE_UNSHARE"
3276+ | "CLOSE_RANGE_CLOEXEC" if musl || sparc64 => true ,
3277+
3278+ // FIXME: requires Linux >= 5.12:
3279+ "MPOL_F_NUMA_BALANCING" if musl || sparc64 => true ,
3280+
3281+ // FIXME: Requires more recent kernel headers
3282+ | "NFNL_SUBSYS_COUNT" // bumped in v5.14
3283+ | "NFNL_SUBSYS_HOOK" // v5.14+
3284+ | "NFULA_VLAN" // v5.4+
3285+ | "NFULA_L2HDR" // v5.4+
3286+ | "NFULA_VLAN_PROTO" // v5.4+
3287+ | "NFULA_VLAN_TCI" // v5.4+
3288+ | "NFULA_VLAN_UNSPEC" // v5.4+
3289+ | "RTNLGRP_NEXTHOP" // linux v5.3+
3290+ | "RTNLGRP_BRVLAN" // linux v5.6+
3291+ if musl || sparc64 => true ,
3292+
3293+ // FIXME: Unignore once we update Ubuntu to 22.04
3294+ | "VMADDR_CID_LOCAL"
3295+ | "STATX_MNT_ID"
3296+ | "SYS_close_range"
3297+ | "SYS_openat2"
3298+ | "SYS_pidfd_getfd"
3299+ | "SYS_faccessat2"
3300+ | "SYS_process_madvise"
3301+ | "SYS_epoll_pwait2"
3302+ | "SYS_mount_setattr"
3303+ | "SYS_quotactl_fd"
3304+ | "SYS_landlock_create_ruleset"
3305+ | "SYS_landlock_add_rule"
3306+ | "SYS_landlock_restrict_self"
3307+ | "SYS_process_mrelease"
3308+ | "IFLA_PROP_LIST"
3309+ | "IFLA_ALT_IFNAME"
3310+ | "IFLA_PERM_ADDRESS"
3311+ | "IFLA_PROTO_DOWN_REASON"
3312+ if sparc64 => true ,
3313+
31983314 _ => false ,
31993315 }
32003316 } ) ;
0 commit comments