Skip to content

Commit 3d166ca

Browse files
committedSep 13, 2024
x
Signed-off-by: Pedro Tammela <pctammela@gmail.com>
1 parent 941f4f2 commit 3d166ca

File tree

1 file changed

+11
-208
lines changed

1 file changed

+11
-208
lines changed
 

‎libc-test/build.rs

+11-208
Original file line numberDiff line numberDiff line change
@@ -3480,8 +3480,7 @@ fn test_linux(target: &str) {
34803480
[gnu]: "linux/aio_abi.h",
34813481
"linux/can.h",
34823482
"linux/can/raw.h",
3483-
// FIXME: requires kernel headers >= 5.4.1.
3484-
[!musl]: "linux/can/j1939.h",
3483+
"linux/can/j1939.h",
34853484
"linux/dccp.h",
34863485
"linux/errqueue.h",
34873486
"linux/falloc.h",
@@ -3506,8 +3505,7 @@ fn test_linux(target: &str) {
35063505
"linux/mempolicy.h",
35073506
"linux/mman.h",
35083507
"linux/module.h",
3509-
// FIXME: requires kernel headers >= 5.1.
3510-
[!musl]: "linux/mount.h",
3508+
"linux/mount.h",
35113509
"linux/net_tstamp.h",
35123510
"linux/netfilter/nfnetlink.h",
35133511
"linux/netfilter/nfnetlink_log.h",
@@ -3519,9 +3517,8 @@ fn test_linux(target: &str) {
35193517
"linux/netfilter_ipv6.h",
35203518
"linux/netfilter_ipv6/ip6_tables.h",
35213519
"linux/netlink.h",
3522-
// FIXME: requires Linux >= 5.6:
3523-
[!musl]: "linux/openat2.h",
3524-
[!musl]: "linux/ptrace.h",
3520+
"linux/openat2.h",
3521+
"linux/ptrace.h",
35253522
"linux/quota.h",
35263523
"linux/random.h",
35273524
"linux/reboot.h",
@@ -3539,7 +3536,7 @@ fn test_linux(target: &str) {
35393536
"sys/fanotify.h",
35403537
// <sys/auxv.h> is not present on uclibc
35413538
[!uclibc]: "sys/auxv.h",
3542-
[gnu]: "linux/close_range.h",
3539+
[gnu || musl]: "linux/close_range.h",
35433540
}
35443541

35453542
// note: aio.h must be included before sys/mount.h
@@ -3630,11 +3627,6 @@ fn test_linux(target: &str) {
36303627
// specific type.
36313628
"Ioctl" => true,
36323629

3633-
// FIXME: requires >= 5.4.1 kernel headers
3634-
"pgn_t" if musl => true,
3635-
"priority_t" if musl => true,
3636-
"name_t" if musl => true,
3637-
36383630
// FIXME: Somehow fails to test after removing cfg hacks:
36393631
"__uint128" => true,
36403632

@@ -3653,22 +3645,6 @@ fn test_linux(target: &str) {
36533645
if ty.starts_with("__c_anonymous_") {
36543646
return true;
36553647
}
3656-
// FIXME: musl CI has old headers
3657-
if musl && ty.starts_with("uinput_") {
3658-
return true;
3659-
}
3660-
if musl && ty == "seccomp_notif" {
3661-
return true;
3662-
}
3663-
if musl && ty == "seccomp_notif_addfd" {
3664-
return true;
3665-
}
3666-
if musl && ty == "seccomp_notif_resp" {
3667-
return true;
3668-
}
3669-
if musl && ty == "seccomp_notif_sizes" {
3670-
return true;
3671-
}
36723648

36733649
// LFS64 types have been removed in musl 1.2.4+
36743650
if musl && (ty.ends_with("64") || ty.ends_with("64_t")) {
@@ -3744,12 +3720,6 @@ fn test_linux(target: &str) {
37443720
// Might differ between kernel versions
37453721
"open_how" => true,
37463722

3747-
// FIXME: requires >= 5.4.1 kernel headers
3748-
"j1939_filter" if musl => true,
3749-
3750-
// FIXME: requires >= 5.4 kernel headers
3751-
"sockaddr_can" if musl => true,
3752-
37533723
"sctp_initmsg" | "sctp_sndrcvinfo" | "sctp_sndinfo" | "sctp_rcvinfo"
37543724
| "sctp_nxtinfo" | "sctp_prinfo" | "sctp_authinfo" => true,
37553725

@@ -3760,34 +3730,6 @@ fn test_linux(target: &str) {
37603730
// https://github.com/torvalds/linux/commit/94dfc73e7cf4a31da66b8843f0b9283ddd6b8381
37613731
"af_alg_iv" => true,
37623732

3763-
// FIXME: Requires >= 5.1 kernel headers.
3764-
// Everything that uses install-musl.sh has 4.19 kernel headers.
3765-
"tls12_crypto_info_aes_gcm_256"
3766-
if (aarch64 || arm || i686 || s390x || x86_64) && musl =>
3767-
{
3768-
true
3769-
}
3770-
3771-
// FIXME: Requires >= 5.11 kernel headers.
3772-
// Everything that uses install-musl.sh has 4.19 kernel headers.
3773-
"tls12_crypto_info_chacha20_poly1305"
3774-
if (aarch64 || arm || i686 || s390x || x86_64) && musl =>
3775-
{
3776-
true
3777-
}
3778-
3779-
// FIXME: Requires >= 5.3 kernel headers.
3780-
// Everything that uses install-musl.sh has 4.19 kernel headers.
3781-
"xdp_options" if musl => true,
3782-
3783-
// FIXME: Requires >= 5.4 kernel headers.
3784-
// Everything that uses install-musl.sh has 4.19 kernel headers.
3785-
"xdp_umem_reg" | "xdp_ring_offset" | "xdp_mmap_offsets" if musl => true,
3786-
3787-
// FIXME: Requires >= 5.9 kernel headers.
3788-
// Everything that uses install-musl.sh has 4.19 kernel headers.
3789-
"xdp_statistics" if musl => true,
3790-
37913733
// A new field was added in kernel 5.4, this is the old version for backwards compatibility.
37923734
// https://github.com/torvalds/linux/commit/77cd0d7b3f257fd0e3096b4fdcff1a7d38e99e10
37933735
"xdp_ring_offset_v1" | "xdp_mmap_offsets_v1" => true,
@@ -3848,31 +3790,6 @@ fn test_linux(target: &str) {
38483790
}
38493791
}
38503792
if musl {
3851-
// FIXME: Requires >= 5.0 kernel headers
3852-
if name == "SECCOMP_GET_NOTIF_SIZES"
3853-
|| name == "SECCOMP_FILTER_FLAG_NEW_LISTENER"
3854-
|| name == "SECCOMP_FILTER_FLAG_TSYNC_ESRCH"
3855-
|| name == "SECCOMP_USER_NOTIF_FLAG_CONTINUE" // requires >= 5.5
3856-
|| name == "SECCOMP_ADDFD_FLAG_SETFD" // requires >= 5.9
3857-
|| name == "SECCOMP_ADDFD_FLAG_SEND" // requires >= 5.9
3858-
|| name == "SECCOMP_FILTER_FLAG_WAIT_KILLABLE_RECV" // requires >= 5.19
3859-
{
3860-
return true;
3861-
}
3862-
// FIXME: Requires >= 5.4.1 kernel headers
3863-
if name.starts_with("J1939")
3864-
|| name.starts_with("RTEXT_FILTER_")
3865-
|| name.starts_with("SO_J1939")
3866-
|| name.starts_with("SCM_J1939")
3867-
{
3868-
return true;
3869-
}
3870-
// FIXME: Requires >= 5.10 kernel headers
3871-
if name.starts_with("MEMBARRIER_CMD_REGISTER")
3872-
|| name.starts_with("MEMBARRIER_CMD_PRIVATE")
3873-
{
3874-
return true;
3875-
}
38763793
// LFS64 types have been removed in musl 1.2.4+
38773794
if name.starts_with("RLIM64") {
38783795
return true;
@@ -3881,10 +3798,6 @@ fn test_linux(target: &str) {
38813798
if name.starts_with("NI_IDN") {
38823799
return true;
38833800
}
3884-
// FIXME: Requires >= 6.3 kernel headers
3885-
if name == "MFD_NOEXEC_SEAL" || name == "MFD_EXEC" {
3886-
return true;
3887-
}
38883801
}
38893802
match name {
38903803
// These constants are not available if gnu headers have been included
@@ -3969,7 +3882,7 @@ fn test_linux(target: &str) {
39693882
"SECCOMP_FILTER_FLAG_WAIT_KILLABLE_RECV" if sparc64 => true,
39703883

39713884
// FIXME: Not currently available in headers on ARM and musl.
3972-
"NETLINK_GET_STRICT_CHK" if arm || musl => true,
3885+
"NETLINK_GET_STRICT_CHK" if arm => true,
39733886

39743887
// kernel constants not available in uclibc 1.0.34
39753888
| "EXTPROC"
@@ -4038,62 +3951,14 @@ fn test_linux(target: &str) {
40383951
| "MINSIGSTKSZ"
40393952
if gnu => true,
40403953

4041-
// FIXME: Linux >= 5.10:
4042-
// https://github.com/torvalds/linux/commit/d25e2e9388eda61b6e298585024ee3355f50c493
4043-
"NF_INET_INGRESS" if musl => true,
4044-
40453954
// FIXME: Linux >= 5.16:
40463955
// https://github.com/torvalds/linux/commit/42df6e1d221dddc0f2acf2be37e68d553ad65f96
4047-
"NF_NETDEV_EGRESS" if musl || sparc64 => true,
3956+
"NF_NETDEV_EGRESS" if sparc64 => true,
40483957
// value changed
4049-
"NF_NETDEV_NUMHOOKS" if musl || sparc64 => true,
4050-
4051-
// FIXME: requires Linux >= 5.6:
4052-
| "RESOLVE_BENEATH"
4053-
| "RESOLVE_CACHED"
4054-
| "RESOLVE_IN_ROOT"
4055-
| "RESOLVE_NO_MAGICLINKS"
4056-
| "RESOLVE_NO_SYMLINKS"
4057-
| "RESOLVE_NO_XDEV" if musl => true,
4058-
4059-
// FIXME: requires Linux >= 5.4:
4060-
| "CAN_J1939"
4061-
| "CAN_NPROTO" if musl => true,
4062-
4063-
// FIXME: requires Linux >= 5.6
4064-
"GRND_INSECURE" if musl => true,
4065-
4066-
// FIXME: requires Linux >= 5.7:
4067-
"MREMAP_DONTUNMAP" if musl => true,
3958+
"NF_NETDEV_NUMHOOKS" if sparc64 => true,
40683959

40693960
// FIXME: requires Linux >= v5.8
4070-
"IF_LINK_MODE_TESTING" if musl || sparc64 => true,
4071-
4072-
// FIXME: Requires more recent kernel headers (5.9 / 5.11):
4073-
| "CLOSE_RANGE_UNSHARE"
4074-
| "CLOSE_RANGE_CLOEXEC" if musl => true,
4075-
4076-
// FIXME: requires Linux >= 5.12:
4077-
"MPOL_F_NUMA_BALANCING" if musl => true,
4078-
4079-
// FIXME: Requires more recent kernel headers
4080-
| "NFNL_SUBSYS_COUNT" // bumped in v5.14
4081-
| "NFNL_SUBSYS_HOOK" // v5.14+
4082-
| "NFULA_VLAN" // v5.4+
4083-
| "NFULA_L2HDR" // v5.4+
4084-
| "NFULA_VLAN_PROTO" // v5.4+
4085-
| "NFULA_VLAN_TCI" // v5.4+
4086-
| "NFULA_VLAN_UNSPEC" // v5.4+
4087-
| "RTNLGRP_NEXTHOP" // linux v5.3+
4088-
| "RTNLGRP_BRVLAN" // linux v5.6+
4089-
if musl => true,
4090-
4091-
| "MADV_COLD"
4092-
| "MADV_PAGEOUT"
4093-
| "MADV_POPULATE_READ"
4094-
| "MADV_POPULATE_WRITE"
4095-
if musl => true,
4096-
"CLONE_CLEAR_SIGHAND" | "CLONE_INTO_CGROUP" => true,
3961+
"IF_LINK_MODE_TESTING" if sparc64 => true,
40973962

40983963
// FIXME: Requires >= 6.3 kernel headers
40993964
"MFD_EXEC" | "MFD_NOEXEC_SEAL" if sparc64 => true,
@@ -4115,9 +3980,6 @@ fn test_linux(target: &str) {
41153980
=> true,
41163981
"SCTP_FUTURE_ASSOC" | "SCTP_CURRENT_ASSOC" | "SCTP_ALL_ASSOC" | "SCTP_PEER_ADDR_THLDS_V2" => true, // linux 5.5+
41173982

4118-
// FIXME: Requires more recent kernel headers
4119-
"HWTSTAMP_TX_ONESTEP_P2P" if musl => true, // linux v5.6+
4120-
41213983
// kernel 6.5 minimum
41223984
"MOVE_MOUNT_BENEATH" => true,
41233985
// FIXME: Requires linux 6.1
@@ -4139,10 +4001,8 @@ fn test_linux(target: &str) {
41394001
| "FAN_INFO" // linux v5.16+
41404002
=> true,
41414003

4142-
// FIXME: Requires linux 5.15+
4143-
"FAN_REPORT_PIDFD" if musl => true,
4144-
4145-
// FIXME: Requires linux 5.9+
4004+
// musl doesn't use <linux/fanotify.h> in <sys/fanotify.h>
4005+
"FAN_REPORT_PIDFD"
41464006
| "FAN_REPORT_DIR_FID"
41474007
| "FAN_REPORT_NAME"
41484008
| "FAN_REPORT_DFID_NAME"
@@ -4156,55 +4016,6 @@ fn test_linux(target: &str) {
41564016
// FIXME: Requires linux 6.5
41574017
"NFT_MSG_MAX" => true,
41584018

4159-
// FIXME: Requires >= 5.1 kernel headers.
4160-
// Everything that uses install-musl.sh has 4.19 kernel headers.
4161-
"TLS_1_3_VERSION"
4162-
| "TLS_1_3_VERSION_MAJOR"
4163-
| "TLS_1_3_VERSION_MINOR"
4164-
| "TLS_CIPHER_AES_GCM_256"
4165-
| "TLS_CIPHER_AES_GCM_256_IV_SIZE"
4166-
| "TLS_CIPHER_AES_GCM_256_KEY_SIZE"
4167-
| "TLS_CIPHER_AES_GCM_256_SALT_SIZE"
4168-
| "TLS_CIPHER_AES_GCM_256_TAG_SIZE"
4169-
| "TLS_CIPHER_AES_GCM_256_REC_SEQ_SIZE"
4170-
if (aarch64 || arm || i686 || s390x || x86_64) && musl =>
4171-
{
4172-
true
4173-
}
4174-
4175-
// FIXME: Requires >= 5.11 kernel headers.
4176-
// Everything that uses install-musl.sh has 4.19 kernel headers.
4177-
"TLS_CIPHER_CHACHA20_POLY1305"
4178-
| "TLS_CIPHER_CHACHA20_POLY1305_IV_SIZE"
4179-
| "TLS_CIPHER_CHACHA20_POLY1305_KEY_SIZE"
4180-
| "TLS_CIPHER_CHACHA20_POLY1305_SALT_SIZE"
4181-
| "TLS_CIPHER_CHACHA20_POLY1305_TAG_SIZE"
4182-
| "TLS_CIPHER_CHACHA20_POLY1305_REC_SEQ_SIZE"
4183-
if (aarch64 || arm || i686 || s390x || x86_64) && musl =>
4184-
{
4185-
true
4186-
}
4187-
4188-
// FIXME: Requires >= 5.3 kernel headers.
4189-
// Everything that uses install-musl.sh has 4.19 kernel headers.
4190-
"XDP_OPTIONS_ZEROCOPY" | "XDP_OPTIONS"
4191-
if musl =>
4192-
{
4193-
true
4194-
}
4195-
4196-
// FIXME: Requires >= 5.4 kernel headers.
4197-
// Everything that uses install-musl.sh has 4.19 kernel headers.
4198-
"XSK_UNALIGNED_BUF_OFFSET_SHIFT"
4199-
| "XSK_UNALIGNED_BUF_ADDR_MASK"
4200-
| "XDP_UMEM_UNALIGNED_CHUNK_FLAG"
4201-
| "XDP_RING_NEED_WAKEUP"
4202-
| "XDP_USE_NEED_WAKEUP"
4203-
if musl =>
4204-
{
4205-
true
4206-
}
4207-
42084019
// FIXME: Requires >= 6.6 kernel headers.
42094020
"XDP_USE_SG"
42104021
| "XDP_PKT_CONTD"
@@ -4246,14 +4057,6 @@ fn test_linux(target: &str) {
42464057
| "PF_MCE_EARLY"
42474058
| "PF_MEMALLOC_PIN" => true,
42484059

4249-
"SCHED_FLAG_KEEP_POLICY"
4250-
| "SCHED_FLAG_KEEP_PARAMS"
4251-
| "SCHED_FLAG_UTIL_CLAMP_MIN"
4252-
| "SCHED_FLAG_UTIL_CLAMP_MAX"
4253-
| "SCHED_FLAG_KEEP_ALL"
4254-
| "SCHED_FLAG_UTIL_CLAMP"
4255-
| "SCHED_FLAG_ALL" if musl => true, // Needs more recent linux headers.
4256-
42574060
_ => false,
42584061
}
42594062
});

0 commit comments

Comments
 (0)