Skip to content

Commit

Permalink
Fix build on riscv64gc-unknown-linux-gnu (gnzlbg#40)
Browse files Browse the repository at this point in the history
This works around the mismatch between the GNU target and rustc target.

Fixes gnzlbg#36

Signed-off-by: Amanieu d'Antras <[email protected]>
  • Loading branch information
Amanieu authored Sep 29, 2022
1 parent 7513625 commit 4e682e9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions jemalloc-ctl/src/keys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ use crate::{fmt, ops, raw};

/// A `Name` in the _MALLCTL NAMESPACE_.
#[repr(transparent)]
#[derive(PartialEq)]
#[derive(PartialEq, Eq)]
pub struct Name([u8]);

/// Converts a null-terminated byte-string into a [`Name`].
Expand Down Expand Up @@ -132,12 +132,12 @@ impl fmt::Display for Name {

/// Management Information Base of a non-string value.
#[repr(transparent)]
#[derive(Copy, Clone, PartialEq, Debug, Default)]
#[derive(Copy, Clone, PartialEq, Eq, Debug, Default)]
pub struct Mib<T: MibArg>(T);

/// Management Information Base of a string value.
#[repr(transparent)]
#[derive(Copy, Clone, PartialEq, Debug, Default)]
#[derive(Copy, Clone, PartialEq, Eq, Debug, Default)]
pub struct MibStr<T: MibArg>(T);

impl<T: MibArg> AsRef<[usize]> for Mib<T> {
Expand Down
10 changes: 5 additions & 5 deletions jemalloc-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,10 @@ fn main() {
}

if let Ok(malloc_conf_opts) = read_and_watch_env("JEMALLOC_SYS_WITH_MALLOC_CONF") {
malloc_conf += &format!(
"{}{}",
if malloc_conf.is_empty() { "" } else { "," },
malloc_conf_opts
);
if !malloc_conf.is_empty() {
malloc_conf.push(',');
}
malloc_conf.push_str(&malloc_conf_opts);
}

if !malloc_conf.is_empty() {
Expand Down Expand Up @@ -343,6 +342,7 @@ fn gnu_target(target: &str) -> String {
"i686-pc-windows-gnu" => "i686-w64-mingw32".to_string(),
"x86_64-pc-windows-gnu" => "x86_64-w64-mingw32".to_string(),
"armv7-linux-androideabi" => "arm-linux-androideabi".to_string(),
"riscv64gc-unknown-linux-gnu" => "riscv64-linux-gnu".to_string(),
s => s.to_string(),
}
}
Expand Down

0 comments on commit 4e682e9

Please sign in to comment.