From 82a94ef3774874872e68c834e7fe09b2617c480c Mon Sep 17 00:00:00 2001 From: Felix Yan Date: Thu, 9 Sep 2021 22:57:54 +0300 Subject: [PATCH] Add riscv64 support Signed-off-by: Felix Yan --- benches/roundtrip.rs | 1 + jemalloc-sys/build.rs | 3 +++ src/lib.rs | 1 + 3 files changed, 5 insertions(+) diff --git a/benches/roundtrip.rs b/benches/roundtrip.rs index 6dfa36226c..767abe8d4f 100644 --- a/benches/roundtrip.rs +++ b/benches/roundtrip.rs @@ -32,6 +32,7 @@ const MIN_ALIGN: usize = 8; target_arch = "powerpc64", target_arch = "powerpc64le", target_arch = "mips64", + target_arch = "riscv64", target_arch = "s390x", target_arch = "sparc64" )))] diff --git a/jemalloc-sys/build.rs b/jemalloc-sys/build.rs index 95d143784a..a4c244cefe 100644 --- a/jemalloc-sys/build.rs +++ b/jemalloc-sys/build.rs @@ -309,6 +309,9 @@ fn main() { } else if !target.contains("windows") { println!("cargo:rustc-link-lib=pthread"); } + if target.contains("riscv") { + println!("cargo:rustc-link-lib=atomic"); + } println!("cargo:rerun-if-changed=jemalloc"); } diff --git a/src/lib.rs b/src/lib.rs index 5c53285c95..bea6cafc52 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -54,6 +54,7 @@ const ALIGNOF_MAX_ALIGN_T: usize = 8; target_arch = "powerpc64", target_arch = "powerpc64le", target_arch = "mips64", + target_arch = "riscv64", target_arch = "s390x", target_arch = "sparc64" )))]