Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ targets = [
"powerpc64-ibm-aix",
"powerpc64-unknown-freebsd",
"powerpc64-unknown-linux-gnu",
"powerpc64-unknown-linux-gnuelfv2",
"powerpc64-wrs-vxworks",
"riscv32-wrs-vxworks",
"riscv32gc-unknown-linux-musl",
Expand Down
10 changes: 7 additions & 3 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const ALLOWED_CFGS: &[&str] = &[
// GNU to expose a 64-bit `time_t`.
"gnu_time_bits64",
"libc_deny_warnings",
"libc_elfv2",
// Corresponds to `__USE_TIME_BITS64` in UAPI
"linux_time_bits64",
"musl_v1_2_3",
Expand Down Expand Up @@ -92,9 +93,12 @@ fn main() {
let target_arch = env::var("CARGO_CFG_TARGET_ARCH").unwrap_or_default();
let target_abi = env::var("CARGO_CFG_TARGET_ABI").unwrap_or_default();

// FIXME(msrv): Once the MSRV is 1.78, use `cfg(target_abi = "pauthtest")`
// directly instead of translating it to `libc_pauthtest`. `target_abi`
// cannot be used directly in cfg expressions on the current MSRV.
// FIXME(msrv): Once the MSRV is 1.78, use `cfg(target_abi)` directly instead
// of translating its values. `target_abi` cannot be used directly in cfg
// expressions on the current MSRV.
if target_abi == "elfv2" {
set_cfg("libc_elfv2");
}
if target_abi == "pauthtest" {
set_cfg("libc_pauthtest");
}
Expand Down
1 change: 1 addition & 0 deletions ci/verify-build.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ class TargetResult:
Target("powerpc-wrs-vxworks-spe", dist=False),
Target("powerpc64-ibm-aix", dist=False),
Target("powerpc64-unknown-freebsd", dist=False),
Target("powerpc64-unknown-linux-gnuelfv2", dist=False),
Target("powerpc64-wrs-vxworks", dist=False),
Target("riscv32-wrs-vxworks", dist=False),
Target("riscv32gc-unknown-linux-gnu", dist=False),
Expand Down
25 changes: 15 additions & 10 deletions src/unix/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1711,7 +1711,8 @@ extern "C" {
target_os = "linux",
target_env = "gnu",
target_arch = "powerpc64",
target_endian = "big"
target_endian = "big",
not(libc_elfv2)
),
link_name = "cfgetispeed@GLIBC_2.3"
)]
Expand All @@ -1720,7 +1721,7 @@ extern "C" {
target_os = "linux",
target_env = "gnu",
target_arch = "powerpc64",
target_endian = "little"
any(target_endian = "little", libc_elfv2)
),
link_name = "cfgetispeed@GLIBC_2.17"
)]
Expand Down Expand Up @@ -1812,7 +1813,8 @@ extern "C" {
target_os = "linux",
target_env = "gnu",
target_arch = "powerpc64",
target_endian = "big"
target_endian = "big",
not(libc_elfv2)
),
link_name = "cfgetospeed@GLIBC_2.3"
)]
Expand All @@ -1821,7 +1823,7 @@ extern "C" {
target_os = "linux",
target_env = "gnu",
target_arch = "powerpc64",
target_endian = "little"
any(target_endian = "little", libc_elfv2)
),
link_name = "cfgetospeed@GLIBC_2.17"
)]
Expand Down Expand Up @@ -1913,7 +1915,8 @@ extern "C" {
target_os = "linux",
target_env = "gnu",
target_arch = "powerpc64",
target_endian = "big"
target_endian = "big",
not(libc_elfv2)
),
link_name = "cfsetispeed@GLIBC_2.3"
)]
Expand All @@ -1922,7 +1925,7 @@ extern "C" {
target_os = "linux",
target_env = "gnu",
target_arch = "powerpc64",
target_endian = "little"
any(target_endian = "little", libc_elfv2)
),
link_name = "cfsetispeed@GLIBC_2.17"
)]
Expand Down Expand Up @@ -2014,7 +2017,8 @@ extern "C" {
target_os = "linux",
target_env = "gnu",
target_arch = "powerpc64",
target_endian = "big"
target_endian = "big",
not(libc_elfv2)
),
link_name = "cfsetospeed@GLIBC_2.3"
)]
Expand All @@ -2023,7 +2027,7 @@ extern "C" {
target_os = "linux",
target_env = "gnu",
target_arch = "powerpc64",
target_endian = "little"
any(target_endian = "little", libc_elfv2)
),
link_name = "cfsetospeed@GLIBC_2.17"
)]
Expand Down Expand Up @@ -2422,7 +2426,8 @@ cfg_if! {
target_os = "linux",
target_env = "gnu",
target_arch = "powerpc64",
target_endian = "big"
target_endian = "big",
not(libc_elfv2)
),
link_name = "cfsetspeed@GLIBC_2.3"
)]
Expand All @@ -2431,7 +2436,7 @@ cfg_if! {
target_os = "linux",
target_env = "gnu",
target_arch = "powerpc64",
target_endian = "little"
any(target_endian = "little", libc_elfv2)
),
link_name = "cfsetspeed@GLIBC_2.17"
)]
Expand Down