Changeset View
Changeset View
Standalone View
Standalone View
sysutils/hexyl/files/patch-riscv64
- This file was added.
--- cargo-crates/libc-0.2.98/build.rs.orig 2021-10-18 11:05:54 UTC | |||||
+++ cargo-crates/libc-0.2.98/build.rs | |||||
@@ -24,14 +24,19 @@ fn main() { | |||||
// | |||||
// On CI, we detect the actual FreeBSD version and match its ABI exactly, | |||||
// running tests to ensure that the ABI is correct. | |||||
- match which_freebsd() { | |||||
- Some(10) if libc_ci || rustc_dep_of_std => { | |||||
- println!("cargo:rustc-cfg=freebsd10") | |||||
+ let target = env::var("TARGET").expect("TARGET was not set"); | |||||
+ if target == "riscv64gc-unknown-freebsd" { | |||||
+ println!("cargo:rustc-cfg=freebsd13") | |||||
+ } else { | |||||
+ match which_freebsd() { | |||||
+ Some(10) if libc_ci || rustc_dep_of_std => { | |||||
+ println!("cargo:rustc-cfg=freebsd10") | |||||
+ } | |||||
+ Some(11) if libc_ci => println!("cargo:rustc-cfg=freebsd11"), | |||||
+ Some(12) if libc_ci => println!("cargo:rustc-cfg=freebsd12"), | |||||
+ Some(13) if libc_ci => println!("cargo:rustc-cfg=freebsd13"), | |||||
+ Some(_) | None => println!("cargo:rustc-cfg=freebsd11"), | |||||
} | |||||
- Some(11) if libc_ci => println!("cargo:rustc-cfg=freebsd11"), | |||||
- Some(12) if libc_ci => println!("cargo:rustc-cfg=freebsd12"), | |||||
- Some(13) if libc_ci => println!("cargo:rustc-cfg=freebsd13"), | |||||
- Some(_) | None => println!("cargo:rustc-cfg=freebsd11"), | |||||
} | |||||
// On CI: deny all warnings | |||||
--- cargo-crates/libc-0.2.98/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs.orig 2021-11-05 13:43:34 UTC | |||||
+++ cargo-crates/libc-0.2.98/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs | |||||
@@ -240,7 +240,8 @@ extern "C" { | |||||
cfg_if! { | |||||
if #[cfg(any(target_arch = "x86_64", | |||||
- target_arch = "aarch64"))] { | |||||
+ target_arch = "aarch64", | |||||
+ target_arch = "riscv64"))] { | |||||
mod b64; | |||||
pub use self::b64::*; | |||||
} | |||||
--- cargo-crates/libc-0.2.98/src/unix/bsd/freebsdlike/freebsd/mod.rs.orig 2021-11-04 11:37:21 UTC | |||||
+++ cargo-crates/libc-0.2.98/src/unix/bsd/freebsdlike/freebsd/mod.rs | |||||
@@ -1749,6 +1749,9 @@ cfg_if! { | |||||
} else if #[cfg(target_arch = "powerpc")] { | |||||
mod powerpc; | |||||
pub use self::powerpc::*; | |||||
+ } else if #[cfg(target_arch = "riscv64")] { | |||||
+ mod riscv64; | |||||
+ pub use self::riscv64::*; | |||||
} else { | |||||
// Unknown target_arch | |||||
} | |||||
--- cargo-crates/libc-0.2.98/src/unix/bsd/freebsdlike/freebsd/riscv64.rs.orig 2021-11-05 13:41:21 UTC | |||||
+++ cargo-crates/libc-0.2.98/src/unix/bsd/freebsdlike/freebsd/riscv64.rs | |||||
@@ -0,0 +1,21 @@ | |||||
+pub type c_char = u8; | |||||
+pub type c_long = i64; | |||||
+pub type c_ulong = u64; | |||||
+pub type wchar_t = ::c_int; | |||||
+pub type time_t = i64; | |||||
+pub type suseconds_t = ::c_long; | |||||
+pub type register_t = i64; | |||||
+ | |||||
+// should be pub(crate), but that requires Rust 1.18.0 | |||||
+cfg_if! { | |||||
+ if #[cfg(libc_const_size_of)] { | |||||
+ #[doc(hidden)] | |||||
+ pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_longlong>() - 1; | |||||
+ } else { | |||||
+ #[doc(hidden)] | |||||
+ pub const _ALIGNBYTES: usize = 8 - 1; | |||||
+ } | |||||
+} | |||||
+ | |||||
+pub const MAP_32BIT: ::c_int = 0x00080000; | |||||
+pub const MINSIGSTKSZ: ::size_t = 4096; // 1024 * 4 |