Skip to content

Commit e9789f7

Browse files
committed
1 parent 8e6f36c commit e9789f7

File tree

4 files changed

+352
-15
lines changed

4 files changed

+352
-15
lines changed

build.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ const ALLOWED_CFGS: &[&str] = &[
2424
// Corresponds to `__USE_TIME_BITS64` in UAPI
2525
"linux_time_bits64",
2626
"musl_v1_2_3",
27+
// termux
28+
"termux",
2729
];
2830

2931
// Extra values to allow for check-cfg.
@@ -157,6 +159,11 @@ fn main() {
157159
}
158160
}
159161
}
162+
163+
// check for termux
164+
if target_os == "android" && env::var("TERMUX_VERSION").is_ok() {
165+
set_cfg("termux");
166+
}
160167
}
161168

162169
/// Run `rustc --version` and capture the output, adjusting arguments as needed if `clippy-driver`

libc-test/build.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ fn do_ctest() {
6868
t if t.contains("windows") => test_windows(t),
6969
t if t.contains("vxworks") => test_vxworks(t),
7070
t if t.contains("nto-qnx") => test_neutrino(t),
71-
t if t.contains("aix") => return test_aix(t),
71+
t if t.contains("aix") => test_aix(t),
7272
t => panic!("unknown target {t}"),
7373
}
7474
}
@@ -2224,6 +2224,9 @@ fn test_android(target: &str) {
22242224
// FIXME(android): Requires >= 6.12 kernel headers.
22252225
"SOF_TIMESTAMPING_OPT_RX_FILTER" => true,
22262226

2227+
// FIXME(android): c value == 0 for some reason on termux
2228+
"TCSAFLUSH" => true,
2229+
22272230
_ => false,
22282231
}
22292232
});
@@ -2288,7 +2291,10 @@ fn test_android(target: &str) {
22882291
// FIXME(android): bad function pointers:
22892292
"isalnum" | "isalpha" | "iscntrl" | "isdigit" | "isgraph" | "islower" | "isprint"
22902293
| "ispunct" | "isspace" | "isupper" | "isxdigit" | "isblank" | "tolower"
2291-
| "toupper" => true,
2294+
| "toupper" | "getpwuid_r" | "tmpfile" | "getpwnam" | "getpwuid" | "tcdrain"
2295+
| "cfgetispeed" | "cfgetospeed" | "cfsetispeed" | "cfsetospeed" | "tcgetattr"
2296+
| "tcsetattr" | "tcflow" | "tcflush" | "tcgetsid" | "tcsendbreak" | "cfmakeraw"
2297+
| "cfsetspeed" => true,
22922298

22932299
// Added in API level 24
22942300
"if_nameindex" | "if_freenameindex" => true,
@@ -5564,7 +5570,7 @@ fn test_aix(target: &str) {
55645570
"ACTION" => ty.to_string(),
55655571

55665572
// 'sigval' is a struct in Rust, but a union in C.
5567-
"sigval" => format!("union sigval"),
5573+
"sigval" => "union sigval".to_string(),
55685574

55695575
t if t.ends_with("_t") => t.to_string(),
55705576
t if is_struct => format!("struct {}", t),

libc-test/semver/android.txt

Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1947,17 +1947,171 @@ PROT_GROWSUP
19471947
PROT_NONE
19481948
PROT_READ
19491949
PROT_WRITE
1950+
PR_CAPBSET_DROP
1951+
PR_CAPBSET_READ
1952+
PR_CAP_AMBIENT
1953+
PR_CAP_AMBIENT_CLEAR_ALL
1954+
PR_CAP_AMBIENT_IS_SET
1955+
PR_CAP_AMBIENT_LOWER
1956+
PR_CAP_AMBIENT_RAISE
1957+
PR_ENDIAN_BIG
1958+
PR_ENDIAN_LITTLE
1959+
PR_ENDIAN_PPC_LITTLE
1960+
PR_FPEMU_NOPRINT
1961+
PR_FPEMU_SIGFPE
1962+
PR_FP_EXC_ASYNC
1963+
PR_FP_EXC_DISABLED
1964+
PR_FP_EXC_DIV
1965+
PR_FP_EXC_INV
1966+
PR_FP_EXC_NONRECOV
1967+
PR_FP_EXC_OVF
1968+
PR_FP_EXC_PRECISE
1969+
PR_FP_EXC_RES
1970+
PR_FP_EXC_SW_ENABLE
1971+
PR_FP_EXC_UND
1972+
PR_FP_MODE_FR
1973+
PR_FP_MODE_FRE
1974+
PR_GET_AUXV
1975+
PR_GET_CHILD_SUBREAPER
1976+
PR_GET_DUMPABLE
1977+
PR_GET_ENDIAN
1978+
PR_GET_FPEMU
1979+
PR_GET_FPEXC
1980+
PR_GET_FP_MODE
1981+
PR_GET_IO_FLUSHER
1982+
PR_GET_KEEPCAPS
1983+
PR_GET_MDWE
1984+
PR_GET_MEMORY_MERGE
19501985
PR_GET_NAME
19511986
PR_GET_NO_NEW_PRIVS
1987+
PR_GET_PDEATHSIG
19521988
PR_GET_SECCOMP
1989+
PR_GET_SECUREBITS
1990+
PR_GET_SPECULATION_CTRL
1991+
PR_GET_TAGGED_ADDR_CTRL
1992+
PR_GET_THP_DISABLE
1993+
PR_GET_TID_ADDRESS
1994+
PR_GET_TIMERSLACK
19531995
PR_GET_TIMING
1996+
PR_GET_TSC
1997+
PR_GET_UNALIGN
1998+
PR_MCE_KILL
1999+
PR_MCE_KILL_CLEAR
2000+
PR_MCE_KILL_DEFAULT
2001+
PR_MCE_KILL_EARLY
2002+
PR_MCE_KILL_GET
2003+
PR_MCE_KILL_LATE
2004+
PR_MCE_KILL_SET
2005+
PR_MDWE_NO_INHERIT
2006+
PR_MDWE_REFUSE_EXEC_GAIN
2007+
PR_MPX_DISABLE_MANAGEMENT
2008+
PR_MPX_ENABLE_MANAGEMENT
2009+
PR_MTE_TAG_MASK
2010+
PR_MTE_TAG_SHIFT
2011+
PR_MTE_TCF_ASYNC
2012+
PR_MTE_TCF_MASK
2013+
PR_MTE_TCF_NONE
2014+
PR_MTE_TCF_SHIFT
2015+
PR_MTE_TCF_SYNC
2016+
PR_PAC_APDAKEY
2017+
PR_PAC_APDBKEY
2018+
PR_PAC_APGAKEY
2019+
PR_PAC_APIAKEY
2020+
PR_PAC_APIBKEY
2021+
PR_PAC_GET_ENABLED_KEYS
2022+
PR_PAC_RESET_KEYS
2023+
PR_PAC_SET_ENABLED_KEYS
2024+
PR_RISCV_V_GET_CONTROL
2025+
PR_RISCV_V_SET_CONTROL
2026+
PR_RISCV_V_VSTATE_CTRL_CUR_MASK
2027+
PR_RISCV_V_VSTATE_CTRL_DEFAULT
2028+
PR_RISCV_V_VSTATE_CTRL_INHERIT
2029+
PR_RISCV_V_VSTATE_CTRL_MASK
2030+
PR_RISCV_V_VSTATE_CTRL_NEXT_MASK
2031+
PR_RISCV_V_VSTATE_CTRL_OFF
2032+
PR_RISCV_V_VSTATE_CTRL_ON
2033+
PR_SCHED_CORE
2034+
PR_SCHED_CORE_CREATE
2035+
PR_SCHED_CORE_GET
2036+
PR_SCHED_CORE_MAX
2037+
PR_SCHED_CORE_SCOPE_PROCESS_GROUP
2038+
PR_SCHED_CORE_SCOPE_THREAD
2039+
PR_SCHED_CORE_SCOPE_THREAD_GROUP
2040+
PR_SCHED_CORE_SHARE_FROM
2041+
PR_SCHED_CORE_SHARE_TO
2042+
PR_SET_CHILD_SUBREAPER
2043+
PR_SET_DUMPABLE
2044+
PR_SET_ENDIAN
2045+
PR_SET_FPEMU
2046+
PR_SET_FPEXC
2047+
PR_SET_FP_MODE
2048+
PR_SET_IO_FLUSHER
2049+
PR_SET_KEEPCAPS
2050+
PR_SET_MDWE
2051+
PR_SET_MEMORY_MERGE
2052+
PR_SET_MM
2053+
PR_SET_MM_ARG_END
2054+
PR_SET_MM_ARG_START
2055+
PR_SET_MM_AUXV
2056+
PR_SET_MM_BRK
2057+
PR_SET_MM_END_CODE
2058+
PR_SET_MM_END_DATA
2059+
PR_SET_MM_ENV_END
2060+
PR_SET_MM_ENV_START
2061+
PR_SET_MM_EXE_FILE
2062+
PR_SET_MM_MAP
2063+
PR_SET_MM_MAP_SIZE
2064+
PR_SET_MM_START_BRK
2065+
PR_SET_MM_START_CODE
2066+
PR_SET_MM_START_DATA
2067+
PR_SET_MM_START_STACK
19542068
PR_SET_NAME
19552069
PR_SET_NO_NEW_PRIVS
2070+
PR_SET_PDEATHSIG
2071+
PR_SET_PTRACER
2072+
PR_SET_PTRACER_ANY
19562073
PR_SET_SECCOMP
2074+
PR_SET_SECUREBITS
2075+
PR_SET_SPECULATION_CTRL
2076+
PR_SET_SYSCALL_USER_DISPATCH
2077+
PR_SET_TAGGED_ADDR_CTRL
2078+
PR_SET_THP_DISABLE
2079+
PR_SET_TIMERSLACK
2080+
PR_SET_TIMING
2081+
PR_SET_TSC
2082+
PR_SET_UNALIGN
19572083
PR_SET_VMA
19582084
PR_SET_VMA_ANON_NAME
2085+
PR_SME_GET_VL
2086+
PR_SME_SET_VL
2087+
PR_SME_SET_VL_ONEXEC
2088+
PR_SME_VL_INHERIT
2089+
PR_SME_VL_LEN_MASK
2090+
PR_SPEC_DISABLE
2091+
PR_SPEC_DISABLE_NOEXEC
2092+
PR_SPEC_ENABLE
2093+
PR_SPEC_FORCE_DISABLE
2094+
PR_SPEC_INDIRECT_BRANCH
2095+
PR_SPEC_L1D_FLUSH
2096+
PR_SPEC_NOT_AFFECTED
2097+
PR_SPEC_PRCTL
2098+
PR_SPEC_STORE_BYPASS
2099+
PR_SVE_GET_VL
2100+
PR_SVE_SET_VL
2101+
PR_SVE_SET_VL_ONEXEC
2102+
PR_SVE_VL_INHERIT
2103+
PR_SVE_VL_LEN_MASK
2104+
PR_SYS_DISPATCH_OFF
2105+
PR_SYS_DISPATCH_ON
2106+
PR_TAGGED_ADDR_ENABLE
2107+
PR_TASK_PERF_EVENTS_DISABLE
2108+
PR_TASK_PERF_EVENTS_ENABLE
19592109
PR_TIMING_STATISTICAL
19602110
PR_TIMING_TIMESTAMP
2111+
PR_TSC_ENABLE
2112+
PR_TSC_SIGSEGV
2113+
PR_UNALIGN_NOPRINT
2114+
PR_UNALIGN_SIGBUS
19612115
PTHREAD_BARRIER_SERIAL_THREAD
19622116
PTHREAD_COND_INITIALIZER
19632117
PTHREAD_CREATE_DETACHED
@@ -2516,6 +2670,8 @@ SW_CNT
25162670
SW_MAX
25172671
SYN_CNT
25182672
SYN_MAX
2673+
SYSCALL_DISPATCH_FILTER_ALLOW
2674+
SYSCALL_DISPATCH_FILTER_BLOCK
25192675
SYS_accept4
25202676
SYS_acct
25212677
SYS_add_key

0 commit comments

Comments
 (0)