From efa68495888de699cacbfa335d05ef964ee15188 Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Sun, 27 Aug 2023 18:13:19 +0900 Subject: [PATCH] codegen: Cleanup --- .github/.cspell/project-dictionary.txt | 5 + src/imp/atomic128/detect/auxv.rs | 9 +- .../src/gen/sys/aarch64_be_linux_gnu/mod.rs | 97 ++++- .../sys_auxv.rs} | 0 .../gen/sys/aarch64_be_linux_gnu_ilp32/mod.rs | 97 ++++- .../aarch64_be_linux_gnu_ilp32/sys_auxv.rs | 7 + .../helper/src/gen/sys/aarch64_freebsd/mod.rs | 64 +++- .../helper/src/gen/sys/aarch64_fuchsia/mod.rs | 32 +- .../zircon_system_public_zircon_features.rs | 44 +-- .../src/gen/sys/aarch64_linux_android/mod.rs | 104 ++++- .../gen/sys/aarch64_linux_android/sys_auxv.rs | 7 + ...properties.rs => sys_system_properties.rs} | 0 .../src/gen/sys/aarch64_linux_gnu/mod.rs | 97 ++++- .../src/gen/sys/aarch64_linux_gnu/sys_auxv.rs | 7 + .../gen/sys/aarch64_linux_gnu_ilp32/mod.rs | 97 ++++- .../sys/aarch64_linux_gnu_ilp32/sys_auxv.rs | 7 + .../src/gen/sys/aarch64_linux_musl/mod.rs | 99 ++++- .../{musl_sys_auxv.rs => sys_auxv.rs} | 0 .../src/gen/sys/aarch64_linux_uclibc/mod.rs | 97 ++++- .../gen/sys/aarch64_linux_uclibc/sys_auxv.rs | 7 + .../helper/src/gen/sys/aarch64_openbsd/mod.rs | 18 +- .../src/gen/sys/aarch64_openbsd/sys_sysctl.rs | 2 +- tests/helper/src/gen/sys/mod.rs | 3 +- .../gen/sys/powerpc64_freebsd/machine_cpu.rs | 4 +- .../src/gen/sys/powerpc64_freebsd/mod.rs | 57 ++- .../src/gen/sys/powerpc64_linux_gnu/mod.rs | 63 ++- .../gen/sys/powerpc64_linux_gnu/sys_auxv.rs | 7 + .../src/gen/sys/powerpc64_linux_musl/mod.rs | 65 +++- .../{musl_sys_auxv.rs => sys_auxv.rs} | 0 .../sys/powerpc64le_freebsd/machine_cpu.rs | 4 +- .../src/gen/sys/powerpc64le_freebsd/mod.rs | 57 ++- .../src/gen/sys/powerpc64le_linux_gnu/mod.rs | 63 ++- .../gen/sys/powerpc64le_linux_gnu/sys_auxv.rs | 7 + .../src/gen/sys/powerpc64le_linux_musl/mod.rs | 65 +++- .../{musl_sys_auxv.rs => sys_auxv.rs} | 0 tools/codegen/Cargo.toml | 6 +- tools/codegen/patches/.gitkeep | 0 tools/codegen/patches/android.diff | 11 - tools/codegen/patches/freebsd.diff | 12 - tools/codegen/patches/fuchsia.diff | 115 ------ tools/codegen/patches/linux-gnu.diff | 40 ++ tools/codegen/patches/linux-uclibc.diff | 20 + tools/codegen/patches/macos.diff | 23 -- tools/codegen/patches/openbsd.diff | 10 - tools/codegen/src/ffi.rs | 358 +++++++++++------- 45 files changed, 1292 insertions(+), 595 deletions(-) rename tests/helper/src/gen/sys/{aarch64_linux_android/bionic_sys_auxv.rs => aarch64_be_linux_gnu/sys_auxv.rs} (100%) create mode 100644 tests/helper/src/gen/sys/aarch64_be_linux_gnu_ilp32/sys_auxv.rs create mode 100644 tests/helper/src/gen/sys/aarch64_linux_android/sys_auxv.rs rename tests/helper/src/gen/sys/aarch64_linux_android/{bionic_sys_system_properties.rs => sys_system_properties.rs} (100%) create mode 100644 tests/helper/src/gen/sys/aarch64_linux_gnu/sys_auxv.rs create mode 100644 tests/helper/src/gen/sys/aarch64_linux_gnu_ilp32/sys_auxv.rs rename tests/helper/src/gen/sys/aarch64_linux_musl/{musl_sys_auxv.rs => sys_auxv.rs} (100%) create mode 100644 tests/helper/src/gen/sys/aarch64_linux_uclibc/sys_auxv.rs create mode 100644 tests/helper/src/gen/sys/powerpc64_linux_gnu/sys_auxv.rs rename tests/helper/src/gen/sys/powerpc64_linux_musl/{musl_sys_auxv.rs => sys_auxv.rs} (100%) create mode 100644 tests/helper/src/gen/sys/powerpc64le_linux_gnu/sys_auxv.rs rename tests/helper/src/gen/sys/powerpc64le_linux_musl/{musl_sys_auxv.rs => sys_auxv.rs} (100%) create mode 100644 tools/codegen/patches/.gitkeep delete mode 100644 tools/codegen/patches/android.diff delete mode 100644 tools/codegen/patches/freebsd.diff delete mode 100644 tools/codegen/patches/fuchsia.diff create mode 100644 tools/codegen/patches/linux-gnu.diff create mode 100644 tools/codegen/patches/linux-uclibc.diff delete mode 100644 tools/codegen/patches/macos.diff delete mode 100644 tools/codegen/patches/openbsd.diff diff --git a/.github/.cspell/project-dictionary.txt b/.github/.cspell/project-dictionary.txt index 5ec2a9b1..ff8d5a1c 100644 --- a/.github/.cspell/project-dictionary.txt +++ b/.github/.cspell/project-dictionary.txt @@ -2,6 +2,7 @@ addc adde alcgr algr +allnoconfig aosp armasm auxv @@ -37,6 +38,7 @@ csrsi cxchg cxchgweak DESTDIR +DEVEL dlsym DWCAS espup @@ -119,6 +121,8 @@ spinlock sreg sstatus stdarch +stdbool +stddef stdsimd stilp stlxp @@ -133,6 +137,7 @@ subfze swpp syscall sysctlbyname +sysdeps systemsim tagme uapi diff --git a/src/imp/atomic128/detect/auxv.rs b/src/imp/atomic128/detect/auxv.rs index a80350e4..70a3f27e 100644 --- a/src/imp/atomic128/detect/auxv.rs +++ b/src/imp/atomic128/detect/auxv.rs @@ -24,7 +24,7 @@ // // - On musl with static linking. See the above for more. // Also, in this case, dlsym(getauxval) always returns null. -// - On uClibc-ng (*-linux-uclibc*, *-l4re-uclibc*), [uClibc-ng 1.0.43 (released in 2023-04-05) added getauxval](https://repo.or.cz/uclibc-ng.git/commitdiff/d869bb1600942c01a77539128f9ba5b5b55ad647). +// - On uClibc-ng (*-linux-uclibc*, *-l4re-uclibc*), [uClibc-ng 1.0.43 (released in 2023-04-05) added getauxval](https://github.com/wbx-github/uclibc-ng/commit/d869bb1600942c01a77539128f9ba5b5b55ad647). // - On Picolibc, [Picolibc 1.4.6 added getauxval stub](https://github.com/picolibc/picolibc#picolibc-version-146). // // See also https://github.com/rust-lang/stdarch/pull/1375 @@ -69,7 +69,7 @@ mod os { // https://man7.org/linux/man-pages/man3/getauxval.3.html // https://github.com/bminor/glibc/blob/801af9fafd4689337ebf27260aa115335a0cb2bc/misc/sys/auxv.h // https://github.com/bminor/musl/blob/7d756e1c04de6eb3f2b3d3e1141a218bb329fcfb/include/sys/auxv.h - // https://repo.or.cz/uclibc-ng.git/blob/9d549d7bc6a1b78498ee8d1f39f6a324fdfc9e5d:/include/sys/auxv.h + // https://github.com/wbx-github/uclibc-ng/blob/cdb07d2cd52af39feb425e6d36c02b30916b9f0a/include/sys/auxv.h // https://github.com/aosp-mirror/platform_bionic/blob/d3ebc2f7c49a9893b114124d4a6b315f3a328764/libc/include/sys/auxv.h // https://github.com/picolibc/picolibc/blob/7a8a58aeaa5946cb662577a518051091b691af3a/newlib/libc/picolib/getauxval.c // https://github.com/rust-lang/libc/blob/0.2.139/src/unix/linux_like/linux/gnu/mod.rs#L1201 @@ -277,10 +277,7 @@ mod tests { { let mut _getauxval: unsafe extern "C" fn(ffi::c_ulong) -> ffi::c_ulong = ffi::getauxval; _getauxval = libc::getauxval; - #[cfg(any(target_env = "musl", target_os = "android"))] // TODO(codegen) - { - _getauxval = sys::getauxval; - } + _getauxval = sys::getauxval; } #[cfg(all(target_arch = "aarch64", target_os = "android"))] { diff --git a/tests/helper/src/gen/sys/aarch64_be_linux_gnu/mod.rs b/tests/helper/src/gen/sys/aarch64_be_linux_gnu/mod.rs index d7e34188..4537d2f2 100644 --- a/tests/helper/src/gen/sys/aarch64_be_linux_gnu/mod.rs +++ b/tests/helper/src/gen/sys/aarch64_be_linux_gnu/mod.rs @@ -4,22 +4,85 @@ #![cfg_attr(rustfmt, rustfmt::skip)] mod linux_headers_linux_auxvec; -pub use linux_headers_linux_auxvec::{AT_HWCAP, AT_HWCAP2}; +pub use linux_headers_linux_auxvec::AT_HWCAP; +pub use linux_headers_linux_auxvec::AT_HWCAP2; mod linux_headers_asm_hwcap; -pub use linux_headers_asm_hwcap::{ - HWCAP2_AFP, HWCAP2_BF16, HWCAP2_BTI, HWCAP2_CSSC, HWCAP2_DCPODP, HWCAP2_DGH, - HWCAP2_EBF16, HWCAP2_ECV, HWCAP2_FLAGM2, HWCAP2_FRINT, HWCAP2_I8MM, HWCAP2_MOPS, - HWCAP2_MTE, HWCAP2_MTE3, HWCAP2_RNG, HWCAP2_RPRES, HWCAP2_RPRFM, HWCAP2_SME, - HWCAP2_SME2, HWCAP2_SME2P1, HWCAP2_SME_B16B16, HWCAP2_SME_B16F32, HWCAP2_SME_BI32I32, - HWCAP2_SME_F16F16, HWCAP2_SME_F16F32, HWCAP2_SME_F32F32, HWCAP2_SME_F64F64, - HWCAP2_SME_FA64, HWCAP2_SME_I16I32, HWCAP2_SME_I16I64, HWCAP2_SME_I8I32, HWCAP2_SVE2, - HWCAP2_SVE2P1, HWCAP2_SVEAES, HWCAP2_SVEBF16, HWCAP2_SVEBITPERM, HWCAP2_SVEF32MM, - HWCAP2_SVEF64MM, HWCAP2_SVEI8MM, HWCAP2_SVEPMULL, HWCAP2_SVESHA3, HWCAP2_SVESM4, - HWCAP2_SVE_EBF16, HWCAP2_WFXT, HWCAP_AES, HWCAP_ASIMD, HWCAP_ASIMDDP, HWCAP_ASIMDFHM, - HWCAP_ASIMDHP, HWCAP_ASIMDRDM, HWCAP_ATOMICS, HWCAP_CPUID, HWCAP_CRC32, HWCAP_DCPOP, - HWCAP_DIT, HWCAP_EVTSTRM, HWCAP_FCMA, HWCAP_FLAGM, HWCAP_FP, HWCAP_FPHP, - HWCAP_ILRCPC, HWCAP_JSCVT, HWCAP_LRCPC, HWCAP_PACA, HWCAP_PACG, HWCAP_PMULL, - HWCAP_SB, HWCAP_SHA1, HWCAP_SHA2, HWCAP_SHA3, HWCAP_SHA512, HWCAP_SM3, HWCAP_SM4, - HWCAP_SSBS, HWCAP_SVE, HWCAP_USCAT, -}; +pub use linux_headers_asm_hwcap::HWCAP_FP; +pub use linux_headers_asm_hwcap::HWCAP_ASIMD; +pub use linux_headers_asm_hwcap::HWCAP_EVTSTRM; +pub use linux_headers_asm_hwcap::HWCAP_AES; +pub use linux_headers_asm_hwcap::HWCAP_PMULL; +pub use linux_headers_asm_hwcap::HWCAP_SHA1; +pub use linux_headers_asm_hwcap::HWCAP_SHA2; +pub use linux_headers_asm_hwcap::HWCAP_CRC32; +pub use linux_headers_asm_hwcap::HWCAP_ATOMICS; +pub use linux_headers_asm_hwcap::HWCAP_FPHP; +pub use linux_headers_asm_hwcap::HWCAP_ASIMDHP; +pub use linux_headers_asm_hwcap::HWCAP_CPUID; +pub use linux_headers_asm_hwcap::HWCAP_ASIMDRDM; +pub use linux_headers_asm_hwcap::HWCAP_JSCVT; +pub use linux_headers_asm_hwcap::HWCAP_FCMA; +pub use linux_headers_asm_hwcap::HWCAP_LRCPC; +pub use linux_headers_asm_hwcap::HWCAP_DCPOP; +pub use linux_headers_asm_hwcap::HWCAP_SHA3; +pub use linux_headers_asm_hwcap::HWCAP_SM3; +pub use linux_headers_asm_hwcap::HWCAP_SM4; +pub use linux_headers_asm_hwcap::HWCAP_ASIMDDP; +pub use linux_headers_asm_hwcap::HWCAP_SHA512; +pub use linux_headers_asm_hwcap::HWCAP_SVE; +pub use linux_headers_asm_hwcap::HWCAP_ASIMDFHM; +pub use linux_headers_asm_hwcap::HWCAP_DIT; +pub use linux_headers_asm_hwcap::HWCAP_USCAT; +pub use linux_headers_asm_hwcap::HWCAP_ILRCPC; +pub use linux_headers_asm_hwcap::HWCAP_FLAGM; +pub use linux_headers_asm_hwcap::HWCAP_SSBS; +pub use linux_headers_asm_hwcap::HWCAP_SB; +pub use linux_headers_asm_hwcap::HWCAP_PACA; +pub use linux_headers_asm_hwcap::HWCAP_PACG; +pub use linux_headers_asm_hwcap::HWCAP2_DCPODP; +pub use linux_headers_asm_hwcap::HWCAP2_SVE2; +pub use linux_headers_asm_hwcap::HWCAP2_SVEAES; +pub use linux_headers_asm_hwcap::HWCAP2_SVEPMULL; +pub use linux_headers_asm_hwcap::HWCAP2_SVEBITPERM; +pub use linux_headers_asm_hwcap::HWCAP2_SVESHA3; +pub use linux_headers_asm_hwcap::HWCAP2_SVESM4; +pub use linux_headers_asm_hwcap::HWCAP2_FLAGM2; +pub use linux_headers_asm_hwcap::HWCAP2_FRINT; +pub use linux_headers_asm_hwcap::HWCAP2_SVEI8MM; +pub use linux_headers_asm_hwcap::HWCAP2_SVEF32MM; +pub use linux_headers_asm_hwcap::HWCAP2_SVEF64MM; +pub use linux_headers_asm_hwcap::HWCAP2_SVEBF16; +pub use linux_headers_asm_hwcap::HWCAP2_I8MM; +pub use linux_headers_asm_hwcap::HWCAP2_BF16; +pub use linux_headers_asm_hwcap::HWCAP2_DGH; +pub use linux_headers_asm_hwcap::HWCAP2_RNG; +pub use linux_headers_asm_hwcap::HWCAP2_BTI; +pub use linux_headers_asm_hwcap::HWCAP2_MTE; +pub use linux_headers_asm_hwcap::HWCAP2_ECV; +pub use linux_headers_asm_hwcap::HWCAP2_AFP; +pub use linux_headers_asm_hwcap::HWCAP2_RPRES; +pub use linux_headers_asm_hwcap::HWCAP2_MTE3; +pub use linux_headers_asm_hwcap::HWCAP2_SME; +pub use linux_headers_asm_hwcap::HWCAP2_SME_I16I64; +pub use linux_headers_asm_hwcap::HWCAP2_SME_F64F64; +pub use linux_headers_asm_hwcap::HWCAP2_SME_I8I32; +pub use linux_headers_asm_hwcap::HWCAP2_SME_F16F32; +pub use linux_headers_asm_hwcap::HWCAP2_SME_B16F32; +pub use linux_headers_asm_hwcap::HWCAP2_SME_F32F32; +pub use linux_headers_asm_hwcap::HWCAP2_SME_FA64; +pub use linux_headers_asm_hwcap::HWCAP2_WFXT; +pub use linux_headers_asm_hwcap::HWCAP2_EBF16; +pub use linux_headers_asm_hwcap::HWCAP2_SVE_EBF16; +pub use linux_headers_asm_hwcap::HWCAP2_CSSC; +pub use linux_headers_asm_hwcap::HWCAP2_RPRFM; +pub use linux_headers_asm_hwcap::HWCAP2_SVE2P1; +pub use linux_headers_asm_hwcap::HWCAP2_SME2; +pub use linux_headers_asm_hwcap::HWCAP2_SME2P1; +pub use linux_headers_asm_hwcap::HWCAP2_SME_I16I32; +pub use linux_headers_asm_hwcap::HWCAP2_SME_BI32I32; +pub use linux_headers_asm_hwcap::HWCAP2_SME_B16B16; +pub use linux_headers_asm_hwcap::HWCAP2_SME_F16F16; +pub use linux_headers_asm_hwcap::HWCAP2_MOPS; +mod sys_auxv; +pub use sys_auxv::getauxval; pub type c_char = u8; diff --git a/tests/helper/src/gen/sys/aarch64_linux_android/bionic_sys_auxv.rs b/tests/helper/src/gen/sys/aarch64_be_linux_gnu/sys_auxv.rs similarity index 100% rename from tests/helper/src/gen/sys/aarch64_linux_android/bionic_sys_auxv.rs rename to tests/helper/src/gen/sys/aarch64_be_linux_gnu/sys_auxv.rs diff --git a/tests/helper/src/gen/sys/aarch64_be_linux_gnu_ilp32/mod.rs b/tests/helper/src/gen/sys/aarch64_be_linux_gnu_ilp32/mod.rs index d7e34188..4537d2f2 100644 --- a/tests/helper/src/gen/sys/aarch64_be_linux_gnu_ilp32/mod.rs +++ b/tests/helper/src/gen/sys/aarch64_be_linux_gnu_ilp32/mod.rs @@ -4,22 +4,85 @@ #![cfg_attr(rustfmt, rustfmt::skip)] mod linux_headers_linux_auxvec; -pub use linux_headers_linux_auxvec::{AT_HWCAP, AT_HWCAP2}; +pub use linux_headers_linux_auxvec::AT_HWCAP; +pub use linux_headers_linux_auxvec::AT_HWCAP2; mod linux_headers_asm_hwcap; -pub use linux_headers_asm_hwcap::{ - HWCAP2_AFP, HWCAP2_BF16, HWCAP2_BTI, HWCAP2_CSSC, HWCAP2_DCPODP, HWCAP2_DGH, - HWCAP2_EBF16, HWCAP2_ECV, HWCAP2_FLAGM2, HWCAP2_FRINT, HWCAP2_I8MM, HWCAP2_MOPS, - HWCAP2_MTE, HWCAP2_MTE3, HWCAP2_RNG, HWCAP2_RPRES, HWCAP2_RPRFM, HWCAP2_SME, - HWCAP2_SME2, HWCAP2_SME2P1, HWCAP2_SME_B16B16, HWCAP2_SME_B16F32, HWCAP2_SME_BI32I32, - HWCAP2_SME_F16F16, HWCAP2_SME_F16F32, HWCAP2_SME_F32F32, HWCAP2_SME_F64F64, - HWCAP2_SME_FA64, HWCAP2_SME_I16I32, HWCAP2_SME_I16I64, HWCAP2_SME_I8I32, HWCAP2_SVE2, - HWCAP2_SVE2P1, HWCAP2_SVEAES, HWCAP2_SVEBF16, HWCAP2_SVEBITPERM, HWCAP2_SVEF32MM, - HWCAP2_SVEF64MM, HWCAP2_SVEI8MM, HWCAP2_SVEPMULL, HWCAP2_SVESHA3, HWCAP2_SVESM4, - HWCAP2_SVE_EBF16, HWCAP2_WFXT, HWCAP_AES, HWCAP_ASIMD, HWCAP_ASIMDDP, HWCAP_ASIMDFHM, - HWCAP_ASIMDHP, HWCAP_ASIMDRDM, HWCAP_ATOMICS, HWCAP_CPUID, HWCAP_CRC32, HWCAP_DCPOP, - HWCAP_DIT, HWCAP_EVTSTRM, HWCAP_FCMA, HWCAP_FLAGM, HWCAP_FP, HWCAP_FPHP, - HWCAP_ILRCPC, HWCAP_JSCVT, HWCAP_LRCPC, HWCAP_PACA, HWCAP_PACG, HWCAP_PMULL, - HWCAP_SB, HWCAP_SHA1, HWCAP_SHA2, HWCAP_SHA3, HWCAP_SHA512, HWCAP_SM3, HWCAP_SM4, - HWCAP_SSBS, HWCAP_SVE, HWCAP_USCAT, -}; +pub use linux_headers_asm_hwcap::HWCAP_FP; +pub use linux_headers_asm_hwcap::HWCAP_ASIMD; +pub use linux_headers_asm_hwcap::HWCAP_EVTSTRM; +pub use linux_headers_asm_hwcap::HWCAP_AES; +pub use linux_headers_asm_hwcap::HWCAP_PMULL; +pub use linux_headers_asm_hwcap::HWCAP_SHA1; +pub use linux_headers_asm_hwcap::HWCAP_SHA2; +pub use linux_headers_asm_hwcap::HWCAP_CRC32; +pub use linux_headers_asm_hwcap::HWCAP_ATOMICS; +pub use linux_headers_asm_hwcap::HWCAP_FPHP; +pub use linux_headers_asm_hwcap::HWCAP_ASIMDHP; +pub use linux_headers_asm_hwcap::HWCAP_CPUID; +pub use linux_headers_asm_hwcap::HWCAP_ASIMDRDM; +pub use linux_headers_asm_hwcap::HWCAP_JSCVT; +pub use linux_headers_asm_hwcap::HWCAP_FCMA; +pub use linux_headers_asm_hwcap::HWCAP_LRCPC; +pub use linux_headers_asm_hwcap::HWCAP_DCPOP; +pub use linux_headers_asm_hwcap::HWCAP_SHA3; +pub use linux_headers_asm_hwcap::HWCAP_SM3; +pub use linux_headers_asm_hwcap::HWCAP_SM4; +pub use linux_headers_asm_hwcap::HWCAP_ASIMDDP; +pub use linux_headers_asm_hwcap::HWCAP_SHA512; +pub use linux_headers_asm_hwcap::HWCAP_SVE; +pub use linux_headers_asm_hwcap::HWCAP_ASIMDFHM; +pub use linux_headers_asm_hwcap::HWCAP_DIT; +pub use linux_headers_asm_hwcap::HWCAP_USCAT; +pub use linux_headers_asm_hwcap::HWCAP_ILRCPC; +pub use linux_headers_asm_hwcap::HWCAP_FLAGM; +pub use linux_headers_asm_hwcap::HWCAP_SSBS; +pub use linux_headers_asm_hwcap::HWCAP_SB; +pub use linux_headers_asm_hwcap::HWCAP_PACA; +pub use linux_headers_asm_hwcap::HWCAP_PACG; +pub use linux_headers_asm_hwcap::HWCAP2_DCPODP; +pub use linux_headers_asm_hwcap::HWCAP2_SVE2; +pub use linux_headers_asm_hwcap::HWCAP2_SVEAES; +pub use linux_headers_asm_hwcap::HWCAP2_SVEPMULL; +pub use linux_headers_asm_hwcap::HWCAP2_SVEBITPERM; +pub use linux_headers_asm_hwcap::HWCAP2_SVESHA3; +pub use linux_headers_asm_hwcap::HWCAP2_SVESM4; +pub use linux_headers_asm_hwcap::HWCAP2_FLAGM2; +pub use linux_headers_asm_hwcap::HWCAP2_FRINT; +pub use linux_headers_asm_hwcap::HWCAP2_SVEI8MM; +pub use linux_headers_asm_hwcap::HWCAP2_SVEF32MM; +pub use linux_headers_asm_hwcap::HWCAP2_SVEF64MM; +pub use linux_headers_asm_hwcap::HWCAP2_SVEBF16; +pub use linux_headers_asm_hwcap::HWCAP2_I8MM; +pub use linux_headers_asm_hwcap::HWCAP2_BF16; +pub use linux_headers_asm_hwcap::HWCAP2_DGH; +pub use linux_headers_asm_hwcap::HWCAP2_RNG; +pub use linux_headers_asm_hwcap::HWCAP2_BTI; +pub use linux_headers_asm_hwcap::HWCAP2_MTE; +pub use linux_headers_asm_hwcap::HWCAP2_ECV; +pub use linux_headers_asm_hwcap::HWCAP2_AFP; +pub use linux_headers_asm_hwcap::HWCAP2_RPRES; +pub use linux_headers_asm_hwcap::HWCAP2_MTE3; +pub use linux_headers_asm_hwcap::HWCAP2_SME; +pub use linux_headers_asm_hwcap::HWCAP2_SME_I16I64; +pub use linux_headers_asm_hwcap::HWCAP2_SME_F64F64; +pub use linux_headers_asm_hwcap::HWCAP2_SME_I8I32; +pub use linux_headers_asm_hwcap::HWCAP2_SME_F16F32; +pub use linux_headers_asm_hwcap::HWCAP2_SME_B16F32; +pub use linux_headers_asm_hwcap::HWCAP2_SME_F32F32; +pub use linux_headers_asm_hwcap::HWCAP2_SME_FA64; +pub use linux_headers_asm_hwcap::HWCAP2_WFXT; +pub use linux_headers_asm_hwcap::HWCAP2_EBF16; +pub use linux_headers_asm_hwcap::HWCAP2_SVE_EBF16; +pub use linux_headers_asm_hwcap::HWCAP2_CSSC; +pub use linux_headers_asm_hwcap::HWCAP2_RPRFM; +pub use linux_headers_asm_hwcap::HWCAP2_SVE2P1; +pub use linux_headers_asm_hwcap::HWCAP2_SME2; +pub use linux_headers_asm_hwcap::HWCAP2_SME2P1; +pub use linux_headers_asm_hwcap::HWCAP2_SME_I16I32; +pub use linux_headers_asm_hwcap::HWCAP2_SME_BI32I32; +pub use linux_headers_asm_hwcap::HWCAP2_SME_B16B16; +pub use linux_headers_asm_hwcap::HWCAP2_SME_F16F16; +pub use linux_headers_asm_hwcap::HWCAP2_MOPS; +mod sys_auxv; +pub use sys_auxv::getauxval; pub type c_char = u8; diff --git a/tests/helper/src/gen/sys/aarch64_be_linux_gnu_ilp32/sys_auxv.rs b/tests/helper/src/gen/sys/aarch64_be_linux_gnu_ilp32/sys_auxv.rs new file mode 100644 index 00000000..a53605f5 --- /dev/null +++ b/tests/helper/src/gen/sys/aarch64_be_linux_gnu_ilp32/sys_auxv.rs @@ -0,0 +1,7 @@ +// This file is @generated by portable-atomic-internal-codegen +// (gen function at tools/codegen/src/ffi.rs). +// It is not intended for manual editing. + +extern "C" { + pub fn getauxval(__type: ::std::os::raw::c_ulong) -> ::std::os::raw::c_ulong; +} diff --git a/tests/helper/src/gen/sys/aarch64_freebsd/mod.rs b/tests/helper/src/gen/sys/aarch64_freebsd/mod.rs index d103f50e..84e32580 100644 --- a/tests/helper/src/gen/sys/aarch64_freebsd/mod.rs +++ b/tests/helper/src/gen/sys/aarch64_freebsd/mod.rs @@ -6,17 +6,57 @@ mod sys_auxv; pub use sys_auxv::elf_aux_info; mod sys_elf_common; -pub use sys_elf_common::{AT_HWCAP, AT_HWCAP2}; +pub use sys_elf_common::AT_HWCAP; +pub use sys_elf_common::AT_HWCAP2; mod machine_elf; -pub use machine_elf::{ - HWCAP2_BF16, HWCAP2_BTI, HWCAP2_DCPODP, HWCAP2_DGH, HWCAP2_FLAGM2, HWCAP2_FRINT, - HWCAP2_I8MM, HWCAP2_RNG, HWCAP2_SVE2, HWCAP2_SVEAES, HWCAP2_SVEBF16, - HWCAP2_SVEBITPERM, HWCAP2_SVEF32MM, HWCAP2_SVEF64MM, HWCAP2_SVEI8MM, HWCAP2_SVEPMULL, - HWCAP2_SVESHA3, HWCAP2_SVESM4, HWCAP_AES, HWCAP_ASIMD, HWCAP_ASIMDDP, HWCAP_ASIMDFHM, - HWCAP_ASIMDHP, HWCAP_ASIMDRDM, HWCAP_ATOMICS, HWCAP_CPUID, HWCAP_CRC32, HWCAP_DCPOP, - HWCAP_DIT, HWCAP_EVTSTRM, HWCAP_FCMA, HWCAP_FLAGM, HWCAP_FP, HWCAP_FPHP, - HWCAP_ILRCPC, HWCAP_JSCVT, HWCAP_LRCPC, HWCAP_PACA, HWCAP_PACG, HWCAP_PMULL, - HWCAP_SB, HWCAP_SHA1, HWCAP_SHA2, HWCAP_SHA3, HWCAP_SHA512, HWCAP_SM3, HWCAP_SM4, - HWCAP_SSBS, HWCAP_SVE, HWCAP_USCAT, -}; +pub use machine_elf::HWCAP_FP; +pub use machine_elf::HWCAP_ASIMD; +pub use machine_elf::HWCAP_EVTSTRM; +pub use machine_elf::HWCAP_AES; +pub use machine_elf::HWCAP_PMULL; +pub use machine_elf::HWCAP_SHA1; +pub use machine_elf::HWCAP_SHA2; +pub use machine_elf::HWCAP_CRC32; +pub use machine_elf::HWCAP_ATOMICS; +pub use machine_elf::HWCAP_FPHP; +pub use machine_elf::HWCAP_ASIMDHP; +pub use machine_elf::HWCAP_CPUID; +pub use machine_elf::HWCAP_ASIMDRDM; +pub use machine_elf::HWCAP_JSCVT; +pub use machine_elf::HWCAP_FCMA; +pub use machine_elf::HWCAP_LRCPC; +pub use machine_elf::HWCAP_DCPOP; +pub use machine_elf::HWCAP_SHA3; +pub use machine_elf::HWCAP_SM3; +pub use machine_elf::HWCAP_SM4; +pub use machine_elf::HWCAP_ASIMDDP; +pub use machine_elf::HWCAP_SHA512; +pub use machine_elf::HWCAP_SVE; +pub use machine_elf::HWCAP_ASIMDFHM; +pub use machine_elf::HWCAP_DIT; +pub use machine_elf::HWCAP_USCAT; +pub use machine_elf::HWCAP_ILRCPC; +pub use machine_elf::HWCAP_FLAGM; +pub use machine_elf::HWCAP_SSBS; +pub use machine_elf::HWCAP_SB; +pub use machine_elf::HWCAP_PACA; +pub use machine_elf::HWCAP_PACG; +pub use machine_elf::HWCAP2_DCPODP; +pub use machine_elf::HWCAP2_SVE2; +pub use machine_elf::HWCAP2_SVEAES; +pub use machine_elf::HWCAP2_SVEPMULL; +pub use machine_elf::HWCAP2_SVEBITPERM; +pub use machine_elf::HWCAP2_SVESHA3; +pub use machine_elf::HWCAP2_SVESM4; +pub use machine_elf::HWCAP2_FLAGM2; +pub use machine_elf::HWCAP2_FRINT; +pub use machine_elf::HWCAP2_SVEI8MM; +pub use machine_elf::HWCAP2_SVEF32MM; +pub use machine_elf::HWCAP2_SVEF64MM; +pub use machine_elf::HWCAP2_SVEBF16; +pub use machine_elf::HWCAP2_I8MM; +pub use machine_elf::HWCAP2_BF16; +pub use machine_elf::HWCAP2_DGH; +pub use machine_elf::HWCAP2_RNG; +pub use machine_elf::HWCAP2_BTI; pub type c_char = u8; diff --git a/tests/helper/src/gen/sys/aarch64_fuchsia/mod.rs b/tests/helper/src/gen/sys/aarch64_fuchsia/mod.rs index 5862fc70..ea8ec9b3 100644 --- a/tests/helper/src/gen/sys/aarch64_fuchsia/mod.rs +++ b/tests/helper/src/gen/sys/aarch64_fuchsia/mod.rs @@ -8,14 +8,26 @@ pub use zircon_system_public_zircon_types::zx_status_t; mod zircon_system_public_zircon_errors; pub use zircon_system_public_zircon_errors::ZX_OK; mod zircon_system_public_zircon_features; -pub use zircon_system_public_zircon_features::{ - ZX_ARM64_FEATURE_ISA_AES, ZX_ARM64_FEATURE_ISA_ASIMD, ZX_ARM64_FEATURE_ISA_ATOMICS, - ZX_ARM64_FEATURE_ISA_CRC32, ZX_ARM64_FEATURE_ISA_DP, ZX_ARM64_FEATURE_ISA_DPB, - ZX_ARM64_FEATURE_ISA_FHM, ZX_ARM64_FEATURE_ISA_FP, ZX_ARM64_FEATURE_ISA_I8MM, - ZX_ARM64_FEATURE_ISA_PMULL, ZX_ARM64_FEATURE_ISA_RDM, ZX_ARM64_FEATURE_ISA_RNDR, - ZX_ARM64_FEATURE_ISA_SHA1, ZX_ARM64_FEATURE_ISA_SHA2, ZX_ARM64_FEATURE_ISA_SHA256, - ZX_ARM64_FEATURE_ISA_SHA3, ZX_ARM64_FEATURE_ISA_SHA512, ZX_ARM64_FEATURE_ISA_SM3, - ZX_ARM64_FEATURE_ISA_SM4, ZX_ARM64_FEATURE_ISA_SVE, ZX_ARM64_FEATURE_ISA_TS, - ZX_FEATURE_KIND_CPU, -}; +pub use zircon_system_public_zircon_features::ZX_FEATURE_KIND_CPU; +pub use zircon_system_public_zircon_features::ZX_ARM64_FEATURE_ISA_FP; +pub use zircon_system_public_zircon_features::ZX_ARM64_FEATURE_ISA_ASIMD; +pub use zircon_system_public_zircon_features::ZX_ARM64_FEATURE_ISA_AES; +pub use zircon_system_public_zircon_features::ZX_ARM64_FEATURE_ISA_PMULL; +pub use zircon_system_public_zircon_features::ZX_ARM64_FEATURE_ISA_SHA1; +pub use zircon_system_public_zircon_features::ZX_ARM64_FEATURE_ISA_SHA256; +pub use zircon_system_public_zircon_features::ZX_ARM64_FEATURE_ISA_CRC32; +pub use zircon_system_public_zircon_features::ZX_ARM64_FEATURE_ISA_ATOMICS; +pub use zircon_system_public_zircon_features::ZX_ARM64_FEATURE_ISA_RDM; +pub use zircon_system_public_zircon_features::ZX_ARM64_FEATURE_ISA_SHA3; +pub use zircon_system_public_zircon_features::ZX_ARM64_FEATURE_ISA_SM3; +pub use zircon_system_public_zircon_features::ZX_ARM64_FEATURE_ISA_SM4; +pub use zircon_system_public_zircon_features::ZX_ARM64_FEATURE_ISA_DP; +pub use zircon_system_public_zircon_features::ZX_ARM64_FEATURE_ISA_DPB; +pub use zircon_system_public_zircon_features::ZX_ARM64_FEATURE_ISA_FHM; +pub use zircon_system_public_zircon_features::ZX_ARM64_FEATURE_ISA_TS; +pub use zircon_system_public_zircon_features::ZX_ARM64_FEATURE_ISA_RNDR; +pub use zircon_system_public_zircon_features::ZX_ARM64_FEATURE_ISA_SHA512; +pub use zircon_system_public_zircon_features::ZX_ARM64_FEATURE_ISA_I8MM; +pub use zircon_system_public_zircon_features::ZX_ARM64_FEATURE_ISA_SVE; +pub use zircon_system_public_zircon_features::ZX_ARM64_FEATURE_ISA_SHA2; pub type c_char = u8; diff --git a/tests/helper/src/gen/sys/aarch64_fuchsia/zircon_system_public_zircon_features.rs b/tests/helper/src/gen/sys/aarch64_fuchsia/zircon_system_public_zircon_features.rs index 3f911261..2ec276c5 100644 --- a/tests/helper/src/gen/sys/aarch64_fuchsia/zircon_system_public_zircon_features.rs +++ b/tests/helper/src/gen/sys/aarch64_fuchsia/zircon_system_public_zircon_features.rs @@ -2,25 +2,25 @@ // (gen function at tools/codegen/src/ffi.rs). // It is not intended for manual editing. -pub const ZX_FEATURE_KIND_CPU: u32 = 0; -pub const ZX_ARM64_FEATURE_ISA_FP: u32 = 2; -pub const ZX_ARM64_FEATURE_ISA_ASIMD: u32 = 4; -pub const ZX_ARM64_FEATURE_ISA_AES: u32 = 8; -pub const ZX_ARM64_FEATURE_ISA_PMULL: u32 = 16; -pub const ZX_ARM64_FEATURE_ISA_SHA1: u32 = 32; -pub const ZX_ARM64_FEATURE_ISA_SHA256: u32 = 64; -pub const ZX_ARM64_FEATURE_ISA_CRC32: u32 = 128; -pub const ZX_ARM64_FEATURE_ISA_ATOMICS: u32 = 256; -pub const ZX_ARM64_FEATURE_ISA_RDM: u32 = 512; -pub const ZX_ARM64_FEATURE_ISA_SHA3: u32 = 1024; -pub const ZX_ARM64_FEATURE_ISA_SM3: u32 = 2048; -pub const ZX_ARM64_FEATURE_ISA_SM4: u32 = 4096; -pub const ZX_ARM64_FEATURE_ISA_DP: u32 = 8192; -pub const ZX_ARM64_FEATURE_ISA_DPB: u32 = 16384; -pub const ZX_ARM64_FEATURE_ISA_FHM: u32 = 32768; -pub const ZX_ARM64_FEATURE_ISA_TS: u32 = 65536; -pub const ZX_ARM64_FEATURE_ISA_RNDR: u32 = 131072; -pub const ZX_ARM64_FEATURE_ISA_SHA512: u32 = 262144; -pub const ZX_ARM64_FEATURE_ISA_I8MM: u32 = 524288; -pub const ZX_ARM64_FEATURE_ISA_SVE: u32 = 1048576; -pub const ZX_ARM64_FEATURE_ISA_SHA2: u32 = 64; +pub const ZX_FEATURE_KIND_CPU: u32 = 0u8 as u32; +pub const ZX_ARM64_FEATURE_ISA_FP: u32 = 2u8 as u32; +pub const ZX_ARM64_FEATURE_ISA_ASIMD: u32 = 4u8 as u32; +pub const ZX_ARM64_FEATURE_ISA_AES: u32 = 8u8 as u32; +pub const ZX_ARM64_FEATURE_ISA_PMULL: u32 = 16u8 as u32; +pub const ZX_ARM64_FEATURE_ISA_SHA1: u32 = 32u8 as u32; +pub const ZX_ARM64_FEATURE_ISA_SHA256: u32 = 64u8 as u32; +pub const ZX_ARM64_FEATURE_ISA_CRC32: u32 = 128u8 as u32; +pub const ZX_ARM64_FEATURE_ISA_ATOMICS: u32 = 256u16 as u32; +pub const ZX_ARM64_FEATURE_ISA_RDM: u32 = 512u16 as u32; +pub const ZX_ARM64_FEATURE_ISA_SHA3: u32 = 1024u16 as u32; +pub const ZX_ARM64_FEATURE_ISA_SM3: u32 = 2048u16 as u32; +pub const ZX_ARM64_FEATURE_ISA_SM4: u32 = 4096u16 as u32; +pub const ZX_ARM64_FEATURE_ISA_DP: u32 = 8192u16 as u32; +pub const ZX_ARM64_FEATURE_ISA_DPB: u32 = 16384u16 as u32; +pub const ZX_ARM64_FEATURE_ISA_FHM: u32 = 32768u16 as u32; +pub const ZX_ARM64_FEATURE_ISA_TS: u32 = 65536u32 as u32; +pub const ZX_ARM64_FEATURE_ISA_RNDR: u32 = 131072u32 as u32; +pub const ZX_ARM64_FEATURE_ISA_SHA512: u32 = 262144u32 as u32; +pub const ZX_ARM64_FEATURE_ISA_I8MM: u32 = 524288u32 as u32; +pub const ZX_ARM64_FEATURE_ISA_SVE: u32 = 1048576u32 as u32; +pub const ZX_ARM64_FEATURE_ISA_SHA2: u32 = 64u8 as u32; diff --git a/tests/helper/src/gen/sys/aarch64_linux_android/mod.rs b/tests/helper/src/gen/sys/aarch64_linux_android/mod.rs index ae47e902..192806c0 100644 --- a/tests/helper/src/gen/sys/aarch64_linux_android/mod.rs +++ b/tests/helper/src/gen/sys/aarch64_linux_android/mod.rs @@ -4,26 +4,88 @@ #![cfg_attr(rustfmt, rustfmt::skip)] mod linux_headers_linux_auxvec; -pub use linux_headers_linux_auxvec::{AT_HWCAP, AT_HWCAP2}; +pub use linux_headers_linux_auxvec::AT_HWCAP; +pub use linux_headers_linux_auxvec::AT_HWCAP2; mod linux_headers_asm_hwcap; -pub use linux_headers_asm_hwcap::{ - HWCAP2_AFP, HWCAP2_BF16, HWCAP2_BTI, HWCAP2_CSSC, HWCAP2_DCPODP, HWCAP2_DGH, - HWCAP2_EBF16, HWCAP2_ECV, HWCAP2_FLAGM2, HWCAP2_FRINT, HWCAP2_I8MM, HWCAP2_MOPS, - HWCAP2_MTE, HWCAP2_MTE3, HWCAP2_RNG, HWCAP2_RPRES, HWCAP2_RPRFM, HWCAP2_SME, - HWCAP2_SME2, HWCAP2_SME2P1, HWCAP2_SME_B16B16, HWCAP2_SME_B16F32, HWCAP2_SME_BI32I32, - HWCAP2_SME_F16F16, HWCAP2_SME_F16F32, HWCAP2_SME_F32F32, HWCAP2_SME_F64F64, - HWCAP2_SME_FA64, HWCAP2_SME_I16I32, HWCAP2_SME_I16I64, HWCAP2_SME_I8I32, HWCAP2_SVE2, - HWCAP2_SVE2P1, HWCAP2_SVEAES, HWCAP2_SVEBF16, HWCAP2_SVEBITPERM, HWCAP2_SVEF32MM, - HWCAP2_SVEF64MM, HWCAP2_SVEI8MM, HWCAP2_SVEPMULL, HWCAP2_SVESHA3, HWCAP2_SVESM4, - HWCAP2_SVE_EBF16, HWCAP2_WFXT, HWCAP_AES, HWCAP_ASIMD, HWCAP_ASIMDDP, HWCAP_ASIMDFHM, - HWCAP_ASIMDHP, HWCAP_ASIMDRDM, HWCAP_ATOMICS, HWCAP_CPUID, HWCAP_CRC32, HWCAP_DCPOP, - HWCAP_DIT, HWCAP_EVTSTRM, HWCAP_FCMA, HWCAP_FLAGM, HWCAP_FP, HWCAP_FPHP, - HWCAP_ILRCPC, HWCAP_JSCVT, HWCAP_LRCPC, HWCAP_PACA, HWCAP_PACG, HWCAP_PMULL, - HWCAP_SB, HWCAP_SHA1, HWCAP_SHA2, HWCAP_SHA3, HWCAP_SHA512, HWCAP_SM3, HWCAP_SM4, - HWCAP_SSBS, HWCAP_SVE, HWCAP_USCAT, -}; -mod bionic_sys_auxv; -pub use bionic_sys_auxv::getauxval; -mod bionic_sys_system_properties; -pub use bionic_sys_system_properties::{PROP_VALUE_MAX, __system_property_get}; +pub use linux_headers_asm_hwcap::HWCAP_FP; +pub use linux_headers_asm_hwcap::HWCAP_ASIMD; +pub use linux_headers_asm_hwcap::HWCAP_EVTSTRM; +pub use linux_headers_asm_hwcap::HWCAP_AES; +pub use linux_headers_asm_hwcap::HWCAP_PMULL; +pub use linux_headers_asm_hwcap::HWCAP_SHA1; +pub use linux_headers_asm_hwcap::HWCAP_SHA2; +pub use linux_headers_asm_hwcap::HWCAP_CRC32; +pub use linux_headers_asm_hwcap::HWCAP_ATOMICS; +pub use linux_headers_asm_hwcap::HWCAP_FPHP; +pub use linux_headers_asm_hwcap::HWCAP_ASIMDHP; +pub use linux_headers_asm_hwcap::HWCAP_CPUID; +pub use linux_headers_asm_hwcap::HWCAP_ASIMDRDM; +pub use linux_headers_asm_hwcap::HWCAP_JSCVT; +pub use linux_headers_asm_hwcap::HWCAP_FCMA; +pub use linux_headers_asm_hwcap::HWCAP_LRCPC; +pub use linux_headers_asm_hwcap::HWCAP_DCPOP; +pub use linux_headers_asm_hwcap::HWCAP_SHA3; +pub use linux_headers_asm_hwcap::HWCAP_SM3; +pub use linux_headers_asm_hwcap::HWCAP_SM4; +pub use linux_headers_asm_hwcap::HWCAP_ASIMDDP; +pub use linux_headers_asm_hwcap::HWCAP_SHA512; +pub use linux_headers_asm_hwcap::HWCAP_SVE; +pub use linux_headers_asm_hwcap::HWCAP_ASIMDFHM; +pub use linux_headers_asm_hwcap::HWCAP_DIT; +pub use linux_headers_asm_hwcap::HWCAP_USCAT; +pub use linux_headers_asm_hwcap::HWCAP_ILRCPC; +pub use linux_headers_asm_hwcap::HWCAP_FLAGM; +pub use linux_headers_asm_hwcap::HWCAP_SSBS; +pub use linux_headers_asm_hwcap::HWCAP_SB; +pub use linux_headers_asm_hwcap::HWCAP_PACA; +pub use linux_headers_asm_hwcap::HWCAP_PACG; +pub use linux_headers_asm_hwcap::HWCAP2_DCPODP; +pub use linux_headers_asm_hwcap::HWCAP2_SVE2; +pub use linux_headers_asm_hwcap::HWCAP2_SVEAES; +pub use linux_headers_asm_hwcap::HWCAP2_SVEPMULL; +pub use linux_headers_asm_hwcap::HWCAP2_SVEBITPERM; +pub use linux_headers_asm_hwcap::HWCAP2_SVESHA3; +pub use linux_headers_asm_hwcap::HWCAP2_SVESM4; +pub use linux_headers_asm_hwcap::HWCAP2_FLAGM2; +pub use linux_headers_asm_hwcap::HWCAP2_FRINT; +pub use linux_headers_asm_hwcap::HWCAP2_SVEI8MM; +pub use linux_headers_asm_hwcap::HWCAP2_SVEF32MM; +pub use linux_headers_asm_hwcap::HWCAP2_SVEF64MM; +pub use linux_headers_asm_hwcap::HWCAP2_SVEBF16; +pub use linux_headers_asm_hwcap::HWCAP2_I8MM; +pub use linux_headers_asm_hwcap::HWCAP2_BF16; +pub use linux_headers_asm_hwcap::HWCAP2_DGH; +pub use linux_headers_asm_hwcap::HWCAP2_RNG; +pub use linux_headers_asm_hwcap::HWCAP2_BTI; +pub use linux_headers_asm_hwcap::HWCAP2_MTE; +pub use linux_headers_asm_hwcap::HWCAP2_ECV; +pub use linux_headers_asm_hwcap::HWCAP2_AFP; +pub use linux_headers_asm_hwcap::HWCAP2_RPRES; +pub use linux_headers_asm_hwcap::HWCAP2_MTE3; +pub use linux_headers_asm_hwcap::HWCAP2_SME; +pub use linux_headers_asm_hwcap::HWCAP2_SME_I16I64; +pub use linux_headers_asm_hwcap::HWCAP2_SME_F64F64; +pub use linux_headers_asm_hwcap::HWCAP2_SME_I8I32; +pub use linux_headers_asm_hwcap::HWCAP2_SME_F16F32; +pub use linux_headers_asm_hwcap::HWCAP2_SME_B16F32; +pub use linux_headers_asm_hwcap::HWCAP2_SME_F32F32; +pub use linux_headers_asm_hwcap::HWCAP2_SME_FA64; +pub use linux_headers_asm_hwcap::HWCAP2_WFXT; +pub use linux_headers_asm_hwcap::HWCAP2_EBF16; +pub use linux_headers_asm_hwcap::HWCAP2_SVE_EBF16; +pub use linux_headers_asm_hwcap::HWCAP2_CSSC; +pub use linux_headers_asm_hwcap::HWCAP2_RPRFM; +pub use linux_headers_asm_hwcap::HWCAP2_SVE2P1; +pub use linux_headers_asm_hwcap::HWCAP2_SME2; +pub use linux_headers_asm_hwcap::HWCAP2_SME2P1; +pub use linux_headers_asm_hwcap::HWCAP2_SME_I16I32; +pub use linux_headers_asm_hwcap::HWCAP2_SME_BI32I32; +pub use linux_headers_asm_hwcap::HWCAP2_SME_B16B16; +pub use linux_headers_asm_hwcap::HWCAP2_SME_F16F16; +pub use linux_headers_asm_hwcap::HWCAP2_MOPS; +mod sys_auxv; +pub use sys_auxv::getauxval; +mod sys_system_properties; +pub use sys_system_properties::PROP_VALUE_MAX; +pub use sys_system_properties::__system_property_get; pub type c_char = u8; diff --git a/tests/helper/src/gen/sys/aarch64_linux_android/sys_auxv.rs b/tests/helper/src/gen/sys/aarch64_linux_android/sys_auxv.rs new file mode 100644 index 00000000..a53605f5 --- /dev/null +++ b/tests/helper/src/gen/sys/aarch64_linux_android/sys_auxv.rs @@ -0,0 +1,7 @@ +// This file is @generated by portable-atomic-internal-codegen +// (gen function at tools/codegen/src/ffi.rs). +// It is not intended for manual editing. + +extern "C" { + pub fn getauxval(__type: ::std::os::raw::c_ulong) -> ::std::os::raw::c_ulong; +} diff --git a/tests/helper/src/gen/sys/aarch64_linux_android/bionic_sys_system_properties.rs b/tests/helper/src/gen/sys/aarch64_linux_android/sys_system_properties.rs similarity index 100% rename from tests/helper/src/gen/sys/aarch64_linux_android/bionic_sys_system_properties.rs rename to tests/helper/src/gen/sys/aarch64_linux_android/sys_system_properties.rs diff --git a/tests/helper/src/gen/sys/aarch64_linux_gnu/mod.rs b/tests/helper/src/gen/sys/aarch64_linux_gnu/mod.rs index d7e34188..4537d2f2 100644 --- a/tests/helper/src/gen/sys/aarch64_linux_gnu/mod.rs +++ b/tests/helper/src/gen/sys/aarch64_linux_gnu/mod.rs @@ -4,22 +4,85 @@ #![cfg_attr(rustfmt, rustfmt::skip)] mod linux_headers_linux_auxvec; -pub use linux_headers_linux_auxvec::{AT_HWCAP, AT_HWCAP2}; +pub use linux_headers_linux_auxvec::AT_HWCAP; +pub use linux_headers_linux_auxvec::AT_HWCAP2; mod linux_headers_asm_hwcap; -pub use linux_headers_asm_hwcap::{ - HWCAP2_AFP, HWCAP2_BF16, HWCAP2_BTI, HWCAP2_CSSC, HWCAP2_DCPODP, HWCAP2_DGH, - HWCAP2_EBF16, HWCAP2_ECV, HWCAP2_FLAGM2, HWCAP2_FRINT, HWCAP2_I8MM, HWCAP2_MOPS, - HWCAP2_MTE, HWCAP2_MTE3, HWCAP2_RNG, HWCAP2_RPRES, HWCAP2_RPRFM, HWCAP2_SME, - HWCAP2_SME2, HWCAP2_SME2P1, HWCAP2_SME_B16B16, HWCAP2_SME_B16F32, HWCAP2_SME_BI32I32, - HWCAP2_SME_F16F16, HWCAP2_SME_F16F32, HWCAP2_SME_F32F32, HWCAP2_SME_F64F64, - HWCAP2_SME_FA64, HWCAP2_SME_I16I32, HWCAP2_SME_I16I64, HWCAP2_SME_I8I32, HWCAP2_SVE2, - HWCAP2_SVE2P1, HWCAP2_SVEAES, HWCAP2_SVEBF16, HWCAP2_SVEBITPERM, HWCAP2_SVEF32MM, - HWCAP2_SVEF64MM, HWCAP2_SVEI8MM, HWCAP2_SVEPMULL, HWCAP2_SVESHA3, HWCAP2_SVESM4, - HWCAP2_SVE_EBF16, HWCAP2_WFXT, HWCAP_AES, HWCAP_ASIMD, HWCAP_ASIMDDP, HWCAP_ASIMDFHM, - HWCAP_ASIMDHP, HWCAP_ASIMDRDM, HWCAP_ATOMICS, HWCAP_CPUID, HWCAP_CRC32, HWCAP_DCPOP, - HWCAP_DIT, HWCAP_EVTSTRM, HWCAP_FCMA, HWCAP_FLAGM, HWCAP_FP, HWCAP_FPHP, - HWCAP_ILRCPC, HWCAP_JSCVT, HWCAP_LRCPC, HWCAP_PACA, HWCAP_PACG, HWCAP_PMULL, - HWCAP_SB, HWCAP_SHA1, HWCAP_SHA2, HWCAP_SHA3, HWCAP_SHA512, HWCAP_SM3, HWCAP_SM4, - HWCAP_SSBS, HWCAP_SVE, HWCAP_USCAT, -}; +pub use linux_headers_asm_hwcap::HWCAP_FP; +pub use linux_headers_asm_hwcap::HWCAP_ASIMD; +pub use linux_headers_asm_hwcap::HWCAP_EVTSTRM; +pub use linux_headers_asm_hwcap::HWCAP_AES; +pub use linux_headers_asm_hwcap::HWCAP_PMULL; +pub use linux_headers_asm_hwcap::HWCAP_SHA1; +pub use linux_headers_asm_hwcap::HWCAP_SHA2; +pub use linux_headers_asm_hwcap::HWCAP_CRC32; +pub use linux_headers_asm_hwcap::HWCAP_ATOMICS; +pub use linux_headers_asm_hwcap::HWCAP_FPHP; +pub use linux_headers_asm_hwcap::HWCAP_ASIMDHP; +pub use linux_headers_asm_hwcap::HWCAP_CPUID; +pub use linux_headers_asm_hwcap::HWCAP_ASIMDRDM; +pub use linux_headers_asm_hwcap::HWCAP_JSCVT; +pub use linux_headers_asm_hwcap::HWCAP_FCMA; +pub use linux_headers_asm_hwcap::HWCAP_LRCPC; +pub use linux_headers_asm_hwcap::HWCAP_DCPOP; +pub use linux_headers_asm_hwcap::HWCAP_SHA3; +pub use linux_headers_asm_hwcap::HWCAP_SM3; +pub use linux_headers_asm_hwcap::HWCAP_SM4; +pub use linux_headers_asm_hwcap::HWCAP_ASIMDDP; +pub use linux_headers_asm_hwcap::HWCAP_SHA512; +pub use linux_headers_asm_hwcap::HWCAP_SVE; +pub use linux_headers_asm_hwcap::HWCAP_ASIMDFHM; +pub use linux_headers_asm_hwcap::HWCAP_DIT; +pub use linux_headers_asm_hwcap::HWCAP_USCAT; +pub use linux_headers_asm_hwcap::HWCAP_ILRCPC; +pub use linux_headers_asm_hwcap::HWCAP_FLAGM; +pub use linux_headers_asm_hwcap::HWCAP_SSBS; +pub use linux_headers_asm_hwcap::HWCAP_SB; +pub use linux_headers_asm_hwcap::HWCAP_PACA; +pub use linux_headers_asm_hwcap::HWCAP_PACG; +pub use linux_headers_asm_hwcap::HWCAP2_DCPODP; +pub use linux_headers_asm_hwcap::HWCAP2_SVE2; +pub use linux_headers_asm_hwcap::HWCAP2_SVEAES; +pub use linux_headers_asm_hwcap::HWCAP2_SVEPMULL; +pub use linux_headers_asm_hwcap::HWCAP2_SVEBITPERM; +pub use linux_headers_asm_hwcap::HWCAP2_SVESHA3; +pub use linux_headers_asm_hwcap::HWCAP2_SVESM4; +pub use linux_headers_asm_hwcap::HWCAP2_FLAGM2; +pub use linux_headers_asm_hwcap::HWCAP2_FRINT; +pub use linux_headers_asm_hwcap::HWCAP2_SVEI8MM; +pub use linux_headers_asm_hwcap::HWCAP2_SVEF32MM; +pub use linux_headers_asm_hwcap::HWCAP2_SVEF64MM; +pub use linux_headers_asm_hwcap::HWCAP2_SVEBF16; +pub use linux_headers_asm_hwcap::HWCAP2_I8MM; +pub use linux_headers_asm_hwcap::HWCAP2_BF16; +pub use linux_headers_asm_hwcap::HWCAP2_DGH; +pub use linux_headers_asm_hwcap::HWCAP2_RNG; +pub use linux_headers_asm_hwcap::HWCAP2_BTI; +pub use linux_headers_asm_hwcap::HWCAP2_MTE; +pub use linux_headers_asm_hwcap::HWCAP2_ECV; +pub use linux_headers_asm_hwcap::HWCAP2_AFP; +pub use linux_headers_asm_hwcap::HWCAP2_RPRES; +pub use linux_headers_asm_hwcap::HWCAP2_MTE3; +pub use linux_headers_asm_hwcap::HWCAP2_SME; +pub use linux_headers_asm_hwcap::HWCAP2_SME_I16I64; +pub use linux_headers_asm_hwcap::HWCAP2_SME_F64F64; +pub use linux_headers_asm_hwcap::HWCAP2_SME_I8I32; +pub use linux_headers_asm_hwcap::HWCAP2_SME_F16F32; +pub use linux_headers_asm_hwcap::HWCAP2_SME_B16F32; +pub use linux_headers_asm_hwcap::HWCAP2_SME_F32F32; +pub use linux_headers_asm_hwcap::HWCAP2_SME_FA64; +pub use linux_headers_asm_hwcap::HWCAP2_WFXT; +pub use linux_headers_asm_hwcap::HWCAP2_EBF16; +pub use linux_headers_asm_hwcap::HWCAP2_SVE_EBF16; +pub use linux_headers_asm_hwcap::HWCAP2_CSSC; +pub use linux_headers_asm_hwcap::HWCAP2_RPRFM; +pub use linux_headers_asm_hwcap::HWCAP2_SVE2P1; +pub use linux_headers_asm_hwcap::HWCAP2_SME2; +pub use linux_headers_asm_hwcap::HWCAP2_SME2P1; +pub use linux_headers_asm_hwcap::HWCAP2_SME_I16I32; +pub use linux_headers_asm_hwcap::HWCAP2_SME_BI32I32; +pub use linux_headers_asm_hwcap::HWCAP2_SME_B16B16; +pub use linux_headers_asm_hwcap::HWCAP2_SME_F16F16; +pub use linux_headers_asm_hwcap::HWCAP2_MOPS; +mod sys_auxv; +pub use sys_auxv::getauxval; pub type c_char = u8; diff --git a/tests/helper/src/gen/sys/aarch64_linux_gnu/sys_auxv.rs b/tests/helper/src/gen/sys/aarch64_linux_gnu/sys_auxv.rs new file mode 100644 index 00000000..a53605f5 --- /dev/null +++ b/tests/helper/src/gen/sys/aarch64_linux_gnu/sys_auxv.rs @@ -0,0 +1,7 @@ +// This file is @generated by portable-atomic-internal-codegen +// (gen function at tools/codegen/src/ffi.rs). +// It is not intended for manual editing. + +extern "C" { + pub fn getauxval(__type: ::std::os::raw::c_ulong) -> ::std::os::raw::c_ulong; +} diff --git a/tests/helper/src/gen/sys/aarch64_linux_gnu_ilp32/mod.rs b/tests/helper/src/gen/sys/aarch64_linux_gnu_ilp32/mod.rs index d7e34188..4537d2f2 100644 --- a/tests/helper/src/gen/sys/aarch64_linux_gnu_ilp32/mod.rs +++ b/tests/helper/src/gen/sys/aarch64_linux_gnu_ilp32/mod.rs @@ -4,22 +4,85 @@ #![cfg_attr(rustfmt, rustfmt::skip)] mod linux_headers_linux_auxvec; -pub use linux_headers_linux_auxvec::{AT_HWCAP, AT_HWCAP2}; +pub use linux_headers_linux_auxvec::AT_HWCAP; +pub use linux_headers_linux_auxvec::AT_HWCAP2; mod linux_headers_asm_hwcap; -pub use linux_headers_asm_hwcap::{ - HWCAP2_AFP, HWCAP2_BF16, HWCAP2_BTI, HWCAP2_CSSC, HWCAP2_DCPODP, HWCAP2_DGH, - HWCAP2_EBF16, HWCAP2_ECV, HWCAP2_FLAGM2, HWCAP2_FRINT, HWCAP2_I8MM, HWCAP2_MOPS, - HWCAP2_MTE, HWCAP2_MTE3, HWCAP2_RNG, HWCAP2_RPRES, HWCAP2_RPRFM, HWCAP2_SME, - HWCAP2_SME2, HWCAP2_SME2P1, HWCAP2_SME_B16B16, HWCAP2_SME_B16F32, HWCAP2_SME_BI32I32, - HWCAP2_SME_F16F16, HWCAP2_SME_F16F32, HWCAP2_SME_F32F32, HWCAP2_SME_F64F64, - HWCAP2_SME_FA64, HWCAP2_SME_I16I32, HWCAP2_SME_I16I64, HWCAP2_SME_I8I32, HWCAP2_SVE2, - HWCAP2_SVE2P1, HWCAP2_SVEAES, HWCAP2_SVEBF16, HWCAP2_SVEBITPERM, HWCAP2_SVEF32MM, - HWCAP2_SVEF64MM, HWCAP2_SVEI8MM, HWCAP2_SVEPMULL, HWCAP2_SVESHA3, HWCAP2_SVESM4, - HWCAP2_SVE_EBF16, HWCAP2_WFXT, HWCAP_AES, HWCAP_ASIMD, HWCAP_ASIMDDP, HWCAP_ASIMDFHM, - HWCAP_ASIMDHP, HWCAP_ASIMDRDM, HWCAP_ATOMICS, HWCAP_CPUID, HWCAP_CRC32, HWCAP_DCPOP, - HWCAP_DIT, HWCAP_EVTSTRM, HWCAP_FCMA, HWCAP_FLAGM, HWCAP_FP, HWCAP_FPHP, - HWCAP_ILRCPC, HWCAP_JSCVT, HWCAP_LRCPC, HWCAP_PACA, HWCAP_PACG, HWCAP_PMULL, - HWCAP_SB, HWCAP_SHA1, HWCAP_SHA2, HWCAP_SHA3, HWCAP_SHA512, HWCAP_SM3, HWCAP_SM4, - HWCAP_SSBS, HWCAP_SVE, HWCAP_USCAT, -}; +pub use linux_headers_asm_hwcap::HWCAP_FP; +pub use linux_headers_asm_hwcap::HWCAP_ASIMD; +pub use linux_headers_asm_hwcap::HWCAP_EVTSTRM; +pub use linux_headers_asm_hwcap::HWCAP_AES; +pub use linux_headers_asm_hwcap::HWCAP_PMULL; +pub use linux_headers_asm_hwcap::HWCAP_SHA1; +pub use linux_headers_asm_hwcap::HWCAP_SHA2; +pub use linux_headers_asm_hwcap::HWCAP_CRC32; +pub use linux_headers_asm_hwcap::HWCAP_ATOMICS; +pub use linux_headers_asm_hwcap::HWCAP_FPHP; +pub use linux_headers_asm_hwcap::HWCAP_ASIMDHP; +pub use linux_headers_asm_hwcap::HWCAP_CPUID; +pub use linux_headers_asm_hwcap::HWCAP_ASIMDRDM; +pub use linux_headers_asm_hwcap::HWCAP_JSCVT; +pub use linux_headers_asm_hwcap::HWCAP_FCMA; +pub use linux_headers_asm_hwcap::HWCAP_LRCPC; +pub use linux_headers_asm_hwcap::HWCAP_DCPOP; +pub use linux_headers_asm_hwcap::HWCAP_SHA3; +pub use linux_headers_asm_hwcap::HWCAP_SM3; +pub use linux_headers_asm_hwcap::HWCAP_SM4; +pub use linux_headers_asm_hwcap::HWCAP_ASIMDDP; +pub use linux_headers_asm_hwcap::HWCAP_SHA512; +pub use linux_headers_asm_hwcap::HWCAP_SVE; +pub use linux_headers_asm_hwcap::HWCAP_ASIMDFHM; +pub use linux_headers_asm_hwcap::HWCAP_DIT; +pub use linux_headers_asm_hwcap::HWCAP_USCAT; +pub use linux_headers_asm_hwcap::HWCAP_ILRCPC; +pub use linux_headers_asm_hwcap::HWCAP_FLAGM; +pub use linux_headers_asm_hwcap::HWCAP_SSBS; +pub use linux_headers_asm_hwcap::HWCAP_SB; +pub use linux_headers_asm_hwcap::HWCAP_PACA; +pub use linux_headers_asm_hwcap::HWCAP_PACG; +pub use linux_headers_asm_hwcap::HWCAP2_DCPODP; +pub use linux_headers_asm_hwcap::HWCAP2_SVE2; +pub use linux_headers_asm_hwcap::HWCAP2_SVEAES; +pub use linux_headers_asm_hwcap::HWCAP2_SVEPMULL; +pub use linux_headers_asm_hwcap::HWCAP2_SVEBITPERM; +pub use linux_headers_asm_hwcap::HWCAP2_SVESHA3; +pub use linux_headers_asm_hwcap::HWCAP2_SVESM4; +pub use linux_headers_asm_hwcap::HWCAP2_FLAGM2; +pub use linux_headers_asm_hwcap::HWCAP2_FRINT; +pub use linux_headers_asm_hwcap::HWCAP2_SVEI8MM; +pub use linux_headers_asm_hwcap::HWCAP2_SVEF32MM; +pub use linux_headers_asm_hwcap::HWCAP2_SVEF64MM; +pub use linux_headers_asm_hwcap::HWCAP2_SVEBF16; +pub use linux_headers_asm_hwcap::HWCAP2_I8MM; +pub use linux_headers_asm_hwcap::HWCAP2_BF16; +pub use linux_headers_asm_hwcap::HWCAP2_DGH; +pub use linux_headers_asm_hwcap::HWCAP2_RNG; +pub use linux_headers_asm_hwcap::HWCAP2_BTI; +pub use linux_headers_asm_hwcap::HWCAP2_MTE; +pub use linux_headers_asm_hwcap::HWCAP2_ECV; +pub use linux_headers_asm_hwcap::HWCAP2_AFP; +pub use linux_headers_asm_hwcap::HWCAP2_RPRES; +pub use linux_headers_asm_hwcap::HWCAP2_MTE3; +pub use linux_headers_asm_hwcap::HWCAP2_SME; +pub use linux_headers_asm_hwcap::HWCAP2_SME_I16I64; +pub use linux_headers_asm_hwcap::HWCAP2_SME_F64F64; +pub use linux_headers_asm_hwcap::HWCAP2_SME_I8I32; +pub use linux_headers_asm_hwcap::HWCAP2_SME_F16F32; +pub use linux_headers_asm_hwcap::HWCAP2_SME_B16F32; +pub use linux_headers_asm_hwcap::HWCAP2_SME_F32F32; +pub use linux_headers_asm_hwcap::HWCAP2_SME_FA64; +pub use linux_headers_asm_hwcap::HWCAP2_WFXT; +pub use linux_headers_asm_hwcap::HWCAP2_EBF16; +pub use linux_headers_asm_hwcap::HWCAP2_SVE_EBF16; +pub use linux_headers_asm_hwcap::HWCAP2_CSSC; +pub use linux_headers_asm_hwcap::HWCAP2_RPRFM; +pub use linux_headers_asm_hwcap::HWCAP2_SVE2P1; +pub use linux_headers_asm_hwcap::HWCAP2_SME2; +pub use linux_headers_asm_hwcap::HWCAP2_SME2P1; +pub use linux_headers_asm_hwcap::HWCAP2_SME_I16I32; +pub use linux_headers_asm_hwcap::HWCAP2_SME_BI32I32; +pub use linux_headers_asm_hwcap::HWCAP2_SME_B16B16; +pub use linux_headers_asm_hwcap::HWCAP2_SME_F16F16; +pub use linux_headers_asm_hwcap::HWCAP2_MOPS; +mod sys_auxv; +pub use sys_auxv::getauxval; pub type c_char = u8; diff --git a/tests/helper/src/gen/sys/aarch64_linux_gnu_ilp32/sys_auxv.rs b/tests/helper/src/gen/sys/aarch64_linux_gnu_ilp32/sys_auxv.rs new file mode 100644 index 00000000..a53605f5 --- /dev/null +++ b/tests/helper/src/gen/sys/aarch64_linux_gnu_ilp32/sys_auxv.rs @@ -0,0 +1,7 @@ +// This file is @generated by portable-atomic-internal-codegen +// (gen function at tools/codegen/src/ffi.rs). +// It is not intended for manual editing. + +extern "C" { + pub fn getauxval(__type: ::std::os::raw::c_ulong) -> ::std::os::raw::c_ulong; +} diff --git a/tests/helper/src/gen/sys/aarch64_linux_musl/mod.rs b/tests/helper/src/gen/sys/aarch64_linux_musl/mod.rs index 6255819b..4537d2f2 100644 --- a/tests/helper/src/gen/sys/aarch64_linux_musl/mod.rs +++ b/tests/helper/src/gen/sys/aarch64_linux_musl/mod.rs @@ -4,24 +4,85 @@ #![cfg_attr(rustfmt, rustfmt::skip)] mod linux_headers_linux_auxvec; -pub use linux_headers_linux_auxvec::{AT_HWCAP, AT_HWCAP2}; +pub use linux_headers_linux_auxvec::AT_HWCAP; +pub use linux_headers_linux_auxvec::AT_HWCAP2; mod linux_headers_asm_hwcap; -pub use linux_headers_asm_hwcap::{ - HWCAP2_AFP, HWCAP2_BF16, HWCAP2_BTI, HWCAP2_CSSC, HWCAP2_DCPODP, HWCAP2_DGH, - HWCAP2_EBF16, HWCAP2_ECV, HWCAP2_FLAGM2, HWCAP2_FRINT, HWCAP2_I8MM, HWCAP2_MOPS, - HWCAP2_MTE, HWCAP2_MTE3, HWCAP2_RNG, HWCAP2_RPRES, HWCAP2_RPRFM, HWCAP2_SME, - HWCAP2_SME2, HWCAP2_SME2P1, HWCAP2_SME_B16B16, HWCAP2_SME_B16F32, HWCAP2_SME_BI32I32, - HWCAP2_SME_F16F16, HWCAP2_SME_F16F32, HWCAP2_SME_F32F32, HWCAP2_SME_F64F64, - HWCAP2_SME_FA64, HWCAP2_SME_I16I32, HWCAP2_SME_I16I64, HWCAP2_SME_I8I32, HWCAP2_SVE2, - HWCAP2_SVE2P1, HWCAP2_SVEAES, HWCAP2_SVEBF16, HWCAP2_SVEBITPERM, HWCAP2_SVEF32MM, - HWCAP2_SVEF64MM, HWCAP2_SVEI8MM, HWCAP2_SVEPMULL, HWCAP2_SVESHA3, HWCAP2_SVESM4, - HWCAP2_SVE_EBF16, HWCAP2_WFXT, HWCAP_AES, HWCAP_ASIMD, HWCAP_ASIMDDP, HWCAP_ASIMDFHM, - HWCAP_ASIMDHP, HWCAP_ASIMDRDM, HWCAP_ATOMICS, HWCAP_CPUID, HWCAP_CRC32, HWCAP_DCPOP, - HWCAP_DIT, HWCAP_EVTSTRM, HWCAP_FCMA, HWCAP_FLAGM, HWCAP_FP, HWCAP_FPHP, - HWCAP_ILRCPC, HWCAP_JSCVT, HWCAP_LRCPC, HWCAP_PACA, HWCAP_PACG, HWCAP_PMULL, - HWCAP_SB, HWCAP_SHA1, HWCAP_SHA2, HWCAP_SHA3, HWCAP_SHA512, HWCAP_SM3, HWCAP_SM4, - HWCAP_SSBS, HWCAP_SVE, HWCAP_USCAT, -}; -mod musl_sys_auxv; -pub use musl_sys_auxv::getauxval; +pub use linux_headers_asm_hwcap::HWCAP_FP; +pub use linux_headers_asm_hwcap::HWCAP_ASIMD; +pub use linux_headers_asm_hwcap::HWCAP_EVTSTRM; +pub use linux_headers_asm_hwcap::HWCAP_AES; +pub use linux_headers_asm_hwcap::HWCAP_PMULL; +pub use linux_headers_asm_hwcap::HWCAP_SHA1; +pub use linux_headers_asm_hwcap::HWCAP_SHA2; +pub use linux_headers_asm_hwcap::HWCAP_CRC32; +pub use linux_headers_asm_hwcap::HWCAP_ATOMICS; +pub use linux_headers_asm_hwcap::HWCAP_FPHP; +pub use linux_headers_asm_hwcap::HWCAP_ASIMDHP; +pub use linux_headers_asm_hwcap::HWCAP_CPUID; +pub use linux_headers_asm_hwcap::HWCAP_ASIMDRDM; +pub use linux_headers_asm_hwcap::HWCAP_JSCVT; +pub use linux_headers_asm_hwcap::HWCAP_FCMA; +pub use linux_headers_asm_hwcap::HWCAP_LRCPC; +pub use linux_headers_asm_hwcap::HWCAP_DCPOP; +pub use linux_headers_asm_hwcap::HWCAP_SHA3; +pub use linux_headers_asm_hwcap::HWCAP_SM3; +pub use linux_headers_asm_hwcap::HWCAP_SM4; +pub use linux_headers_asm_hwcap::HWCAP_ASIMDDP; +pub use linux_headers_asm_hwcap::HWCAP_SHA512; +pub use linux_headers_asm_hwcap::HWCAP_SVE; +pub use linux_headers_asm_hwcap::HWCAP_ASIMDFHM; +pub use linux_headers_asm_hwcap::HWCAP_DIT; +pub use linux_headers_asm_hwcap::HWCAP_USCAT; +pub use linux_headers_asm_hwcap::HWCAP_ILRCPC; +pub use linux_headers_asm_hwcap::HWCAP_FLAGM; +pub use linux_headers_asm_hwcap::HWCAP_SSBS; +pub use linux_headers_asm_hwcap::HWCAP_SB; +pub use linux_headers_asm_hwcap::HWCAP_PACA; +pub use linux_headers_asm_hwcap::HWCAP_PACG; +pub use linux_headers_asm_hwcap::HWCAP2_DCPODP; +pub use linux_headers_asm_hwcap::HWCAP2_SVE2; +pub use linux_headers_asm_hwcap::HWCAP2_SVEAES; +pub use linux_headers_asm_hwcap::HWCAP2_SVEPMULL; +pub use linux_headers_asm_hwcap::HWCAP2_SVEBITPERM; +pub use linux_headers_asm_hwcap::HWCAP2_SVESHA3; +pub use linux_headers_asm_hwcap::HWCAP2_SVESM4; +pub use linux_headers_asm_hwcap::HWCAP2_FLAGM2; +pub use linux_headers_asm_hwcap::HWCAP2_FRINT; +pub use linux_headers_asm_hwcap::HWCAP2_SVEI8MM; +pub use linux_headers_asm_hwcap::HWCAP2_SVEF32MM; +pub use linux_headers_asm_hwcap::HWCAP2_SVEF64MM; +pub use linux_headers_asm_hwcap::HWCAP2_SVEBF16; +pub use linux_headers_asm_hwcap::HWCAP2_I8MM; +pub use linux_headers_asm_hwcap::HWCAP2_BF16; +pub use linux_headers_asm_hwcap::HWCAP2_DGH; +pub use linux_headers_asm_hwcap::HWCAP2_RNG; +pub use linux_headers_asm_hwcap::HWCAP2_BTI; +pub use linux_headers_asm_hwcap::HWCAP2_MTE; +pub use linux_headers_asm_hwcap::HWCAP2_ECV; +pub use linux_headers_asm_hwcap::HWCAP2_AFP; +pub use linux_headers_asm_hwcap::HWCAP2_RPRES; +pub use linux_headers_asm_hwcap::HWCAP2_MTE3; +pub use linux_headers_asm_hwcap::HWCAP2_SME; +pub use linux_headers_asm_hwcap::HWCAP2_SME_I16I64; +pub use linux_headers_asm_hwcap::HWCAP2_SME_F64F64; +pub use linux_headers_asm_hwcap::HWCAP2_SME_I8I32; +pub use linux_headers_asm_hwcap::HWCAP2_SME_F16F32; +pub use linux_headers_asm_hwcap::HWCAP2_SME_B16F32; +pub use linux_headers_asm_hwcap::HWCAP2_SME_F32F32; +pub use linux_headers_asm_hwcap::HWCAP2_SME_FA64; +pub use linux_headers_asm_hwcap::HWCAP2_WFXT; +pub use linux_headers_asm_hwcap::HWCAP2_EBF16; +pub use linux_headers_asm_hwcap::HWCAP2_SVE_EBF16; +pub use linux_headers_asm_hwcap::HWCAP2_CSSC; +pub use linux_headers_asm_hwcap::HWCAP2_RPRFM; +pub use linux_headers_asm_hwcap::HWCAP2_SVE2P1; +pub use linux_headers_asm_hwcap::HWCAP2_SME2; +pub use linux_headers_asm_hwcap::HWCAP2_SME2P1; +pub use linux_headers_asm_hwcap::HWCAP2_SME_I16I32; +pub use linux_headers_asm_hwcap::HWCAP2_SME_BI32I32; +pub use linux_headers_asm_hwcap::HWCAP2_SME_B16B16; +pub use linux_headers_asm_hwcap::HWCAP2_SME_F16F16; +pub use linux_headers_asm_hwcap::HWCAP2_MOPS; +mod sys_auxv; +pub use sys_auxv::getauxval; pub type c_char = u8; diff --git a/tests/helper/src/gen/sys/aarch64_linux_musl/musl_sys_auxv.rs b/tests/helper/src/gen/sys/aarch64_linux_musl/sys_auxv.rs similarity index 100% rename from tests/helper/src/gen/sys/aarch64_linux_musl/musl_sys_auxv.rs rename to tests/helper/src/gen/sys/aarch64_linux_musl/sys_auxv.rs diff --git a/tests/helper/src/gen/sys/aarch64_linux_uclibc/mod.rs b/tests/helper/src/gen/sys/aarch64_linux_uclibc/mod.rs index d7e34188..4537d2f2 100644 --- a/tests/helper/src/gen/sys/aarch64_linux_uclibc/mod.rs +++ b/tests/helper/src/gen/sys/aarch64_linux_uclibc/mod.rs @@ -4,22 +4,85 @@ #![cfg_attr(rustfmt, rustfmt::skip)] mod linux_headers_linux_auxvec; -pub use linux_headers_linux_auxvec::{AT_HWCAP, AT_HWCAP2}; +pub use linux_headers_linux_auxvec::AT_HWCAP; +pub use linux_headers_linux_auxvec::AT_HWCAP2; mod linux_headers_asm_hwcap; -pub use linux_headers_asm_hwcap::{ - HWCAP2_AFP, HWCAP2_BF16, HWCAP2_BTI, HWCAP2_CSSC, HWCAP2_DCPODP, HWCAP2_DGH, - HWCAP2_EBF16, HWCAP2_ECV, HWCAP2_FLAGM2, HWCAP2_FRINT, HWCAP2_I8MM, HWCAP2_MOPS, - HWCAP2_MTE, HWCAP2_MTE3, HWCAP2_RNG, HWCAP2_RPRES, HWCAP2_RPRFM, HWCAP2_SME, - HWCAP2_SME2, HWCAP2_SME2P1, HWCAP2_SME_B16B16, HWCAP2_SME_B16F32, HWCAP2_SME_BI32I32, - HWCAP2_SME_F16F16, HWCAP2_SME_F16F32, HWCAP2_SME_F32F32, HWCAP2_SME_F64F64, - HWCAP2_SME_FA64, HWCAP2_SME_I16I32, HWCAP2_SME_I16I64, HWCAP2_SME_I8I32, HWCAP2_SVE2, - HWCAP2_SVE2P1, HWCAP2_SVEAES, HWCAP2_SVEBF16, HWCAP2_SVEBITPERM, HWCAP2_SVEF32MM, - HWCAP2_SVEF64MM, HWCAP2_SVEI8MM, HWCAP2_SVEPMULL, HWCAP2_SVESHA3, HWCAP2_SVESM4, - HWCAP2_SVE_EBF16, HWCAP2_WFXT, HWCAP_AES, HWCAP_ASIMD, HWCAP_ASIMDDP, HWCAP_ASIMDFHM, - HWCAP_ASIMDHP, HWCAP_ASIMDRDM, HWCAP_ATOMICS, HWCAP_CPUID, HWCAP_CRC32, HWCAP_DCPOP, - HWCAP_DIT, HWCAP_EVTSTRM, HWCAP_FCMA, HWCAP_FLAGM, HWCAP_FP, HWCAP_FPHP, - HWCAP_ILRCPC, HWCAP_JSCVT, HWCAP_LRCPC, HWCAP_PACA, HWCAP_PACG, HWCAP_PMULL, - HWCAP_SB, HWCAP_SHA1, HWCAP_SHA2, HWCAP_SHA3, HWCAP_SHA512, HWCAP_SM3, HWCAP_SM4, - HWCAP_SSBS, HWCAP_SVE, HWCAP_USCAT, -}; +pub use linux_headers_asm_hwcap::HWCAP_FP; +pub use linux_headers_asm_hwcap::HWCAP_ASIMD; +pub use linux_headers_asm_hwcap::HWCAP_EVTSTRM; +pub use linux_headers_asm_hwcap::HWCAP_AES; +pub use linux_headers_asm_hwcap::HWCAP_PMULL; +pub use linux_headers_asm_hwcap::HWCAP_SHA1; +pub use linux_headers_asm_hwcap::HWCAP_SHA2; +pub use linux_headers_asm_hwcap::HWCAP_CRC32; +pub use linux_headers_asm_hwcap::HWCAP_ATOMICS; +pub use linux_headers_asm_hwcap::HWCAP_FPHP; +pub use linux_headers_asm_hwcap::HWCAP_ASIMDHP; +pub use linux_headers_asm_hwcap::HWCAP_CPUID; +pub use linux_headers_asm_hwcap::HWCAP_ASIMDRDM; +pub use linux_headers_asm_hwcap::HWCAP_JSCVT; +pub use linux_headers_asm_hwcap::HWCAP_FCMA; +pub use linux_headers_asm_hwcap::HWCAP_LRCPC; +pub use linux_headers_asm_hwcap::HWCAP_DCPOP; +pub use linux_headers_asm_hwcap::HWCAP_SHA3; +pub use linux_headers_asm_hwcap::HWCAP_SM3; +pub use linux_headers_asm_hwcap::HWCAP_SM4; +pub use linux_headers_asm_hwcap::HWCAP_ASIMDDP; +pub use linux_headers_asm_hwcap::HWCAP_SHA512; +pub use linux_headers_asm_hwcap::HWCAP_SVE; +pub use linux_headers_asm_hwcap::HWCAP_ASIMDFHM; +pub use linux_headers_asm_hwcap::HWCAP_DIT; +pub use linux_headers_asm_hwcap::HWCAP_USCAT; +pub use linux_headers_asm_hwcap::HWCAP_ILRCPC; +pub use linux_headers_asm_hwcap::HWCAP_FLAGM; +pub use linux_headers_asm_hwcap::HWCAP_SSBS; +pub use linux_headers_asm_hwcap::HWCAP_SB; +pub use linux_headers_asm_hwcap::HWCAP_PACA; +pub use linux_headers_asm_hwcap::HWCAP_PACG; +pub use linux_headers_asm_hwcap::HWCAP2_DCPODP; +pub use linux_headers_asm_hwcap::HWCAP2_SVE2; +pub use linux_headers_asm_hwcap::HWCAP2_SVEAES; +pub use linux_headers_asm_hwcap::HWCAP2_SVEPMULL; +pub use linux_headers_asm_hwcap::HWCAP2_SVEBITPERM; +pub use linux_headers_asm_hwcap::HWCAP2_SVESHA3; +pub use linux_headers_asm_hwcap::HWCAP2_SVESM4; +pub use linux_headers_asm_hwcap::HWCAP2_FLAGM2; +pub use linux_headers_asm_hwcap::HWCAP2_FRINT; +pub use linux_headers_asm_hwcap::HWCAP2_SVEI8MM; +pub use linux_headers_asm_hwcap::HWCAP2_SVEF32MM; +pub use linux_headers_asm_hwcap::HWCAP2_SVEF64MM; +pub use linux_headers_asm_hwcap::HWCAP2_SVEBF16; +pub use linux_headers_asm_hwcap::HWCAP2_I8MM; +pub use linux_headers_asm_hwcap::HWCAP2_BF16; +pub use linux_headers_asm_hwcap::HWCAP2_DGH; +pub use linux_headers_asm_hwcap::HWCAP2_RNG; +pub use linux_headers_asm_hwcap::HWCAP2_BTI; +pub use linux_headers_asm_hwcap::HWCAP2_MTE; +pub use linux_headers_asm_hwcap::HWCAP2_ECV; +pub use linux_headers_asm_hwcap::HWCAP2_AFP; +pub use linux_headers_asm_hwcap::HWCAP2_RPRES; +pub use linux_headers_asm_hwcap::HWCAP2_MTE3; +pub use linux_headers_asm_hwcap::HWCAP2_SME; +pub use linux_headers_asm_hwcap::HWCAP2_SME_I16I64; +pub use linux_headers_asm_hwcap::HWCAP2_SME_F64F64; +pub use linux_headers_asm_hwcap::HWCAP2_SME_I8I32; +pub use linux_headers_asm_hwcap::HWCAP2_SME_F16F32; +pub use linux_headers_asm_hwcap::HWCAP2_SME_B16F32; +pub use linux_headers_asm_hwcap::HWCAP2_SME_F32F32; +pub use linux_headers_asm_hwcap::HWCAP2_SME_FA64; +pub use linux_headers_asm_hwcap::HWCAP2_WFXT; +pub use linux_headers_asm_hwcap::HWCAP2_EBF16; +pub use linux_headers_asm_hwcap::HWCAP2_SVE_EBF16; +pub use linux_headers_asm_hwcap::HWCAP2_CSSC; +pub use linux_headers_asm_hwcap::HWCAP2_RPRFM; +pub use linux_headers_asm_hwcap::HWCAP2_SVE2P1; +pub use linux_headers_asm_hwcap::HWCAP2_SME2; +pub use linux_headers_asm_hwcap::HWCAP2_SME2P1; +pub use linux_headers_asm_hwcap::HWCAP2_SME_I16I32; +pub use linux_headers_asm_hwcap::HWCAP2_SME_BI32I32; +pub use linux_headers_asm_hwcap::HWCAP2_SME_B16B16; +pub use linux_headers_asm_hwcap::HWCAP2_SME_F16F16; +pub use linux_headers_asm_hwcap::HWCAP2_MOPS; +mod sys_auxv; +pub use sys_auxv::getauxval; pub type c_char = u8; diff --git a/tests/helper/src/gen/sys/aarch64_linux_uclibc/sys_auxv.rs b/tests/helper/src/gen/sys/aarch64_linux_uclibc/sys_auxv.rs new file mode 100644 index 00000000..a53605f5 --- /dev/null +++ b/tests/helper/src/gen/sys/aarch64_linux_uclibc/sys_auxv.rs @@ -0,0 +1,7 @@ +// This file is @generated by portable-atomic-internal-codegen +// (gen function at tools/codegen/src/ffi.rs). +// It is not intended for manual editing. + +extern "C" { + pub fn getauxval(__type: ::std::os::raw::c_ulong) -> ::std::os::raw::c_ulong; +} diff --git a/tests/helper/src/gen/sys/aarch64_openbsd/mod.rs b/tests/helper/src/gen/sys/aarch64_openbsd/mod.rs index 1996ca9a..80a68a20 100644 --- a/tests/helper/src/gen/sys/aarch64_openbsd/mod.rs +++ b/tests/helper/src/gen/sys/aarch64_openbsd/mod.rs @@ -4,11 +4,17 @@ #![cfg_attr(rustfmt, rustfmt::skip)] mod sys_sysctl; -pub use sys_sysctl::{CTL_MACHDEP, sysctl}; +pub use sys_sysctl::CTL_MACHDEP; +pub use sys_sysctl::sysctl; mod machine_cpu; -pub use machine_cpu::{ - CPU_ID_AA64ISAR0, CPU_ID_AA64ISAR1, CPU_ID_AA64ISAR2, CPU_ID_AA64MMFR0, - CPU_ID_AA64MMFR1, CPU_ID_AA64MMFR2, CPU_ID_AA64PFR0, CPU_ID_AA64PFR1, - CPU_ID_AA64SMFR0, CPU_ID_AA64ZFR0, -}; +pub use machine_cpu::CPU_ID_AA64ISAR0; +pub use machine_cpu::CPU_ID_AA64ISAR1; +pub use machine_cpu::CPU_ID_AA64ISAR2; +pub use machine_cpu::CPU_ID_AA64MMFR0; +pub use machine_cpu::CPU_ID_AA64MMFR1; +pub use machine_cpu::CPU_ID_AA64MMFR2; +pub use machine_cpu::CPU_ID_AA64PFR0; +pub use machine_cpu::CPU_ID_AA64PFR1; +pub use machine_cpu::CPU_ID_AA64SMFR0; +pub use machine_cpu::CPU_ID_AA64ZFR0; pub type c_char = u8; diff --git a/tests/helper/src/gen/sys/aarch64_openbsd/sys_sysctl.rs b/tests/helper/src/gen/sys/aarch64_openbsd/sys_sysctl.rs index f1c48e84..41b283e2 100644 --- a/tests/helper/src/gen/sys/aarch64_openbsd/sys_sysctl.rs +++ b/tests/helper/src/gen/sys/aarch64_openbsd/sys_sysctl.rs @@ -2,8 +2,8 @@ // (gen function at tools/codegen/src/ffi.rs). // It is not intended for manual editing. -pub const CTL_MACHDEP: u32 = 7; pub type u_int = ::std::os::raw::c_uint; +pub const CTL_MACHDEP: u32 = 7; extern "C" { pub fn sysctl( arg1: *const ::std::os::raw::c_int, diff --git a/tests/helper/src/gen/sys/mod.rs b/tests/helper/src/gen/sys/mod.rs index 5396dbf7..40e7c6ea 100644 --- a/tests/helper/src/gen/sys/mod.rs +++ b/tests/helper/src/gen/sys/mod.rs @@ -7,8 +7,7 @@ dead_code, non_camel_case_types, non_upper_case_globals, - unreachable_pub, - unused_imports, + clippy::unnecessary_cast, clippy::unreadable_literal, )] #[cfg( diff --git a/tests/helper/src/gen/sys/powerpc64_freebsd/machine_cpu.rs b/tests/helper/src/gen/sys/powerpc64_freebsd/machine_cpu.rs index c739070c..3e986c23 100644 --- a/tests/helper/src/gen/sys/powerpc64_freebsd/machine_cpu.rs +++ b/tests/helper/src/gen/sys/powerpc64_freebsd/machine_cpu.rs @@ -40,5 +40,5 @@ pub const PPC_FEATURE2_HAS_IEEE128: u32 = 4194304; pub const PPC_FEATURE2_DARN: u32 = 2097152; pub const PPC_FEATURE2_SCV: u32 = 1048576; pub const PPC_FEATURE2_HTM_NOSUSPEND: u32 = 524288; -pub const PPC_FEATURE_BITMASK : & [u8 ; 153usize] = b"\x10 PPC32\x1FPPC64\x1EPPC601\x1DALTIVEC\x1CFPU\x1BMMU\x19UNIFIEDCACHE\x18SPE\x17SPESFP\x16DPESFP\x15NOTB\x14POWER4\x13POWER5\x12P5PLUS\x11CELL\x10BOOKE\x0FSMT\x0EISNOOP\rARCH205\x0BDFP\tARCH206\x08VSX\x02TRUELE\x01PPCLE\0" ; -pub const PPC_FEATURE2_BITMASK : & [u8 ; 79usize] = b"\x10 ARCH207\x1FHTM\x1EDSCR\x1CISEL\x1BTAR\x1AVCRYPTO\x19HTMNOSC\x18ARCH300\x17IEEE128\x16DARN\x15SCV\x14HTMNOSUSP\0" ; +pub const PPC_FEATURE_BITMASK : & [u8 ; 153] = b"\x10 PPC32\x1FPPC64\x1EPPC601\x1DALTIVEC\x1CFPU\x1BMMU\x19UNIFIEDCACHE\x18SPE\x17SPESFP\x16DPESFP\x15NOTB\x14POWER4\x13POWER5\x12P5PLUS\x11CELL\x10BOOKE\x0FSMT\x0EISNOOP\rARCH205\x0BDFP\tARCH206\x08VSX\x02TRUELE\x01PPCLE\0" ; +pub const PPC_FEATURE2_BITMASK : & [u8 ; 79] = b"\x10 ARCH207\x1FHTM\x1EDSCR\x1CISEL\x1BTAR\x1AVCRYPTO\x19HTMNOSC\x18ARCH300\x17IEEE128\x16DARN\x15SCV\x14HTMNOSUSP\0" ; diff --git a/tests/helper/src/gen/sys/powerpc64_freebsd/mod.rs b/tests/helper/src/gen/sys/powerpc64_freebsd/mod.rs index 7f3f8b35..86f7ea81 100644 --- a/tests/helper/src/gen/sys/powerpc64_freebsd/mod.rs +++ b/tests/helper/src/gen/sys/powerpc64_freebsd/mod.rs @@ -6,20 +6,47 @@ mod sys_auxv; pub use sys_auxv::elf_aux_info; mod sys_elf_common; -pub use sys_elf_common::{AT_HWCAP, AT_HWCAP2}; +pub use sys_elf_common::AT_HWCAP; +pub use sys_elf_common::AT_HWCAP2; mod machine_cpu; -pub use machine_cpu::{ - PPC_FEATURE2_ARCH_2_07, PPC_FEATURE2_ARCH_3_00, PPC_FEATURE2_BITMASK, - PPC_FEATURE2_DARN, PPC_FEATURE2_DSCR, PPC_FEATURE2_EBB, PPC_FEATURE2_HAS_IEEE128, - PPC_FEATURE2_HAS_VEC_CRYPTO, PPC_FEATURE2_HTM, PPC_FEATURE2_HTM_NOSC, - PPC_FEATURE2_HTM_NOSUSPEND, PPC_FEATURE2_ISEL, PPC_FEATURE2_SCV, PPC_FEATURE2_TAR, - PPC_FEATURE_32, PPC_FEATURE_601_INSTR, PPC_FEATURE_64, PPC_FEATURE_ARCH_2_05, - PPC_FEATURE_ARCH_2_06, PPC_FEATURE_BITMASK, PPC_FEATURE_BOOKE, PPC_FEATURE_CELL, - PPC_FEATURE_HAS_ALTIVEC, PPC_FEATURE_HAS_DFP, PPC_FEATURE_HAS_EFP_DOUBLE, - PPC_FEATURE_HAS_EFP_SINGLE, PPC_FEATURE_HAS_FPU, PPC_FEATURE_HAS_MMU, - PPC_FEATURE_HAS_SPE, PPC_FEATURE_HAS_VSX, PPC_FEATURE_ICACHE_SNOOP, - PPC_FEATURE_NO_TB, PPC_FEATURE_POWER4, PPC_FEATURE_POWER5, PPC_FEATURE_POWER5_PLUS, - PPC_FEATURE_POWER6_EXT, PPC_FEATURE_PPC_LE, PPC_FEATURE_SMT, PPC_FEATURE_TRUE_LE, - PPC_FEATURE_UNIFIED_CACHE, -}; +pub use machine_cpu::PPC_FEATURE_32; +pub use machine_cpu::PPC_FEATURE_64; +pub use machine_cpu::PPC_FEATURE_601_INSTR; +pub use machine_cpu::PPC_FEATURE_HAS_ALTIVEC; +pub use machine_cpu::PPC_FEATURE_HAS_FPU; +pub use machine_cpu::PPC_FEATURE_HAS_MMU; +pub use machine_cpu::PPC_FEATURE_UNIFIED_CACHE; +pub use machine_cpu::PPC_FEATURE_HAS_SPE; +pub use machine_cpu::PPC_FEATURE_HAS_EFP_SINGLE; +pub use machine_cpu::PPC_FEATURE_HAS_EFP_DOUBLE; +pub use machine_cpu::PPC_FEATURE_NO_TB; +pub use machine_cpu::PPC_FEATURE_POWER4; +pub use machine_cpu::PPC_FEATURE_POWER5; +pub use machine_cpu::PPC_FEATURE_POWER5_PLUS; +pub use machine_cpu::PPC_FEATURE_CELL; +pub use machine_cpu::PPC_FEATURE_BOOKE; +pub use machine_cpu::PPC_FEATURE_SMT; +pub use machine_cpu::PPC_FEATURE_ICACHE_SNOOP; +pub use machine_cpu::PPC_FEATURE_ARCH_2_05; +pub use machine_cpu::PPC_FEATURE_HAS_DFP; +pub use machine_cpu::PPC_FEATURE_POWER6_EXT; +pub use machine_cpu::PPC_FEATURE_ARCH_2_06; +pub use machine_cpu::PPC_FEATURE_HAS_VSX; +pub use machine_cpu::PPC_FEATURE_TRUE_LE; +pub use machine_cpu::PPC_FEATURE_PPC_LE; +pub use machine_cpu::PPC_FEATURE2_ARCH_2_07; +pub use machine_cpu::PPC_FEATURE2_HTM; +pub use machine_cpu::PPC_FEATURE2_DSCR; +pub use machine_cpu::PPC_FEATURE2_EBB; +pub use machine_cpu::PPC_FEATURE2_ISEL; +pub use machine_cpu::PPC_FEATURE2_TAR; +pub use machine_cpu::PPC_FEATURE2_HAS_VEC_CRYPTO; +pub use machine_cpu::PPC_FEATURE2_HTM_NOSC; +pub use machine_cpu::PPC_FEATURE2_ARCH_3_00; +pub use machine_cpu::PPC_FEATURE2_HAS_IEEE128; +pub use machine_cpu::PPC_FEATURE2_DARN; +pub use machine_cpu::PPC_FEATURE2_SCV; +pub use machine_cpu::PPC_FEATURE2_HTM_NOSUSPEND; +pub use machine_cpu::PPC_FEATURE_BITMASK; +pub use machine_cpu::PPC_FEATURE2_BITMASK; pub type c_char = u8; diff --git a/tests/helper/src/gen/sys/powerpc64_linux_gnu/mod.rs b/tests/helper/src/gen/sys/powerpc64_linux_gnu/mod.rs index ad74f4ad..1d6025c4 100644 --- a/tests/helper/src/gen/sys/powerpc64_linux_gnu/mod.rs +++ b/tests/helper/src/gen/sys/powerpc64_linux_gnu/mod.rs @@ -4,21 +4,52 @@ #![cfg_attr(rustfmt, rustfmt::skip)] mod linux_headers_linux_auxvec; -pub use linux_headers_linux_auxvec::{AT_HWCAP, AT_HWCAP2}; +pub use linux_headers_linux_auxvec::AT_HWCAP; +pub use linux_headers_linux_auxvec::AT_HWCAP2; mod linux_headers_asm_cputable; -pub use linux_headers_asm_cputable::{ - PPC_FEATURE2_ARCH_2_07, PPC_FEATURE2_ARCH_3_00, PPC_FEATURE2_ARCH_3_1, - PPC_FEATURE2_DARN, PPC_FEATURE2_DSCR, PPC_FEATURE2_EBB, PPC_FEATURE2_HAS_IEEE128, - PPC_FEATURE2_HTM, PPC_FEATURE2_HTM_NOSC, PPC_FEATURE2_HTM_NO_SUSPEND, - PPC_FEATURE2_ISEL, PPC_FEATURE2_MMA, PPC_FEATURE2_SCV, PPC_FEATURE2_TAR, - PPC_FEATURE2_VEC_CRYPTO, PPC_FEATURE_32, PPC_FEATURE_601_INSTR, PPC_FEATURE_64, - PPC_FEATURE_ARCH_2_05, PPC_FEATURE_ARCH_2_06, PPC_FEATURE_BOOKE, PPC_FEATURE_CELL, - PPC_FEATURE_HAS_4xxMAC, PPC_FEATURE_HAS_ALTIVEC, PPC_FEATURE_HAS_DFP, - PPC_FEATURE_HAS_EFP_DOUBLE, PPC_FEATURE_HAS_EFP_SINGLE, PPC_FEATURE_HAS_FPU, - PPC_FEATURE_HAS_MMU, PPC_FEATURE_HAS_SPE, PPC_FEATURE_HAS_VSX, - PPC_FEATURE_ICACHE_SNOOP, PPC_FEATURE_NO_TB, PPC_FEATURE_PA6T, PPC_FEATURE_POWER4, - PPC_FEATURE_POWER5, PPC_FEATURE_POWER5_PLUS, PPC_FEATURE_POWER6_EXT, - PPC_FEATURE_PPC_LE, PPC_FEATURE_PSERIES_PERFMON_COMPAT, PPC_FEATURE_SMT, - PPC_FEATURE_TRUE_LE, PPC_FEATURE_UNIFIED_CACHE, -}; +pub use linux_headers_asm_cputable::PPC_FEATURE_32; +pub use linux_headers_asm_cputable::PPC_FEATURE_64; +pub use linux_headers_asm_cputable::PPC_FEATURE_601_INSTR; +pub use linux_headers_asm_cputable::PPC_FEATURE_HAS_ALTIVEC; +pub use linux_headers_asm_cputable::PPC_FEATURE_HAS_FPU; +pub use linux_headers_asm_cputable::PPC_FEATURE_HAS_MMU; +pub use linux_headers_asm_cputable::PPC_FEATURE_HAS_4xxMAC; +pub use linux_headers_asm_cputable::PPC_FEATURE_UNIFIED_CACHE; +pub use linux_headers_asm_cputable::PPC_FEATURE_HAS_SPE; +pub use linux_headers_asm_cputable::PPC_FEATURE_HAS_EFP_SINGLE; +pub use linux_headers_asm_cputable::PPC_FEATURE_HAS_EFP_DOUBLE; +pub use linux_headers_asm_cputable::PPC_FEATURE_NO_TB; +pub use linux_headers_asm_cputable::PPC_FEATURE_POWER4; +pub use linux_headers_asm_cputable::PPC_FEATURE_POWER5; +pub use linux_headers_asm_cputable::PPC_FEATURE_POWER5_PLUS; +pub use linux_headers_asm_cputable::PPC_FEATURE_CELL; +pub use linux_headers_asm_cputable::PPC_FEATURE_BOOKE; +pub use linux_headers_asm_cputable::PPC_FEATURE_SMT; +pub use linux_headers_asm_cputable::PPC_FEATURE_ICACHE_SNOOP; +pub use linux_headers_asm_cputable::PPC_FEATURE_ARCH_2_05; +pub use linux_headers_asm_cputable::PPC_FEATURE_PA6T; +pub use linux_headers_asm_cputable::PPC_FEATURE_HAS_DFP; +pub use linux_headers_asm_cputable::PPC_FEATURE_POWER6_EXT; +pub use linux_headers_asm_cputable::PPC_FEATURE_ARCH_2_06; +pub use linux_headers_asm_cputable::PPC_FEATURE_HAS_VSX; +pub use linux_headers_asm_cputable::PPC_FEATURE_PSERIES_PERFMON_COMPAT; +pub use linux_headers_asm_cputable::PPC_FEATURE_TRUE_LE; +pub use linux_headers_asm_cputable::PPC_FEATURE_PPC_LE; +pub use linux_headers_asm_cputable::PPC_FEATURE2_ARCH_2_07; +pub use linux_headers_asm_cputable::PPC_FEATURE2_HTM; +pub use linux_headers_asm_cputable::PPC_FEATURE2_DSCR; +pub use linux_headers_asm_cputable::PPC_FEATURE2_EBB; +pub use linux_headers_asm_cputable::PPC_FEATURE2_ISEL; +pub use linux_headers_asm_cputable::PPC_FEATURE2_TAR; +pub use linux_headers_asm_cputable::PPC_FEATURE2_VEC_CRYPTO; +pub use linux_headers_asm_cputable::PPC_FEATURE2_HTM_NOSC; +pub use linux_headers_asm_cputable::PPC_FEATURE2_ARCH_3_00; +pub use linux_headers_asm_cputable::PPC_FEATURE2_HAS_IEEE128; +pub use linux_headers_asm_cputable::PPC_FEATURE2_DARN; +pub use linux_headers_asm_cputable::PPC_FEATURE2_SCV; +pub use linux_headers_asm_cputable::PPC_FEATURE2_HTM_NO_SUSPEND; +pub use linux_headers_asm_cputable::PPC_FEATURE2_ARCH_3_1; +pub use linux_headers_asm_cputable::PPC_FEATURE2_MMA; +mod sys_auxv; +pub use sys_auxv::getauxval; pub type c_char = u8; diff --git a/tests/helper/src/gen/sys/powerpc64_linux_gnu/sys_auxv.rs b/tests/helper/src/gen/sys/powerpc64_linux_gnu/sys_auxv.rs new file mode 100644 index 00000000..a53605f5 --- /dev/null +++ b/tests/helper/src/gen/sys/powerpc64_linux_gnu/sys_auxv.rs @@ -0,0 +1,7 @@ +// This file is @generated by portable-atomic-internal-codegen +// (gen function at tools/codegen/src/ffi.rs). +// It is not intended for manual editing. + +extern "C" { + pub fn getauxval(__type: ::std::os::raw::c_ulong) -> ::std::os::raw::c_ulong; +} diff --git a/tests/helper/src/gen/sys/powerpc64_linux_musl/mod.rs b/tests/helper/src/gen/sys/powerpc64_linux_musl/mod.rs index 16717ce3..1d6025c4 100644 --- a/tests/helper/src/gen/sys/powerpc64_linux_musl/mod.rs +++ b/tests/helper/src/gen/sys/powerpc64_linux_musl/mod.rs @@ -4,23 +4,52 @@ #![cfg_attr(rustfmt, rustfmt::skip)] mod linux_headers_linux_auxvec; -pub use linux_headers_linux_auxvec::{AT_HWCAP, AT_HWCAP2}; +pub use linux_headers_linux_auxvec::AT_HWCAP; +pub use linux_headers_linux_auxvec::AT_HWCAP2; mod linux_headers_asm_cputable; -pub use linux_headers_asm_cputable::{ - PPC_FEATURE2_ARCH_2_07, PPC_FEATURE2_ARCH_3_00, PPC_FEATURE2_ARCH_3_1, - PPC_FEATURE2_DARN, PPC_FEATURE2_DSCR, PPC_FEATURE2_EBB, PPC_FEATURE2_HAS_IEEE128, - PPC_FEATURE2_HTM, PPC_FEATURE2_HTM_NOSC, PPC_FEATURE2_HTM_NO_SUSPEND, - PPC_FEATURE2_ISEL, PPC_FEATURE2_MMA, PPC_FEATURE2_SCV, PPC_FEATURE2_TAR, - PPC_FEATURE2_VEC_CRYPTO, PPC_FEATURE_32, PPC_FEATURE_601_INSTR, PPC_FEATURE_64, - PPC_FEATURE_ARCH_2_05, PPC_FEATURE_ARCH_2_06, PPC_FEATURE_BOOKE, PPC_FEATURE_CELL, - PPC_FEATURE_HAS_4xxMAC, PPC_FEATURE_HAS_ALTIVEC, PPC_FEATURE_HAS_DFP, - PPC_FEATURE_HAS_EFP_DOUBLE, PPC_FEATURE_HAS_EFP_SINGLE, PPC_FEATURE_HAS_FPU, - PPC_FEATURE_HAS_MMU, PPC_FEATURE_HAS_SPE, PPC_FEATURE_HAS_VSX, - PPC_FEATURE_ICACHE_SNOOP, PPC_FEATURE_NO_TB, PPC_FEATURE_PA6T, PPC_FEATURE_POWER4, - PPC_FEATURE_POWER5, PPC_FEATURE_POWER5_PLUS, PPC_FEATURE_POWER6_EXT, - PPC_FEATURE_PPC_LE, PPC_FEATURE_PSERIES_PERFMON_COMPAT, PPC_FEATURE_SMT, - PPC_FEATURE_TRUE_LE, PPC_FEATURE_UNIFIED_CACHE, -}; -mod musl_sys_auxv; -pub use musl_sys_auxv::getauxval; +pub use linux_headers_asm_cputable::PPC_FEATURE_32; +pub use linux_headers_asm_cputable::PPC_FEATURE_64; +pub use linux_headers_asm_cputable::PPC_FEATURE_601_INSTR; +pub use linux_headers_asm_cputable::PPC_FEATURE_HAS_ALTIVEC; +pub use linux_headers_asm_cputable::PPC_FEATURE_HAS_FPU; +pub use linux_headers_asm_cputable::PPC_FEATURE_HAS_MMU; +pub use linux_headers_asm_cputable::PPC_FEATURE_HAS_4xxMAC; +pub use linux_headers_asm_cputable::PPC_FEATURE_UNIFIED_CACHE; +pub use linux_headers_asm_cputable::PPC_FEATURE_HAS_SPE; +pub use linux_headers_asm_cputable::PPC_FEATURE_HAS_EFP_SINGLE; +pub use linux_headers_asm_cputable::PPC_FEATURE_HAS_EFP_DOUBLE; +pub use linux_headers_asm_cputable::PPC_FEATURE_NO_TB; +pub use linux_headers_asm_cputable::PPC_FEATURE_POWER4; +pub use linux_headers_asm_cputable::PPC_FEATURE_POWER5; +pub use linux_headers_asm_cputable::PPC_FEATURE_POWER5_PLUS; +pub use linux_headers_asm_cputable::PPC_FEATURE_CELL; +pub use linux_headers_asm_cputable::PPC_FEATURE_BOOKE; +pub use linux_headers_asm_cputable::PPC_FEATURE_SMT; +pub use linux_headers_asm_cputable::PPC_FEATURE_ICACHE_SNOOP; +pub use linux_headers_asm_cputable::PPC_FEATURE_ARCH_2_05; +pub use linux_headers_asm_cputable::PPC_FEATURE_PA6T; +pub use linux_headers_asm_cputable::PPC_FEATURE_HAS_DFP; +pub use linux_headers_asm_cputable::PPC_FEATURE_POWER6_EXT; +pub use linux_headers_asm_cputable::PPC_FEATURE_ARCH_2_06; +pub use linux_headers_asm_cputable::PPC_FEATURE_HAS_VSX; +pub use linux_headers_asm_cputable::PPC_FEATURE_PSERIES_PERFMON_COMPAT; +pub use linux_headers_asm_cputable::PPC_FEATURE_TRUE_LE; +pub use linux_headers_asm_cputable::PPC_FEATURE_PPC_LE; +pub use linux_headers_asm_cputable::PPC_FEATURE2_ARCH_2_07; +pub use linux_headers_asm_cputable::PPC_FEATURE2_HTM; +pub use linux_headers_asm_cputable::PPC_FEATURE2_DSCR; +pub use linux_headers_asm_cputable::PPC_FEATURE2_EBB; +pub use linux_headers_asm_cputable::PPC_FEATURE2_ISEL; +pub use linux_headers_asm_cputable::PPC_FEATURE2_TAR; +pub use linux_headers_asm_cputable::PPC_FEATURE2_VEC_CRYPTO; +pub use linux_headers_asm_cputable::PPC_FEATURE2_HTM_NOSC; +pub use linux_headers_asm_cputable::PPC_FEATURE2_ARCH_3_00; +pub use linux_headers_asm_cputable::PPC_FEATURE2_HAS_IEEE128; +pub use linux_headers_asm_cputable::PPC_FEATURE2_DARN; +pub use linux_headers_asm_cputable::PPC_FEATURE2_SCV; +pub use linux_headers_asm_cputable::PPC_FEATURE2_HTM_NO_SUSPEND; +pub use linux_headers_asm_cputable::PPC_FEATURE2_ARCH_3_1; +pub use linux_headers_asm_cputable::PPC_FEATURE2_MMA; +mod sys_auxv; +pub use sys_auxv::getauxval; pub type c_char = u8; diff --git a/tests/helper/src/gen/sys/powerpc64_linux_musl/musl_sys_auxv.rs b/tests/helper/src/gen/sys/powerpc64_linux_musl/sys_auxv.rs similarity index 100% rename from tests/helper/src/gen/sys/powerpc64_linux_musl/musl_sys_auxv.rs rename to tests/helper/src/gen/sys/powerpc64_linux_musl/sys_auxv.rs diff --git a/tests/helper/src/gen/sys/powerpc64le_freebsd/machine_cpu.rs b/tests/helper/src/gen/sys/powerpc64le_freebsd/machine_cpu.rs index c739070c..3e986c23 100644 --- a/tests/helper/src/gen/sys/powerpc64le_freebsd/machine_cpu.rs +++ b/tests/helper/src/gen/sys/powerpc64le_freebsd/machine_cpu.rs @@ -40,5 +40,5 @@ pub const PPC_FEATURE2_HAS_IEEE128: u32 = 4194304; pub const PPC_FEATURE2_DARN: u32 = 2097152; pub const PPC_FEATURE2_SCV: u32 = 1048576; pub const PPC_FEATURE2_HTM_NOSUSPEND: u32 = 524288; -pub const PPC_FEATURE_BITMASK : & [u8 ; 153usize] = b"\x10 PPC32\x1FPPC64\x1EPPC601\x1DALTIVEC\x1CFPU\x1BMMU\x19UNIFIEDCACHE\x18SPE\x17SPESFP\x16DPESFP\x15NOTB\x14POWER4\x13POWER5\x12P5PLUS\x11CELL\x10BOOKE\x0FSMT\x0EISNOOP\rARCH205\x0BDFP\tARCH206\x08VSX\x02TRUELE\x01PPCLE\0" ; -pub const PPC_FEATURE2_BITMASK : & [u8 ; 79usize] = b"\x10 ARCH207\x1FHTM\x1EDSCR\x1CISEL\x1BTAR\x1AVCRYPTO\x19HTMNOSC\x18ARCH300\x17IEEE128\x16DARN\x15SCV\x14HTMNOSUSP\0" ; +pub const PPC_FEATURE_BITMASK : & [u8 ; 153] = b"\x10 PPC32\x1FPPC64\x1EPPC601\x1DALTIVEC\x1CFPU\x1BMMU\x19UNIFIEDCACHE\x18SPE\x17SPESFP\x16DPESFP\x15NOTB\x14POWER4\x13POWER5\x12P5PLUS\x11CELL\x10BOOKE\x0FSMT\x0EISNOOP\rARCH205\x0BDFP\tARCH206\x08VSX\x02TRUELE\x01PPCLE\0" ; +pub const PPC_FEATURE2_BITMASK : & [u8 ; 79] = b"\x10 ARCH207\x1FHTM\x1EDSCR\x1CISEL\x1BTAR\x1AVCRYPTO\x19HTMNOSC\x18ARCH300\x17IEEE128\x16DARN\x15SCV\x14HTMNOSUSP\0" ; diff --git a/tests/helper/src/gen/sys/powerpc64le_freebsd/mod.rs b/tests/helper/src/gen/sys/powerpc64le_freebsd/mod.rs index 7f3f8b35..86f7ea81 100644 --- a/tests/helper/src/gen/sys/powerpc64le_freebsd/mod.rs +++ b/tests/helper/src/gen/sys/powerpc64le_freebsd/mod.rs @@ -6,20 +6,47 @@ mod sys_auxv; pub use sys_auxv::elf_aux_info; mod sys_elf_common; -pub use sys_elf_common::{AT_HWCAP, AT_HWCAP2}; +pub use sys_elf_common::AT_HWCAP; +pub use sys_elf_common::AT_HWCAP2; mod machine_cpu; -pub use machine_cpu::{ - PPC_FEATURE2_ARCH_2_07, PPC_FEATURE2_ARCH_3_00, PPC_FEATURE2_BITMASK, - PPC_FEATURE2_DARN, PPC_FEATURE2_DSCR, PPC_FEATURE2_EBB, PPC_FEATURE2_HAS_IEEE128, - PPC_FEATURE2_HAS_VEC_CRYPTO, PPC_FEATURE2_HTM, PPC_FEATURE2_HTM_NOSC, - PPC_FEATURE2_HTM_NOSUSPEND, PPC_FEATURE2_ISEL, PPC_FEATURE2_SCV, PPC_FEATURE2_TAR, - PPC_FEATURE_32, PPC_FEATURE_601_INSTR, PPC_FEATURE_64, PPC_FEATURE_ARCH_2_05, - PPC_FEATURE_ARCH_2_06, PPC_FEATURE_BITMASK, PPC_FEATURE_BOOKE, PPC_FEATURE_CELL, - PPC_FEATURE_HAS_ALTIVEC, PPC_FEATURE_HAS_DFP, PPC_FEATURE_HAS_EFP_DOUBLE, - PPC_FEATURE_HAS_EFP_SINGLE, PPC_FEATURE_HAS_FPU, PPC_FEATURE_HAS_MMU, - PPC_FEATURE_HAS_SPE, PPC_FEATURE_HAS_VSX, PPC_FEATURE_ICACHE_SNOOP, - PPC_FEATURE_NO_TB, PPC_FEATURE_POWER4, PPC_FEATURE_POWER5, PPC_FEATURE_POWER5_PLUS, - PPC_FEATURE_POWER6_EXT, PPC_FEATURE_PPC_LE, PPC_FEATURE_SMT, PPC_FEATURE_TRUE_LE, - PPC_FEATURE_UNIFIED_CACHE, -}; +pub use machine_cpu::PPC_FEATURE_32; +pub use machine_cpu::PPC_FEATURE_64; +pub use machine_cpu::PPC_FEATURE_601_INSTR; +pub use machine_cpu::PPC_FEATURE_HAS_ALTIVEC; +pub use machine_cpu::PPC_FEATURE_HAS_FPU; +pub use machine_cpu::PPC_FEATURE_HAS_MMU; +pub use machine_cpu::PPC_FEATURE_UNIFIED_CACHE; +pub use machine_cpu::PPC_FEATURE_HAS_SPE; +pub use machine_cpu::PPC_FEATURE_HAS_EFP_SINGLE; +pub use machine_cpu::PPC_FEATURE_HAS_EFP_DOUBLE; +pub use machine_cpu::PPC_FEATURE_NO_TB; +pub use machine_cpu::PPC_FEATURE_POWER4; +pub use machine_cpu::PPC_FEATURE_POWER5; +pub use machine_cpu::PPC_FEATURE_POWER5_PLUS; +pub use machine_cpu::PPC_FEATURE_CELL; +pub use machine_cpu::PPC_FEATURE_BOOKE; +pub use machine_cpu::PPC_FEATURE_SMT; +pub use machine_cpu::PPC_FEATURE_ICACHE_SNOOP; +pub use machine_cpu::PPC_FEATURE_ARCH_2_05; +pub use machine_cpu::PPC_FEATURE_HAS_DFP; +pub use machine_cpu::PPC_FEATURE_POWER6_EXT; +pub use machine_cpu::PPC_FEATURE_ARCH_2_06; +pub use machine_cpu::PPC_FEATURE_HAS_VSX; +pub use machine_cpu::PPC_FEATURE_TRUE_LE; +pub use machine_cpu::PPC_FEATURE_PPC_LE; +pub use machine_cpu::PPC_FEATURE2_ARCH_2_07; +pub use machine_cpu::PPC_FEATURE2_HTM; +pub use machine_cpu::PPC_FEATURE2_DSCR; +pub use machine_cpu::PPC_FEATURE2_EBB; +pub use machine_cpu::PPC_FEATURE2_ISEL; +pub use machine_cpu::PPC_FEATURE2_TAR; +pub use machine_cpu::PPC_FEATURE2_HAS_VEC_CRYPTO; +pub use machine_cpu::PPC_FEATURE2_HTM_NOSC; +pub use machine_cpu::PPC_FEATURE2_ARCH_3_00; +pub use machine_cpu::PPC_FEATURE2_HAS_IEEE128; +pub use machine_cpu::PPC_FEATURE2_DARN; +pub use machine_cpu::PPC_FEATURE2_SCV; +pub use machine_cpu::PPC_FEATURE2_HTM_NOSUSPEND; +pub use machine_cpu::PPC_FEATURE_BITMASK; +pub use machine_cpu::PPC_FEATURE2_BITMASK; pub type c_char = u8; diff --git a/tests/helper/src/gen/sys/powerpc64le_linux_gnu/mod.rs b/tests/helper/src/gen/sys/powerpc64le_linux_gnu/mod.rs index ad74f4ad..1d6025c4 100644 --- a/tests/helper/src/gen/sys/powerpc64le_linux_gnu/mod.rs +++ b/tests/helper/src/gen/sys/powerpc64le_linux_gnu/mod.rs @@ -4,21 +4,52 @@ #![cfg_attr(rustfmt, rustfmt::skip)] mod linux_headers_linux_auxvec; -pub use linux_headers_linux_auxvec::{AT_HWCAP, AT_HWCAP2}; +pub use linux_headers_linux_auxvec::AT_HWCAP; +pub use linux_headers_linux_auxvec::AT_HWCAP2; mod linux_headers_asm_cputable; -pub use linux_headers_asm_cputable::{ - PPC_FEATURE2_ARCH_2_07, PPC_FEATURE2_ARCH_3_00, PPC_FEATURE2_ARCH_3_1, - PPC_FEATURE2_DARN, PPC_FEATURE2_DSCR, PPC_FEATURE2_EBB, PPC_FEATURE2_HAS_IEEE128, - PPC_FEATURE2_HTM, PPC_FEATURE2_HTM_NOSC, PPC_FEATURE2_HTM_NO_SUSPEND, - PPC_FEATURE2_ISEL, PPC_FEATURE2_MMA, PPC_FEATURE2_SCV, PPC_FEATURE2_TAR, - PPC_FEATURE2_VEC_CRYPTO, PPC_FEATURE_32, PPC_FEATURE_601_INSTR, PPC_FEATURE_64, - PPC_FEATURE_ARCH_2_05, PPC_FEATURE_ARCH_2_06, PPC_FEATURE_BOOKE, PPC_FEATURE_CELL, - PPC_FEATURE_HAS_4xxMAC, PPC_FEATURE_HAS_ALTIVEC, PPC_FEATURE_HAS_DFP, - PPC_FEATURE_HAS_EFP_DOUBLE, PPC_FEATURE_HAS_EFP_SINGLE, PPC_FEATURE_HAS_FPU, - PPC_FEATURE_HAS_MMU, PPC_FEATURE_HAS_SPE, PPC_FEATURE_HAS_VSX, - PPC_FEATURE_ICACHE_SNOOP, PPC_FEATURE_NO_TB, PPC_FEATURE_PA6T, PPC_FEATURE_POWER4, - PPC_FEATURE_POWER5, PPC_FEATURE_POWER5_PLUS, PPC_FEATURE_POWER6_EXT, - PPC_FEATURE_PPC_LE, PPC_FEATURE_PSERIES_PERFMON_COMPAT, PPC_FEATURE_SMT, - PPC_FEATURE_TRUE_LE, PPC_FEATURE_UNIFIED_CACHE, -}; +pub use linux_headers_asm_cputable::PPC_FEATURE_32; +pub use linux_headers_asm_cputable::PPC_FEATURE_64; +pub use linux_headers_asm_cputable::PPC_FEATURE_601_INSTR; +pub use linux_headers_asm_cputable::PPC_FEATURE_HAS_ALTIVEC; +pub use linux_headers_asm_cputable::PPC_FEATURE_HAS_FPU; +pub use linux_headers_asm_cputable::PPC_FEATURE_HAS_MMU; +pub use linux_headers_asm_cputable::PPC_FEATURE_HAS_4xxMAC; +pub use linux_headers_asm_cputable::PPC_FEATURE_UNIFIED_CACHE; +pub use linux_headers_asm_cputable::PPC_FEATURE_HAS_SPE; +pub use linux_headers_asm_cputable::PPC_FEATURE_HAS_EFP_SINGLE; +pub use linux_headers_asm_cputable::PPC_FEATURE_HAS_EFP_DOUBLE; +pub use linux_headers_asm_cputable::PPC_FEATURE_NO_TB; +pub use linux_headers_asm_cputable::PPC_FEATURE_POWER4; +pub use linux_headers_asm_cputable::PPC_FEATURE_POWER5; +pub use linux_headers_asm_cputable::PPC_FEATURE_POWER5_PLUS; +pub use linux_headers_asm_cputable::PPC_FEATURE_CELL; +pub use linux_headers_asm_cputable::PPC_FEATURE_BOOKE; +pub use linux_headers_asm_cputable::PPC_FEATURE_SMT; +pub use linux_headers_asm_cputable::PPC_FEATURE_ICACHE_SNOOP; +pub use linux_headers_asm_cputable::PPC_FEATURE_ARCH_2_05; +pub use linux_headers_asm_cputable::PPC_FEATURE_PA6T; +pub use linux_headers_asm_cputable::PPC_FEATURE_HAS_DFP; +pub use linux_headers_asm_cputable::PPC_FEATURE_POWER6_EXT; +pub use linux_headers_asm_cputable::PPC_FEATURE_ARCH_2_06; +pub use linux_headers_asm_cputable::PPC_FEATURE_HAS_VSX; +pub use linux_headers_asm_cputable::PPC_FEATURE_PSERIES_PERFMON_COMPAT; +pub use linux_headers_asm_cputable::PPC_FEATURE_TRUE_LE; +pub use linux_headers_asm_cputable::PPC_FEATURE_PPC_LE; +pub use linux_headers_asm_cputable::PPC_FEATURE2_ARCH_2_07; +pub use linux_headers_asm_cputable::PPC_FEATURE2_HTM; +pub use linux_headers_asm_cputable::PPC_FEATURE2_DSCR; +pub use linux_headers_asm_cputable::PPC_FEATURE2_EBB; +pub use linux_headers_asm_cputable::PPC_FEATURE2_ISEL; +pub use linux_headers_asm_cputable::PPC_FEATURE2_TAR; +pub use linux_headers_asm_cputable::PPC_FEATURE2_VEC_CRYPTO; +pub use linux_headers_asm_cputable::PPC_FEATURE2_HTM_NOSC; +pub use linux_headers_asm_cputable::PPC_FEATURE2_ARCH_3_00; +pub use linux_headers_asm_cputable::PPC_FEATURE2_HAS_IEEE128; +pub use linux_headers_asm_cputable::PPC_FEATURE2_DARN; +pub use linux_headers_asm_cputable::PPC_FEATURE2_SCV; +pub use linux_headers_asm_cputable::PPC_FEATURE2_HTM_NO_SUSPEND; +pub use linux_headers_asm_cputable::PPC_FEATURE2_ARCH_3_1; +pub use linux_headers_asm_cputable::PPC_FEATURE2_MMA; +mod sys_auxv; +pub use sys_auxv::getauxval; pub type c_char = u8; diff --git a/tests/helper/src/gen/sys/powerpc64le_linux_gnu/sys_auxv.rs b/tests/helper/src/gen/sys/powerpc64le_linux_gnu/sys_auxv.rs new file mode 100644 index 00000000..a53605f5 --- /dev/null +++ b/tests/helper/src/gen/sys/powerpc64le_linux_gnu/sys_auxv.rs @@ -0,0 +1,7 @@ +// This file is @generated by portable-atomic-internal-codegen +// (gen function at tools/codegen/src/ffi.rs). +// It is not intended for manual editing. + +extern "C" { + pub fn getauxval(__type: ::std::os::raw::c_ulong) -> ::std::os::raw::c_ulong; +} diff --git a/tests/helper/src/gen/sys/powerpc64le_linux_musl/mod.rs b/tests/helper/src/gen/sys/powerpc64le_linux_musl/mod.rs index 16717ce3..1d6025c4 100644 --- a/tests/helper/src/gen/sys/powerpc64le_linux_musl/mod.rs +++ b/tests/helper/src/gen/sys/powerpc64le_linux_musl/mod.rs @@ -4,23 +4,52 @@ #![cfg_attr(rustfmt, rustfmt::skip)] mod linux_headers_linux_auxvec; -pub use linux_headers_linux_auxvec::{AT_HWCAP, AT_HWCAP2}; +pub use linux_headers_linux_auxvec::AT_HWCAP; +pub use linux_headers_linux_auxvec::AT_HWCAP2; mod linux_headers_asm_cputable; -pub use linux_headers_asm_cputable::{ - PPC_FEATURE2_ARCH_2_07, PPC_FEATURE2_ARCH_3_00, PPC_FEATURE2_ARCH_3_1, - PPC_FEATURE2_DARN, PPC_FEATURE2_DSCR, PPC_FEATURE2_EBB, PPC_FEATURE2_HAS_IEEE128, - PPC_FEATURE2_HTM, PPC_FEATURE2_HTM_NOSC, PPC_FEATURE2_HTM_NO_SUSPEND, - PPC_FEATURE2_ISEL, PPC_FEATURE2_MMA, PPC_FEATURE2_SCV, PPC_FEATURE2_TAR, - PPC_FEATURE2_VEC_CRYPTO, PPC_FEATURE_32, PPC_FEATURE_601_INSTR, PPC_FEATURE_64, - PPC_FEATURE_ARCH_2_05, PPC_FEATURE_ARCH_2_06, PPC_FEATURE_BOOKE, PPC_FEATURE_CELL, - PPC_FEATURE_HAS_4xxMAC, PPC_FEATURE_HAS_ALTIVEC, PPC_FEATURE_HAS_DFP, - PPC_FEATURE_HAS_EFP_DOUBLE, PPC_FEATURE_HAS_EFP_SINGLE, PPC_FEATURE_HAS_FPU, - PPC_FEATURE_HAS_MMU, PPC_FEATURE_HAS_SPE, PPC_FEATURE_HAS_VSX, - PPC_FEATURE_ICACHE_SNOOP, PPC_FEATURE_NO_TB, PPC_FEATURE_PA6T, PPC_FEATURE_POWER4, - PPC_FEATURE_POWER5, PPC_FEATURE_POWER5_PLUS, PPC_FEATURE_POWER6_EXT, - PPC_FEATURE_PPC_LE, PPC_FEATURE_PSERIES_PERFMON_COMPAT, PPC_FEATURE_SMT, - PPC_FEATURE_TRUE_LE, PPC_FEATURE_UNIFIED_CACHE, -}; -mod musl_sys_auxv; -pub use musl_sys_auxv::getauxval; +pub use linux_headers_asm_cputable::PPC_FEATURE_32; +pub use linux_headers_asm_cputable::PPC_FEATURE_64; +pub use linux_headers_asm_cputable::PPC_FEATURE_601_INSTR; +pub use linux_headers_asm_cputable::PPC_FEATURE_HAS_ALTIVEC; +pub use linux_headers_asm_cputable::PPC_FEATURE_HAS_FPU; +pub use linux_headers_asm_cputable::PPC_FEATURE_HAS_MMU; +pub use linux_headers_asm_cputable::PPC_FEATURE_HAS_4xxMAC; +pub use linux_headers_asm_cputable::PPC_FEATURE_UNIFIED_CACHE; +pub use linux_headers_asm_cputable::PPC_FEATURE_HAS_SPE; +pub use linux_headers_asm_cputable::PPC_FEATURE_HAS_EFP_SINGLE; +pub use linux_headers_asm_cputable::PPC_FEATURE_HAS_EFP_DOUBLE; +pub use linux_headers_asm_cputable::PPC_FEATURE_NO_TB; +pub use linux_headers_asm_cputable::PPC_FEATURE_POWER4; +pub use linux_headers_asm_cputable::PPC_FEATURE_POWER5; +pub use linux_headers_asm_cputable::PPC_FEATURE_POWER5_PLUS; +pub use linux_headers_asm_cputable::PPC_FEATURE_CELL; +pub use linux_headers_asm_cputable::PPC_FEATURE_BOOKE; +pub use linux_headers_asm_cputable::PPC_FEATURE_SMT; +pub use linux_headers_asm_cputable::PPC_FEATURE_ICACHE_SNOOP; +pub use linux_headers_asm_cputable::PPC_FEATURE_ARCH_2_05; +pub use linux_headers_asm_cputable::PPC_FEATURE_PA6T; +pub use linux_headers_asm_cputable::PPC_FEATURE_HAS_DFP; +pub use linux_headers_asm_cputable::PPC_FEATURE_POWER6_EXT; +pub use linux_headers_asm_cputable::PPC_FEATURE_ARCH_2_06; +pub use linux_headers_asm_cputable::PPC_FEATURE_HAS_VSX; +pub use linux_headers_asm_cputable::PPC_FEATURE_PSERIES_PERFMON_COMPAT; +pub use linux_headers_asm_cputable::PPC_FEATURE_TRUE_LE; +pub use linux_headers_asm_cputable::PPC_FEATURE_PPC_LE; +pub use linux_headers_asm_cputable::PPC_FEATURE2_ARCH_2_07; +pub use linux_headers_asm_cputable::PPC_FEATURE2_HTM; +pub use linux_headers_asm_cputable::PPC_FEATURE2_DSCR; +pub use linux_headers_asm_cputable::PPC_FEATURE2_EBB; +pub use linux_headers_asm_cputable::PPC_FEATURE2_ISEL; +pub use linux_headers_asm_cputable::PPC_FEATURE2_TAR; +pub use linux_headers_asm_cputable::PPC_FEATURE2_VEC_CRYPTO; +pub use linux_headers_asm_cputable::PPC_FEATURE2_HTM_NOSC; +pub use linux_headers_asm_cputable::PPC_FEATURE2_ARCH_3_00; +pub use linux_headers_asm_cputable::PPC_FEATURE2_HAS_IEEE128; +pub use linux_headers_asm_cputable::PPC_FEATURE2_DARN; +pub use linux_headers_asm_cputable::PPC_FEATURE2_SCV; +pub use linux_headers_asm_cputable::PPC_FEATURE2_HTM_NO_SUSPEND; +pub use linux_headers_asm_cputable::PPC_FEATURE2_ARCH_3_1; +pub use linux_headers_asm_cputable::PPC_FEATURE2_MMA; +mod sys_auxv; +pub use sys_auxv::getauxval; pub type c_char = u8; diff --git a/tests/helper/src/gen/sys/powerpc64le_linux_musl/musl_sys_auxv.rs b/tests/helper/src/gen/sys/powerpc64le_linux_musl/sys_auxv.rs similarity index 100% rename from tests/helper/src/gen/sys/powerpc64le_linux_musl/musl_sys_auxv.rs rename to tests/helper/src/gen/sys/powerpc64le_linux_musl/sys_auxv.rs diff --git a/tools/codegen/Cargo.toml b/tools/codegen/Cargo.toml index 08f13e65..88844d46 100644 --- a/tools/codegen/Cargo.toml +++ b/tools/codegen/Cargo.toml @@ -6,9 +6,9 @@ publish = false [dependencies] anyhow = "1" -bindgen = "0.65" +bindgen = { default-features = false, features = ["prettyplease", "runtime"], git = "https://github.com/taiki-e/rust-bindgen.git", branch = "dev" } # https://github.com/rust-lang/rust-bindgen/pull/2369 + avoid https://github.com/rust-lang/cargo/issues/10623 + avoid bug on generate c str option camino = "1" -duct = "0.13" +duct = { git = "https://github.com/taiki-e/duct.rs.git", branch = "dev" } # drop once_cell that may cause https://github.com/rust-lang/cargo/issues/10623 fs-err = "2" globset = "=0.4.9" # globset 0.4.10 depends on bstr 1 which may cause https://github.com/rust-lang/cargo/issues/10623 prettyplease = "0.2" @@ -18,4 +18,4 @@ regex = "~1.7" # regex 1.8 may cause https://github.com/rust-lang/cargo/issues/1 serde = { version = "1", features = ["derive"] } serde_json = "1" syn = { version = "2", features = ["full"] } -target-spec-json = "0.1" +target-spec-json = "0.1.3" diff --git a/tools/codegen/patches/.gitkeep b/tools/codegen/patches/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/tools/codegen/patches/android.diff b/tools/codegen/patches/android.diff deleted file mode 100644 index 659ed2b5..00000000 --- a/tools/codegen/patches/android.diff +++ /dev/null @@ -1,11 +0,0 @@ -diff --git a/aosp-mirror/platform_bionic/libc/include/sys/system_properties.h b/aosp-mirror/platform_bionic/libc/include/sys/system_properties.h ---- a/aosp-mirror/platform_bionic/libc/include/sys/system_properties.h -+++ b/aosp-mirror/platform_bionic/libc/include/sys/system_properties.h -@@ -30,7 +30,7 @@ - #define _INCLUDE_SYS_SYSTEM_PROPERTIES_H - - #include --#include -+#define bool _Bool - #include - #include diff --git a/tools/codegen/patches/freebsd.diff b/tools/codegen/patches/freebsd.diff deleted file mode 100644 index 3b21f7b9..00000000 --- a/tools/codegen/patches/freebsd.diff +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/sys/sys/elf_common.h b/sys/sys/elf_common.h ---- a/sys/sys/elf_common.h -+++ b/sys/sys/elf_common.h -@@ -33,6 +33,8 @@ - #ifndef _SYS_ELF_COMMON_H_ - #define _SYS_ELF_COMMON_H_ 1 - -+#include -+ - /* - * ELF definitions that are independent of architecture or word size. - */ diff --git a/tools/codegen/patches/fuchsia.diff b/tools/codegen/patches/fuchsia.diff deleted file mode 100644 index 692a42f8..00000000 --- a/tools/codegen/patches/fuchsia.diff +++ /dev/null @@ -1,115 +0,0 @@ -diff --git a/zircon/system/public/zircon/features.h b/zircon/system/public/zircon/features.h ---- a/zircon/system/public/zircon/features.h -+++ b/zircon/system/public/zircon/features.h -@@ -8,17 +8,17 @@ - // clang-format off - - // types of features that can be retrieved via |zx_system_get_features| --#define ZX_FEATURE_KIND_CPU ((uint32_t)0) --#define ZX_FEATURE_KIND_HW_BREAKPOINT_COUNT ((uint32_t)1) --#define ZX_FEATURE_KIND_HW_WATCHPOINT_COUNT ((uint32_t)2) --#define ZX_FEATURE_KIND_ADDRESS_TAGGING ((uint32_t)3) --#define ZX_FEATURE_KIND_VM ((uint32_t)4) -+#define ZX_FEATURE_KIND_CPU 0 -+#define ZX_FEATURE_KIND_HW_BREAKPOINT_COUNT 1 -+#define ZX_FEATURE_KIND_HW_WATCHPOINT_COUNT 2 -+#define ZX_FEATURE_KIND_ADDRESS_TAGGING 3 -+#define ZX_FEATURE_KIND_VM 4 - - // arch-independent CPU features --#define ZX_HAS_CPU_FEATURES ((uint32_t)(1u << 0)) -+#define ZX_HAS_CPU_FEATURES (1u << 0) - - // Virtual memory features. --#define ZX_VM_FEATURE_CAN_MAP_XOM ((uint32_t)(1u << 0)) -+#define ZX_VM_FEATURE_CAN_MAP_XOM (1u << 0) - - #if defined(__x86_64__) - -@@ -28,30 +28,30 @@ - #elif defined(__aarch64__) - - // arm64 CPU features --#define ZX_ARM64_FEATURE_ISA_FP ((uint32_t)(1u << 1)) --#define ZX_ARM64_FEATURE_ISA_ASIMD ((uint32_t)(1u << 2)) --#define ZX_ARM64_FEATURE_ISA_AES ((uint32_t)(1u << 3)) --#define ZX_ARM64_FEATURE_ISA_PMULL ((uint32_t)(1u << 4)) --#define ZX_ARM64_FEATURE_ISA_SHA1 ((uint32_t)(1u << 5)) --#define ZX_ARM64_FEATURE_ISA_SHA256 ((uint32_t)(1u << 6)) --#define ZX_ARM64_FEATURE_ISA_CRC32 ((uint32_t)(1u << 7)) --#define ZX_ARM64_FEATURE_ISA_ATOMICS ((uint32_t)(1u << 8)) --#define ZX_ARM64_FEATURE_ISA_RDM ((uint32_t)(1u << 9)) --#define ZX_ARM64_FEATURE_ISA_SHA3 ((uint32_t)(1u << 10)) --#define ZX_ARM64_FEATURE_ISA_SM3 ((uint32_t)(1u << 11)) --#define ZX_ARM64_FEATURE_ISA_SM4 ((uint32_t)(1u << 12)) --#define ZX_ARM64_FEATURE_ISA_DP ((uint32_t)(1u << 13)) --#define ZX_ARM64_FEATURE_ISA_DPB ((uint32_t)(1u << 14)) --#define ZX_ARM64_FEATURE_ISA_FHM ((uint32_t)(1u << 15)) --#define ZX_ARM64_FEATURE_ISA_TS ((uint32_t)(1u << 16)) --#define ZX_ARM64_FEATURE_ISA_RNDR ((uint32_t)(1u << 17)) --#define ZX_ARM64_FEATURE_ISA_SHA512 ((uint32_t)(1u << 18)) --#define ZX_ARM64_FEATURE_ISA_I8MM ((uint32_t)(1u << 19)) --#define ZX_ARM64_FEATURE_ISA_SVE ((uint32_t)(1u << 20)) -+#define ZX_ARM64_FEATURE_ISA_FP (1u << 1) -+#define ZX_ARM64_FEATURE_ISA_ASIMD (1u << 2) -+#define ZX_ARM64_FEATURE_ISA_AES (1u << 3) -+#define ZX_ARM64_FEATURE_ISA_PMULL (1u << 4) -+#define ZX_ARM64_FEATURE_ISA_SHA1 (1u << 5) -+#define ZX_ARM64_FEATURE_ISA_SHA256 (1u << 6) -+#define ZX_ARM64_FEATURE_ISA_CRC32 (1u << 7) -+#define ZX_ARM64_FEATURE_ISA_ATOMICS (1u << 8) -+#define ZX_ARM64_FEATURE_ISA_RDM (1u << 9) -+#define ZX_ARM64_FEATURE_ISA_SHA3 (1u << 10) -+#define ZX_ARM64_FEATURE_ISA_SM3 (1u << 11) -+#define ZX_ARM64_FEATURE_ISA_SM4 (1u << 12) -+#define ZX_ARM64_FEATURE_ISA_DP (1u << 13) -+#define ZX_ARM64_FEATURE_ISA_DPB (1u << 14) -+#define ZX_ARM64_FEATURE_ISA_FHM (1u << 15) -+#define ZX_ARM64_FEATURE_ISA_TS (1u << 16) -+#define ZX_ARM64_FEATURE_ISA_RNDR (1u << 17) -+#define ZX_ARM64_FEATURE_ISA_SHA512 (1u << 18) -+#define ZX_ARM64_FEATURE_ISA_I8MM (1u << 19) -+#define ZX_ARM64_FEATURE_ISA_SVE (1u << 20) - - // This is an obsolete name for the same thing. - #define ZX_ARM64_FEATURE_ISA_SHA2 ZX_ARM64_FEATURE_ISA_SHA256 - - // arm64 address-tagging features --#define ZX_ARM64_FEATURE_ADDRESS_TAGGING_TBI ((uint32_t)(1u << 0)) -+#define ZX_ARM64_FEATURE_ADDRESS_TAGGING_TBI (1u << 0) - - #elif defined(__riscv) - -diff --git a/zircon/system/public/zircon/types.h b/zircon/system/public/zirc -on/types.h ---- a/zircon/system/public/zircon/types.h -+++ b/zircon/system/public/zircon/types.h -@@ -5,8 +5,8 @@ - #ifndef SYSROOT_ZIRCON_TYPES_H_ - #define SYSROOT_ZIRCON_TYPES_H_ - --#include --#include -+// #include -+// #include - #include - #include - #include -@@ -23,7 +23,7 @@ - // A better solution would be to use and C11 atomic operation - // even in the kernel, but that would require modifying all the code that uses - // the existing homegrown atomics. --#include -+// #include - #endif - #endif - -@@ -563,7 +563,7 @@ typedef int zx_futex_t; - #ifdef _KERNEL - typedef int zx_futex_t; - #else --typedef atomic_int zx_futex_t; -+// typedef atomic_int zx_futex_t; - #endif - #endif - typedef int zx_futex_storage_t; diff --git a/tools/codegen/patches/linux-gnu.diff b/tools/codegen/patches/linux-gnu.diff new file mode 100644 index 00000000..b1732325 --- /dev/null +++ b/tools/codegen/patches/linux-gnu.diff @@ -0,0 +1,40 @@ +diff --git a/bminor/glibc/include/sys/auxv.h b/bminor/glibc/include/sys/auxv.h +index dd0602b0..6d083f4b 100644 +--- a/bminor/glibc/include/sys/auxv.h ++++ b/bminor/glibc/include/sys/auxv.h +@@ -3,11 +3,11 @@ + #ifndef _ISOMAC + + extern __typeof (getauxval) __getauxval; +-libc_hidden_proto (__getauxval) ++// libc_hidden_proto (__getauxval) + + /* Like getauxval, but writes the value to *RESULT and returns true if + found, or returns false. Does not set errno. */ +-_Bool __getauxval2 (unsigned long int type, unsigned long int *result); +-libc_hidden_proto (__getauxval2) ++// _Bool __getauxval2 (unsigned long int type, unsigned long int *result); ++// libc_hidden_proto (__getauxval2) + + #endif /* !_ISOMAC */ +diff --git a/include/sys/cdefs.h b/include/sys/cdefs.h +index 56adb231..da240141 100644 +--- a/bminor/glibc/include/sys/cdefs.h ++++ b/bminor/glibc/include/sys/cdefs.h +@@ -17,13 +17,13 @@ + # define __nonnull(params) + + extern void __chk_fail (void) __attribute__ ((__noreturn__)); +-libc_hidden_proto (__chk_fail) +-rtld_hidden_proto (__chk_fail) ++// libc_hidden_proto (__chk_fail) ++// rtld_hidden_proto (__chk_fail) + + /* If we are using redirects internally to support long double, + we need to tweak some macros to ensure the PLT bypass tricks + continue to work in libc. */ +-#if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 && IS_IN (libc) && defined SHARED ++#if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 && false && defined SHARED + + # undef __LDBL_REDIR_DECL + # define __LDBL_REDIR_DECL(func) \ diff --git a/tools/codegen/patches/linux-uclibc.diff b/tools/codegen/patches/linux-uclibc.diff new file mode 100644 index 00000000..98ce2174 --- /dev/null +++ b/tools/codegen/patches/linux-uclibc.diff @@ -0,0 +1,20 @@ +diff --git a/wbx-github/uclibc-ng/Makefile.in b/wbx-github/uclibc-ng/Makefile.in +index 60ee795..0ea09f4 100644 +--- a/wbx-github/uclibc-ng/Makefile.in ++++ b/wbx-github/uclibc-ng/Makefile.in +@@ -194,15 +194,6 @@ $(top_builddir)include/bits/sysnum.h: $(top_srcdir)extra/scripts/gen_bits_syscal + $(Q)set -e; \ + KERNEL_HEADERS="${KERNEL_HEADERS}" CC="$(CC) $(CPU_CFLAGS)" $(SHELL) $< > $@.new; \ + cmp -s $@ $@.new && $(RM) $@.new || mv -f $@.new $@ +- @# Ugly linux specific hack.. +- $(Q)if grep -q __NR_ $@; then true; else \ +- rm -f $@; \ +- echo "ERROR: Could not generate syscalls."; \ +- echo "Make sure that you have properly installed kernel headers."; \ +- echo "Your .config KERNEL_HEADERS=\"\" was set to:"; \ +- echo "${KERNEL_HEADERS}"; \ +- exit 1; \ +- fi + + .PHONY: $(LOCAL_INSTALL_PATH) + $(LOCAL_INSTALL_PATH): diff --git a/tools/codegen/patches/macos.diff b/tools/codegen/patches/macos.diff deleted file mode 100644 index aea8185b..00000000 --- a/tools/codegen/patches/macos.diff +++ /dev/null @@ -1,23 +0,0 @@ -diff --git a/bsd/sys/proc.h b/bsd/sys/proc.h ---- a/bsd/sys/proc.h -+++ b/bsd/sys/proc.h -@@ -69,6 +69,8 @@ - #ifndef _SYS_PROC_H_ - #define _SYS_PROC_H_ - -+#include -+#include - #include - #include - #include /* For struct selinfo. */ -diff --git a/bsd/sys/ucred.h b/bsd/sys/ucred.h ---- a/bsd/sys/ucred.h -+++ b/bsd/sys/ucred.h -@@ -70,6 +70,7 @@ - #ifndef _SYS_UCRED_H_ - #define _SYS_UCRED_H_ - -+#include - #include - #include - #include diff --git a/tools/codegen/patches/openbsd.diff b/tools/codegen/patches/openbsd.diff deleted file mode 100644 index e00368b1..00000000 --- a/tools/codegen/patches/openbsd.diff +++ /dev/null @@ -1,10 +0,0 @@ -diff --git a/sys/sys/sysctl.h b/sys/sys/sysctl.h ---- a/sys/sys/sysctl.h -+++ b/sys/sys/sysctl.h -@@ -38,6 +38,7 @@ - #ifndef _SYS_SYSCTL_H_ - #define _SYS_SYSCTL_H_ - -+#include - #include - #include diff --git a/tools/codegen/src/ffi.rs b/tools/codegen/src/ffi.rs index ec774f57..15b4d82c 100644 --- a/tools/codegen/src/ffi.rs +++ b/tools/codegen/src/ffi.rs @@ -8,7 +8,7 @@ // // See also https://github.com/rust-lang/libc/issues/570. -use std::{collections::BTreeSet, ffi::OsStr, process::Command}; +use std::{ffi::OsStr, process::Command}; use anyhow::{Context as _, Result}; use camino::{Utf8Path, Utf8PathBuf}; @@ -18,9 +18,9 @@ use fs_err as fs; use quote::{format_ident, quote}; use regex::Regex; use target_spec_json::{ - TargetArch::{self, *}, - TargetEnv::{self, *}, - TargetOs::{self, *}, + Arch::{self, *}, + Env::{self, *}, + Os::{self, *}, TargetSpec, }; @@ -73,32 +73,22 @@ static TARGETS: &[Target] = &[ os: &[], env: &[], }, - // TODO: getauxval - // https://github.com/bminor/glibc/blob/HEAD/misc/sys/auxv.h - // https://repo.or.cz/uclibc-ng.git/blob/HEAD:/include/sys/auxv.h Header { + // https://github.com/bminor/glibc/blob/HEAD/misc/sys/auxv.h // https://github.com/bminor/musl/blob/HEAD/include/sys/auxv.h - path: "musl:sys/auxv.h", - types: &[], - vars: &[], - functions: &["getauxval"], - arch: &[], - os: &[linux], - env: &[musl], - }, - Header { + // https://github.com/wbx-github/uclibc-ng/blob/HEAD/include/sys/auxv.h // https://github.com/aosp-mirror/platform_bionic/blob/HEAD/libc/include/sys/auxv.h - path: "bionic:sys/auxv.h", + path: "sys/auxv.h", types: &[], vars: &[], functions: &["getauxval"], arch: &[], - os: &[android], + os: &[], env: &[], }, Header { // https://github.com/aosp-mirror/platform_bionic/blob/HEAD/libc/include/sys/system_properties.h - path: "bionic:sys/system_properties.h", + path: "sys/system_properties.h", types: &[], vars: &["PROP_VALUE_MAX"], functions: &["__system_property_get"], @@ -249,15 +239,15 @@ struct Header { functions: &'static [&'static str], // If not empty, code is generated only for the specified targets. - arch: &'static [TargetArch], - os: &'static [TargetOs], - env: &'static [TargetEnv], + arch: &'static [Arch], + os: &'static [Os], + env: &'static [Env], } pub(crate) fn gen() -> Result<()> { let workspace_root = &workspace_root(); - let download_cache_dir = &workspace_root.join("tools/codegen/tmp/cache"); - fs::create_dir_all(download_cache_dir)?; + let download_dir = &workspace_root.join("tools/codegen/tmp/cache"); + fs::create_dir_all(download_dir)?; let out_dir = &workspace_root.join("tests/helper/src/gen/sys"); fs::remove_dir_all(out_dir)?; let raw_line = file::header(function_name!()); @@ -277,7 +267,7 @@ pub(crate) fn gen() -> Result<()> { cfg.extend(quote! { target_arch = #arch }); let os = target.os.as_str(); cfg.extend(quote! { , target_os = #os }); - if target.env != TargetEnv::none { + if target.env != Env::none { let env = target.env.as_str(); cfg.extend(quote! { , target_env = #env }); } @@ -293,26 +283,7 @@ pub(crate) fn gen() -> Result<()> { }); } fs::create_dir_all(out_dir)?; - let src_dir = &git_clone(target, download_cache_dir)?; - install_headers(target, src_dir)?; - - let target_flag = &*format!("--target={triple}"); - let mut clang_args = vec![target_flag, "-nostdinc"]; - macro_rules! define { - ($name:ident, $value:literal) => {{ - clang_args.push(concat!("-D", stringify!($name), "=", $value)); - }}; - } - match target.os { - macos => { - // https://github.com/apple-oss-distributions/xnu/blob/5c2921b07a2480ab43ec66f5b9e41cb872bc554f/bsd/sys/cdefs.h#L512-L522 - define!(_POSIX_C_SOURCE, "200112L"); - } - fuchsia => { - define!(size_t, "unsigned long"); - } - _ => {} - } + let src_dir = &download_headers(target, download_dir)?; let mut files = vec![]; for &header in headers { @@ -329,7 +300,6 @@ pub(crate) fn gen() -> Result<()> { let functions = header.functions.join("|"); let types = header.types.join("|"); let vars = header.vars.join("|"); - let mut clang_args = clang_args.clone(); let out_file = format!( "{}.rs", @@ -339,6 +309,21 @@ pub(crate) fn gen() -> Result<()> { ); let out_path = out_dir.join(&out_file); + let target_flag = &*format!("--target={triple}"); + let mut clang_args = vec![target_flag, "-nostdinc"]; + macro_rules! define { + ($name:ident) => {{ + clang_args.push(concat!("-D", stringify!($name))); + }}; + ($name:ident, $value:literal) => {{ + clang_args.push(concat!("-D", stringify!($name), "=", $value)); + }}; + } + macro_rules! include_header { + ($value:literal) => {{ + clang_args.push(concat!("-include", $value)); + }}; + } let header_path; let include; match target.os { @@ -347,13 +332,9 @@ pub(crate) fn gen() -> Result<()> { if let Some(path) = header.path.strip_prefix("linux-headers:") { header_path = linux_headers_dir.join("include").join(path); include = vec![linux_headers_dir.join("include")]; - } else if let Some(path) = header.path.strip_prefix("musl:") { - let musl_headers_dir = musl_headers_dir(target, src_dir); - header_path = musl_headers_dir.join("include").join(path); - include = vec![musl_headers_dir.join("include")]; - } else if let Some(path) = header.path.strip_prefix("bionic:") { + } else if target.os == android { let bionic_dir = bionic_dir(src_dir).join("libc"); - header_path = bionic_dir.join("include").join(path); + header_path = bionic_dir.join("include").join(header.path); include = vec![ linux_headers_dir.join("include"), bionic_dir.join("include"), @@ -361,8 +342,18 @@ pub(crate) fn gen() -> Result<()> { bionic_dir.join("kernel/uapi"), bionic_dir.join("kernel/android/uapi"), ]; + } else if target.env == gnu { + let glibc_dir = glibc_dir(src_dir); + header_path = glibc_dir.join("include").join(header.path); + include = vec![ + glibc_dir.join("include"), + glibc_dir.join("sysdeps").join(glibc_arch(target)), + glibc_dir, + ]; } else { - todo!("{}", header.path); + let headers_dir = libc_headers_dir(target, src_dir); + header_path = headers_dir.join("include").join(header.path); + include = vec![headers_dir.join("include")]; } } macos => { @@ -374,10 +365,16 @@ pub(crate) fn gen() -> Result<()> { src_dir.parent().unwrap().join("Libc/include"), src_dir.parent().unwrap().join("libpthread/include"), ]; + // https://github.com/apple-oss-distributions/xnu/blob/5c2921b07a2480ab43ec66f5b9e41cb872bc554f/bsd/sys/cdefs.h#L512-L522 + define!(_POSIX_C_SOURCE, "200112L"); + include_header!("sys/_types/_u_char.h"); + include_header!("sys/_types/_u_short.h"); + include_header!("sys/_types/_u_int.h"); } freebsd | openbsd => { header_path = src_dir.join("include").join(header.path); include = vec![src_dir.join("include")]; + include_header!("sys/types.h"); } fuchsia => { header_path = src_dir.join(header.path); @@ -385,6 +382,7 @@ pub(crate) fn gen() -> Result<()> { src_dir.join("zircon/system/public"), src_dir.join("zircon/kernel/lib/libc/include"), ]; + define!(_KERNEL); } _ => todo!("{target:?}"), } @@ -418,8 +416,8 @@ pub(crate) fn gen() -> Result<()> { let mut modules = vec![]; for (path, functions, types, vars) in &files { let module_name = format_ident!("{}", Utf8Path::new(path).file_stem().unwrap()); + let mut uses = vec![]; // Only export matched names because the module may contain type def. - let mut uses = BTreeSet::new(); let functions = Regex::new(&format!("^({functions})$"))?; let types = Regex::new(&format!("^({types})$"))?; let vars = Regex::new(&format!("^({vars})$"))?; @@ -433,7 +431,7 @@ pub(crate) fn gen() -> Result<()> { if matches!(i.vis, syn::Visibility::Public(..)) && functions.is_match(&i.sig.ident.to_string()) => { - uses.insert(format_ident!("{}", i.sig.ident)); + uses.push(format_ident!("{}", i.sig.ident)); } _ => {} } @@ -443,26 +441,27 @@ pub(crate) fn gen() -> Result<()> { if matches!(i.vis, syn::Visibility::Public(..)) && types.is_match(&i.ident.to_string()) => { - uses.insert(format_ident!("{}", i.ident)); + uses.push(format_ident!("{}", i.ident)); } syn::Item::Type(i) if matches!(i.vis, syn::Visibility::Public(..)) && types.is_match(&i.ident.to_string()) => { - uses.insert(format_ident!("{}", i.ident)); + uses.push(format_ident!("{}", i.ident)); } syn::Item::Const(i) if matches!(i.vis, syn::Visibility::Public(..)) && vars.is_match(&i.ident.to_string()) => { - uses.insert(format_ident!("{}", i.ident)); + uses.push(format_ident!("{}", i.ident)); } _ => {} } } + let uses = uses.iter(); modules.push(quote! { mod #module_name; - pub use #module_name::{#(#uses),*}; + #(pub use #module_name::#uses;)* }); } // e.g., clang -E -dM -x c /dev/null -target aarch64-unknown-linux-gnu | grep __CHAR_ @@ -485,8 +484,7 @@ pub(crate) fn gen() -> Result<()> { dead_code, non_camel_case_types, non_upper_case_globals, - unreachable_pub, - unused_imports, + clippy::unnecessary_cast, clippy::unreadable_literal, )] #(#target_modules)* @@ -494,20 +492,29 @@ pub(crate) fn gen() -> Result<()> { Ok(()) } +// https://github.com/bminor/glibc +const GLIBC_REPO: &str = "bminor/glibc"; // https://github.com/bminor/musl const MUSL_REPO: &str = "bminor/musl"; +// https://github.com/wbx-github/uclibc-ng +const UCLIBC_REPO: &str = "wbx-github/uclibc-ng"; // https://github.com/aosp-mirror/platform_bionic const BIONIC_REPO: &str = "aosp-mirror/platform_bionic"; -fn git_clone(target: &TargetSpec, download_cache_dir: &Utf8Path) -> Result { +fn download_headers(target: &TargetSpec, download_dir: &Utf8Path) -> Result { fn clone( - download_cache_dir: &Utf8Path, + download_dir: &Utf8Path, repository: &str, sparse_checkout: &[&str], ) -> Result { let name = repository.strip_suffix(".git").unwrap_or(repository); - let name = name.strip_prefix("https://github.com/").unwrap_or(name); let name = name.replace("https://fuchsia.googlesource.com/", "fuchsia/"); - let src_dir = download_cache_dir.join(name); + assert!(!name.contains("://"), "{}", name); + let repository = if repository.contains("://") { + repository.to_owned() + } else { + format!("https://github.com/{repository}.git") + }; + let src_dir = download_dir.join(name); if !src_dir.exists() { fs::create_dir_all(src_dir.parent().unwrap())?; if sparse_checkout.is_empty() { @@ -538,76 +545,43 @@ fn git_clone(target: &TargetSpec, download_cache_dir: &Utf8Path) -> Result { - if target.os == android { - clone(download_cache_dir, &format!("https://github.com/{BIONIC_REPO}.git"), &[])?; - } else if target.env == musl { - clone(download_cache_dir, &format!("https://github.com/{MUSL_REPO}.git"), &[ - "/include/", - "/arch/", - "/tools/", - ])?; + fn patch(target: &TargetSpec, src_dir: &Utf8Path) -> Result<()> { + let patch_dir = Utf8Path::new("tools/codegen/patches"); + for path in [ + patch_dir.join(format!("{}.diff", target.os)), + patch_dir.join(format!("{}-{}.diff", target.os, target.env)), + ] { + if !path.exists() { + continue; } - clone(download_cache_dir, "https://github.com/torvalds/linux.git", &[ - "/include/", - "/arch/", - "/scripts/", - "/tools/", - ])? - } - macos => { - clone(download_cache_dir, "https://github.com/apple-oss-distributions/Libc.git", &[])?; - clone( - download_cache_dir, - "https://github.com/apple-oss-distributions/libpthread.git", - &[], - )?; - clone(download_cache_dir, "https://github.com/apple-oss-distributions/xnu.git", &[])? - } - freebsd => clone(download_cache_dir, "https://github.com/freebsd/freebsd-src.git", &[ - "/include/", - "/sys/", - ])?, - openbsd => clone(download_cache_dir, "https://github.com/openbsd/src.git", &[ - "/include/", - "/sys/", - ])?, - fuchsia => clone(download_cache_dir, "https://fuchsia.googlesource.com/fuchsia", &[])?, - _ => todo!("{target:?}"), - }; - // TODO: remove needs of patches. - for e in fs::read_dir("tools/codegen/patches")?.filter_map(Result::ok) { - let path = e.path(); - if path.file_stem() == Some(OsStr::new(target.os.as_str())) - || path.file_stem() - == Some(OsStr::new(&format!("{}-{}", target.os.as_str(), target.env.as_str()))) - { let dir = match target.os { linux | android => src_dir.parent().unwrap().parent().unwrap(), - _ => &src_dir, + _ => src_dir, }; cmd!("patch", "-p1").stdin_file(fs::File::open(path)?.into_parts().0).dir(dir).run()?; } + Ok(()) } - Ok(src_dir) -} - -fn linux_headers_dir(target: &TargetSpec, src_dir: &Utf8Path) -> Utf8PathBuf { - src_dir.join("../..").join("headers").join("linux").join(linux_arch(target)) -} -fn musl_headers_dir(target: &TargetSpec, src_dir: &Utf8Path) -> Utf8PathBuf { - src_dir.join("../..").join("headers").join("musl").join(musl_arch(target)) -} -fn bionic_dir(src_dir: &Utf8Path) -> Utf8PathBuf { - src_dir.join("../..").join(BIONIC_REPO) -} - -fn install_headers(target: &TargetSpec, src_dir: &Utf8Path) -> Result<()> { + let src_dir; match target.os { linux | android => { + if target.os == android { + clone(download_dir, BIONIC_REPO, &["/libc/"])?; + } else if target.env == gnu { + clone(download_dir, GLIBC_REPO, &[])?; + } else if target.env == musl { + clone(download_dir, MUSL_REPO, &["/arch/", "/include/", "/tools/"])?; + } else if target.env == uclibc { + clone(download_dir, UCLIBC_REPO, &[])?; + } + src_dir = clone(download_dir, "torvalds/linux", &[ + "/arch/", + "/include/", + "/scripts/", + "/tools/", + ])?; let linux_arch = linux_arch(target); - let linux_headers_dir = &linux_headers_dir(target, src_dir); + let linux_headers_dir = &linux_headers_dir(target, &src_dir); if !linux_headers_dir.exists() { // https://www.kernel.org/doc/Documentation/kbuild/headers_install.txt cmd!( @@ -616,37 +590,99 @@ fn install_headers(target: &TargetSpec, src_dir: &Utf8Path) -> Result<()> { format!("ARCH={linux_arch}"), format!("INSTALL_HDR_PATH={linux_headers_dir}"), ) - .dir(src_dir) + .dir(&src_dir) .stdout_capture() .run()?; } - if target.env == musl { + if target.os == android { + fs::write( + bionic_dir(&src_dir).join("libc/include/stdbool.h"), + "#define bool _Bool", + )?; + } else if target.env == gnu { + let glibc_arch = glibc_arch(target); + let glibc_src_dir = &src_dir.join("../..").join(GLIBC_REPO); + // TODO: use https://github.com/bminor/glibc/blob/HEAD/Makefile? + let sysdeps_dir = &glibc_src_dir.join("sysdeps"); + for e in fs::read_dir(sysdeps_dir.join("generic"))?.filter_map(Result::ok) { + let path = &e.path(); + if path.extension() != Some(OsStr::new("h")) { + continue; + } + let file = path.file_name().unwrap().to_str().unwrap(); + if !sysdeps_dir.join(glibc_arch).join(file).exists() { + symlink(path, sysdeps_dir.join(glibc_arch).join(file))?; + } + } + fs::write(glibc_src_dir.join("include/stddef.h"), "")?; + patch(target, &src_dir)?; + } else if target.env == musl { let musl_arch = musl_arch(target); let musl_src_dir = &src_dir.join("../..").join(MUSL_REPO); - let musl_headers_dir = &musl_headers_dir(target, src_dir); - if !musl_headers_dir.exists() { + let headers_dir = &libc_headers_dir(target, &src_dir); + if !headers_dir.exists() { // https://github.com/bminor/musl/blob/HEAD/Makefile cmd!( "make", "install-headers", format!("ARCH={musl_arch}"), - format!("DESTDIR={musl_headers_dir}"), + format!("DESTDIR={headers_dir}"), "prefix=/", ) .dir(musl_src_dir) .stdout_capture() .run()?; } + } else if target.env == uclibc { + let uclibc_arch = uclibc_arch(target); + let uclibc_src_dir = &src_dir.join("../..").join(UCLIBC_REPO); + let config_path = &uclibc_src_dir.join(".config"); + if config_path.exists() { + fs::remove_file(config_path)?; + } + patch(target, &src_dir)?; + let headers_dir = &libc_headers_dir(target, &src_dir); + if !headers_dir.exists() { + // https://github.com/wbx-github/uclibc-ng/blob/HEAD/Makefile.in + cmd!("make", "allnoconfig", format!("ARCH={uclibc_arch}")) + .dir(uclibc_src_dir) + .stdout_capture() + .run()?; + cmd!( + "make", + "install_headers", + format!("ARCH={uclibc_arch}"), + "HAVE_SHARED=y", + format!("DESTDIR={headers_dir}"), + format!("PREFIX={headers_dir}"), + "DEVEL_PREFIX=/", + format!("KERNEL_HEADERS={linux_headers_dir}/include"), + ) + .dir(uclibc_src_dir) + .stdout_capture() + .run()?; + } } } macos => { + clone(download_dir, "apple-oss-distributions/Libc", &["/include/"])?; + clone(download_dir, "apple-oss-distributions/libpthread", &["/include/"])?; + src_dir = clone(download_dir, "apple-oss-distributions/xnu", &[ + "/bsd/", + "/EXTERNAL_HEADERS/", + "/osfmk/", + ])?; // TODO: use https://github.com/apple-oss-distributions/xnu/blob/5c2921b07a2480ab43ec66f5b9e41cb872bc554f/Makefile? // https://github.com/apple-oss-distributions/xnu/blob/5c2921b07a2480ab43ec66f5b9e41cb872bc554f/bsd/sys/make_symbol_aliasing.sh - // https://github.com/apple-oss-distributions/xnu/blob/5c2921b07a2480ab43ec66f5b9e41cb872bc554f/bsd/sys/make_posix_availability.sh fs::write(src_dir.join("bsd/sys/_symbol_aliasing.h"), "")?; - fs::write(src_dir.join("bsd/sys/_posix_availability.h"), "")?; + // https://github.com/apple-oss-distributions/xnu/blob/5c2921b07a2480ab43ec66f5b9e41cb872bc554f/bsd/sys/make_posix_availability.sh + cmd!("bash", "bsd/sys/make_posix_availability.sh", "bsd/sys/_posix_availability.h") + .dir(&src_dir) + .stdout_capture() + .run()?; } freebsd => { + src_dir = clone(download_dir, "freebsd/freebsd-src", &["/include/", "/sys/"])?; // TODO: use https://github.com/freebsd/freebsd-src/blob/HEAD/Makefile? let arch = freebsd_arch(target); for path in ["sys"] { @@ -658,6 +694,7 @@ fn install_headers(target: &TargetSpec, src_dir: &Utf8Path) -> Result<()> { )?; } openbsd => { + src_dir = clone(download_dir, "openbsd/src", &["/include/", "/sys/"])?; // TODO: use https://github.com/openbsd/src/blob/HEAD/Makefile? let arch = openbsd_arch(target); for path in ["sys", "uvm"] { @@ -668,10 +705,36 @@ fn install_headers(target: &TargetSpec, src_dir: &Utf8Path) -> Result<()> { src_dir.join("include/machine"), )?; } - fuchsia => {} - _ => {} + fuchsia => { + src_dir = clone(download_dir, "https://fuchsia.googlesource.com/fuchsia", &[])?; + fs::write(src_dir.join("zircon/kernel/lib/libc/include/stdbool.h"), "")?; + fs::write( + src_dir.join("zircon/kernel/lib/libc/include/stddef.h"), + "#define size_t unsigned long", + )?; + } + _ => todo!("{target:?}"), } - Ok(()) + Ok(src_dir) +} + +fn linux_headers_dir(target: &TargetSpec, src_dir: &Utf8Path) -> Utf8PathBuf { + src_dir.join("../..").join("headers").join("linux").join(linux_arch(target)) +} +fn glibc_dir(src_dir: &Utf8Path) -> Utf8PathBuf { + src_dir.join("../..").join(GLIBC_REPO) +} +fn libc_headers_dir(target: &TargetSpec, src_dir: &Utf8Path) -> Utf8PathBuf { + assert_eq!(target.os, linux); + let (lib, arch) = match target.env { + musl => ("musl", musl_arch(target)), + uclibc => ("uclibc", uclibc_arch(target)), + _ => todo!("{target:?}"), + }; + src_dir.join("../..").join("headers").join(lib).join(arch) +} +fn bionic_dir(src_dir: &Utf8Path) -> Utf8PathBuf { + src_dir.join("../..").join(BIONIC_REPO) } fn linux_arch(target: &TargetSpec) -> &'static str { @@ -693,6 +756,14 @@ fn linux_arch(target: &TargetSpec) -> &'static str { _ => todo!("{target:?}"), } } +fn glibc_arch(target: &TargetSpec) -> &'static str { + // https://github.com/bminor/glibc/tree/HEAD/sysdeps + match target.arch { + aarch64 => "aarch64", + powerpc64 => "powerpc/powerpc64", + _ => todo!("{target:?}"), + } +} fn musl_arch(target: &TargetSpec) -> &'static str { // https://github.com/bminor/musl/tree/HEAD/arch match target.arch { @@ -712,19 +783,36 @@ fn musl_arch(target: &TargetSpec) -> &'static str { _ => todo!("{target:?}"), } } +fn uclibc_arch(target: &TargetSpec) -> &'static str { + // https://github.com/wbx-github/uclibc-ng/tree/HEAD/libc/sysdeps/linux + match target.arch { + aarch64 => "aarch64", + arm => "arm", + riscv64 => "riscv64", + _ => todo!("{target:?}"), + } +} fn freebsd_arch(target: &TargetSpec) -> &'static str { // https://github.com/freebsd/freebsd-src/tree/HEAD/sys match target.arch { + x86_64 => "amd64", + arm => "arm", aarch64 => "arm64", + x86 => "i386", powerpc | powerpc64 => "powerpc", + riscv64 => "riscv", _ => todo!("{target:?}"), } } fn openbsd_arch(target: &TargetSpec) -> &'static str { // https://github.com/openbsd/src/tree/HEAD/sys/arch match target.arch { + x86_64 => "amd64", aarch64 => "arm64", + x86 => "i386", powerpc64 => "powerpc64", + riscv64 => "riscv64", + sparc64 => "sparc64", _ => todo!("{target:?}"), } }