Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build on riscv64gc-unknown-linux-gnu #40

Merged
merged 2 commits into from
Sep 29, 2022
Merged

Conversation

Amanieu
Copy link

@Amanieu Amanieu commented Sep 25, 2022

This works around the mismatch between the GNU target and rustc target.

Fixes #36

This works around the mismatch between the GNU target and rustc target.

Fixes tikv#36

Signed-off-by: Amanieu d'Antras <amanieu@gmail.com>
@BusyJay
Copy link
Member

BusyJay commented Sep 26, 2022

It seems there still be issues jemalloc/jemalloc#2323.

/cc @bnoctis can you verify whether this works for you?

@nc7s
Copy link

nc7s commented Sep 26, 2022

@BusyJay AFAICT this masks itself as riscv64, which is what vanilla jemalloc currently does. I don't know if there's any difference between it and riscv64gc. Upstream has a separate riscv64be, I think it's better to have a separate gc too.

@Amanieu
Copy link
Author

Amanieu commented Sep 26, 2022

The GNU toolchain prefix for RV64GC is riscv64-linux-gnu-. This is what the configure script is looking for. If you pass in riscv64gc- then it will fail to find the GCC binary.

@Amanieu
Copy link
Author

Amanieu commented Sep 26, 2022

At the very least this PR fixes the build for me when cross compiling from x86_64 to RV64.

jemalloc-sys/build.rs Outdated Show resolved Hide resolved
@@ -188,11 +188,11 @@ fn main() {
}

if let Ok(malloc_conf_opts) = read_and_watch_env("JEMALLOC_SYS_WITH_MALLOC_CONF") {
malloc_conf += &format!(
malloc_conf.push_str(&format!(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, what I mean is actually:

if !malloc_conf.is_empty() {
    malloc_conf.push(',');
}
malloc_conf.push_str(&malloc_conf_opts);

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Signed-off-by: Amanieu d'Antras <amanieu@gmail.com>
@Amanieu
Copy link
Author

Amanieu commented Sep 28, 2022

I'm not sure why CI is failing, it works fine on my machine. Can we try a re-run?

@BusyJay BusyJay merged commit 4e682e9 into tikv:main Sep 29, 2022
@BusyJay
Copy link
Member

BusyJay commented Sep 29, 2022

Thank you @Amanieu @bnoctis

@Amanieu
Copy link
Author

Amanieu commented Sep 29, 2022

Could you publish a new version with this fix? Thanks!

@BusyJay
Copy link
Member

BusyJay commented Sep 30, 2022

Published as 0.5.2

Ast-x64 added a commit to Ast-x64/archriscv-packages that referenced this pull request Nov 8, 2022
`jemalloc-sys` patch based on: tikv/jemallocator#40.
Regenerate checksums with sed after patching.
Ast-x64 added a commit to Ast-x64/archriscv-packages that referenced this pull request Nov 8, 2022
`jemalloc-sys-pick.patch` is based on:
tikv/jemallocator#40.
Regenerated checksums using `sed` after patching vendors.
Ast-x64 added a commit to Ast-x64/archriscv-packages that referenced this pull request Nov 8, 2022
`jemalloc-sys-pick.patch` is based on:
tikv/jemallocator#40.
Regenerated checksums using `sed` after patching vendors.
felixonmars pushed a commit to felixonmars/archriscv-packages that referenced this pull request Nov 8, 2022
`jemalloc-sys-pick.patch` is based on:
tikv/jemallocator#40.
Regenerated checksums using `sed` after patching vendors.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

jemalloc-sys: bundled configure fails for riscv64gc
3 participants