Skip to content

Commit

Permalink
fix cross compilation of std
Browse files Browse the repository at this point in the history
  • Loading branch information
Jorge Aparicio committed Aug 27, 2016
1 parent 1b9e9ab commit 43615a0
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/liballoc_jemalloc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ const MIN_ALIGN: usize = 8;
#[cfg(all(any(target_arch = "x86",
target_arch = "x86_64",
target_arch = "aarch64",
target_arch = "powerpc64")))]
target_arch = "powerpc64",
target_arch = "mips64")))]
const MIN_ALIGN: usize = 16;

// MALLOCX_ALIGN(a) macro
Expand Down
3 changes: 2 additions & 1 deletion src/liballoc_system/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
target_arch = "asmjs")))]
const MIN_ALIGN: usize = 8;
#[cfg(all(any(target_arch = "x86_64",
target_arch = "aarch64")))]
target_arch = "aarch64",
target_arch = "mips64")))]
const MIN_ALIGN: usize = 16;

#[no_mangle]
Expand Down
2 changes: 1 addition & 1 deletion src/libpanic_unwind/gcc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ const UNWIND_DATA_REG: (i32, i32) = (0, 1); // RAX, RDX
#[cfg(any(target_arch = "arm", target_arch = "aarch64"))]
const UNWIND_DATA_REG: (i32, i32) = (0, 1); // R0, R1 / X0, X1

#[cfg(any(target_arch = "mips", target_arch = "mipsel"))]
#[cfg(any(target_arch = "mips", target_arch = "mipsel", target_arch = "mips64"))]
const UNWIND_DATA_REG: (i32, i32) = (4, 5); // A0, A1

#[cfg(any(target_arch = "powerpc", target_arch = "powerpc64"))]
Expand Down
6 changes: 6 additions & 0 deletions src/libstd/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,7 @@ pub mod consts {
/// - arm
/// - aarch64
/// - mips
/// - mips64
/// - powerpc
/// - powerpc64
#[stable(feature = "env", since = "1.0.0")]
Expand Down Expand Up @@ -928,6 +929,11 @@ mod arch {
pub const ARCH: &'static str = "mips";
}

#[cfg(target_arch = "mips64")]
mod arch {
pub const ARCH: &'static str = "mips64";
}

#[cfg(target_arch = "powerpc")]
mod arch {
pub const ARCH: &'static str = "powerpc";
Expand Down
5 changes: 5 additions & 0 deletions src/libstd/os/linux/raw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,11 @@ mod arch {
}
}

#[cfg(target_arch = "mips64")]
mod arch {
pub use libc::{off_t, ino_t, nlink_t, blksize_t, blkcnt_t, stat, time_t};
}

#[cfg(target_arch = "aarch64")]
mod arch {
use os::raw::{c_long, c_int};
Expand Down
3 changes: 3 additions & 0 deletions src/libunwind/libunwind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ pub const unwinder_private_data_size: usize = 2;
#[cfg(target_arch = "mips")]
pub const unwinder_private_data_size: usize = 2;

#[cfg(target_arch = "mips64")]
pub const unwinder_private_data_size: usize = 2;

#[cfg(any(target_arch = "powerpc", target_arch = "powerpc64"))]
pub const unwinder_private_data_size: usize = 2;

Expand Down

0 comments on commit 43615a0

Please sign in to comment.