Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
snogge committed Apr 30, 2024
1 parent c72519b commit fe05591
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
15 changes: 11 additions & 4 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,40 +208,47 @@ fn is_gnu_time64_abi() -> bool {
match env::var("CARGO_CFG_TARGET_ENV") {
Ok(target_env) => {
if target_env != "gnu" {
return false;
panic!("Not GNU");
//return false;
}
}
Err(_) => panic!("CARGO_CFG_TARGET_ENV not set"),
}
match env::var("CARGO_CFG_TARGET_OS") {
Ok(target_os) => {
if target_os != "linux" {
return false;
panic!("Not linux");
//return false;
}
}
Err(_) => panic!("CARGO_CFG_TARGET_OS not set"),
}
match env::var("CARGO_CFG_TARGET_POINTER_WIDTH") {
Ok(bits) => {
if bits == "64" {
return false;
panic!("Not 32 bit pointers");
//return false;
}
}
Err(_) => panic!("CARGO_CFG_TARGET_POINTER_WIDTH not set"),
}
match env::var("RUST_LIBC_TIME_BITS") {
Ok(time_bits) => {
if time_bits == "64" {
//panic!("time bits 64");
return true;
}
if time_bits == "32" {
//panic!("time bits 32");
return false;
}
if time_bits != "default" {
panic!("Invalid value for RUST_LIBC_TIME_BITS");
}
}
Err(_) => {}
Err(_) => {
panic!("shouldn't happen");
}
}
// At this point, we _know_ it is *-*-linux-gnu* with 32 bit
// pointers. Some 64 bit arch still have 32 bit pointers though.
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,5 +126,6 @@ cfg_if! {
pub use xous::*;
} else {
// non-supported targets: empty...
panic!("non-supported targets: empty...");
}
}
3 changes: 3 additions & 0 deletions src/unix/linux_like/linux/gnu/b32/time64.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
//! 32-bit specific definitions for linux-like values when gnu_time64_abi is set

s! {
pub struct stat {
pub st_rdev: ::dev_t,
}
pub struct timex {
pub modes: ::c_uint,

Expand Down
4 changes: 2 additions & 2 deletions src/unix/linux_like/linux/gnu/b32/x86/time64.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use stat;
pub type stat64 = stat;
// use stat;
// pub type stat64 = stat;

s! {
pub struct statfs64 {
Expand Down

0 comments on commit fe05591

Please sign in to comment.