Skip to content

Commit

Permalink
Rollup merge of #76798 - alistair23:alistair/rv32-linux, r=jyn514
Browse files Browse the repository at this point in the history
Build fixes for RISC-V 32-bit Linux support

This fixes build issues with the 32-bit RISC-V port.
  • Loading branch information
RalfJung committed Sep 19, 2020
2 parents 404cce0 + 3d1b6d6 commit b4c3f40
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion library/panic_unwind/src/gcc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ const UNWIND_DATA_REG: (i32, i32) = (24, 25); // I0, I1
#[cfg(target_arch = "hexagon")]
const UNWIND_DATA_REG: (i32, i32) = (0, 1); // R0, R1

#[cfg(target_arch = "riscv64")]
#[cfg(any(target_arch = "riscv64", target_arch = "riscv32"))]
const UNWIND_DATA_REG: (i32, i32) = (10, 11); // x10, x11

// The following code is based on GCC's C and C++ personality routines. For reference, see:
Expand Down
3 changes: 2 additions & 1 deletion library/std/src/os/linux/raw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,8 @@ mod arch {
target_arch = "mips64",
target_arch = "s390x",
target_arch = "sparc64",
target_arch = "riscv64"
target_arch = "riscv64",
target_arch = "riscv32"
))]
mod arch {
pub use libc::{blkcnt_t, blksize_t, ino_t, nlink_t, off_t, stat, time_t};
Expand Down
6 changes: 4 additions & 2 deletions library/std/src/os/raw/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ mod tests;
target_arch = "powerpc",
target_arch = "powerpc64",
target_arch = "s390x",
target_arch = "riscv64"
target_arch = "riscv64",
target_arch = "riscv32"
)
),
all(target_os = "android", any(target_arch = "aarch64", target_arch = "arm")),
Expand Down Expand Up @@ -65,7 +66,8 @@ pub type c_char = u8;
target_arch = "powerpc",
target_arch = "powerpc64",
target_arch = "s390x",
target_arch = "riscv64"
target_arch = "riscv64",
target_arch = "riscv32"
)
),
all(target_os = "android", any(target_arch = "aarch64", target_arch = "arm")),
Expand Down
3 changes: 2 additions & 1 deletion library/std/src/sys_common/alloc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ use crate::ptr;
target_arch = "powerpc64",
target_arch = "asmjs",
target_arch = "wasm32",
target_arch = "hexagon"
target_arch = "hexagon",
target_arch = "riscv32"
)))]
pub const MIN_ALIGN: usize = 8;
#[cfg(all(any(
Expand Down
2 changes: 1 addition & 1 deletion library/unwind/src/libunwind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ pub const unwinder_private_data_size: usize = 2;
#[cfg(target_arch = "sparc64")]
pub const unwinder_private_data_size: usize = 2;

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

#[cfg(target_os = "emscripten")]
Expand Down
1 change: 1 addition & 0 deletions src/tools/build-manifest/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ static TARGETS: &[&str] = &[
"riscv32i-unknown-none-elf",
"riscv32imc-unknown-none-elf",
"riscv32imac-unknown-none-elf",
"riscv32gc-unknown-linux-gnu",
"riscv64imac-unknown-none-elf",
"riscv64gc-unknown-none-elf",
"riscv64gc-unknown-linux-gnu",
Expand Down

0 comments on commit b4c3f40

Please sign in to comment.