riscv: link libgcc for jemalloc's __ffsdi2 - #180
Conversation
Base rv64gc has no count-trailing-zeros instruction, so gcc lowers the ffs in bit_util.h to a __ffsdi2 libgcc call. rust's compiler_builtins ships the rest of the *di2 family but not that one, so linking a static riscv64 binary fails with undefined reference to `__ffsdi2'. Name libgcc for riscv as is already done for android, guarded on a gnu-like compiler so a clang/compiler-rt toolchain is left alone. Signed-off-by: Mathieu Poumeyrol <kali@zoy.org>
|
Welcome @kali! It looks like this is your first PR to tikv/jemallocator 🎉 |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughThe RISC-V build script now links ChangesRISC-V linker configuration
Estimated code review effort: 1 (Trivial) | ~5 minutes Merge Risk: ⚪ Minimal · up to GNU RISC-V builds now link libgcc to resolve the missing __ffsdi2 symbol for base rv64gc targets, without changing Clang/compiler-rt linkage. No current merge-blocking risk is identified. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Base rv64gc has no count-trailing-zeros instruction, so gcc lowers the ffs in bit_util.h to a __ffsdi2 libgcc call. rust's compiler_builtins ships the rest of the *di2 family but not that one, so linking a static riscv64 binary fails with undefined reference to `__ffsdi2'.
Name libgcc for riscv as is already done for android, guarded on a gnu-like compiler so a clang/compiler-rt toolchain is left alone.
Summary by CodeRabbit