From 4e682e9243b0f8d9e4589bfbc7523b113994184e Mon Sep 17 00:00:00 2001 From: Amanieu d'Antras Date: Thu, 29 Sep 2022 08:25:17 +0100 Subject: [PATCH] Fix build on riscv64gc-unknown-linux-gnu (#40) This works around the mismatch between the GNU target and rustc target. Fixes #36 Signed-off-by: Amanieu d'Antras --- jemalloc-ctl/src/keys.rs | 6 +++--- jemalloc-sys/build.rs | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/jemalloc-ctl/src/keys.rs b/jemalloc-ctl/src/keys.rs index 9b753e242c..2a84a4670d 100644 --- a/jemalloc-ctl/src/keys.rs +++ b/jemalloc-ctl/src/keys.rs @@ -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`]. @@ -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); /// 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); impl AsRef<[usize]> for Mib { diff --git a/jemalloc-sys/build.rs b/jemalloc-sys/build.rs index 92382ec67d..d8495a8c2b 100644 --- a/jemalloc-sys/build.rs +++ b/jemalloc-sys/build.rs @@ -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() { @@ -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(), } }