Skip to content

Commit 4e682e9

Browse files
authored
Fix build on riscv64gc-unknown-linux-gnu (gnzlbg#40)
This works around the mismatch between the GNU target and rustc target. Fixes gnzlbg#36 Signed-off-by: Amanieu d'Antras <amanieu@gmail.com>
1 parent 7513625 commit 4e682e9

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

jemalloc-ctl/src/keys.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ use crate::{fmt, ops, raw};
3131

3232
/// A `Name` in the _MALLCTL NAMESPACE_.
3333
#[repr(transparent)]
34-
#[derive(PartialEq)]
34+
#[derive(PartialEq, Eq)]
3535
pub struct Name([u8]);
3636

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

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

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

143143
impl<T: MibArg> AsRef<[usize]> for Mib<T> {

jemalloc-sys/build.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -188,11 +188,10 @@ fn main() {
188188
}
189189

190190
if let Ok(malloc_conf_opts) = read_and_watch_env("JEMALLOC_SYS_WITH_MALLOC_CONF") {
191-
malloc_conf += &format!(
192-
"{}{}",
193-
if malloc_conf.is_empty() { "" } else { "," },
194-
malloc_conf_opts
195-
);
191+
if !malloc_conf.is_empty() {
192+
malloc_conf.push(',');
193+
}
194+
malloc_conf.push_str(&malloc_conf_opts);
196195
}
197196

198197
if !malloc_conf.is_empty() {
@@ -343,6 +342,7 @@ fn gnu_target(target: &str) -> String {
343342
"i686-pc-windows-gnu" => "i686-w64-mingw32".to_string(),
344343
"x86_64-pc-windows-gnu" => "x86_64-w64-mingw32".to_string(),
345344
"armv7-linux-androideabi" => "arm-linux-androideabi".to_string(),
345+
"riscv64gc-unknown-linux-gnu" => "riscv64-linux-gnu".to_string(),
346346
s => s.to_string(),
347347
}
348348
}

0 commit comments

Comments
 (0)