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 <amanieu@gmail.com>
This commit is contained in:
Amanieu d'Antras 2022-09-29 08:25:17 +01:00 committed by GitHub
parent 7513625f24
commit 4e682e9243
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 8 deletions

View File

@ -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: 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> {

View File

@ -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(),
}
}