You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "domibel (via GitHub)" <gi...@apache.org> on 2026/08/04 03:22:12 UTC
[PR] MINOR: [C++][Gandiva] Fix Gandiva tests on riscv64 with an LLVM JIT relocation error [arrow]
domibel opened a new pull request, #50799:
URL: https://github.com/apache/arrow/pull/50799
### Rationale for this change
On riscv64, Gandiva fails at runtime with:
` JIT session error: relocation target ... is out of range of R_RISCV_HI20 fixup ...
`
### What changes are included in this PR?
I set the PIC relocation model on the JIT TargetMachine for RISC-V manually to restore pre https://github.com/apache/arrow/pull/49063 behavior. LLJIT normally sets Reloc::PIC_ for JITLink targets in prepareForConstruction, but #49063 builds the object-cache TargetMachine before that runs, so it gets the target-default (Static) model.
### Are these changes tested?
Yes, by the existing Gandiva tests, on riscv64 hardware.
### Are there any user-facing changes?
No public API changes. Gandiva expression evaluation now works on riscv64.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-50862: [C++][Gandiva] Fix Gandiva tests on riscv64 with an LLVM JIT relocation error [arrow]
Posted by "kou (via GitHub)" <gi...@apache.org>.
kou commented on code in PR #50799:
URL: https://github.com/apache/arrow/pull/50799#discussion_r3780943559
##########
cpp/src/gandiva/engine.cc:
##########
@@ -140,6 +140,9 @@ Result<llvm::orc::JITTargetMachineBuilder> MakeTargetMachineBuilder(
const Configuration& conf) {
llvm::orc::JITTargetMachineBuilder jtmb(
(llvm::Triple(llvm::sys::getDefaultTargetTriple())));
+#if defined(__riscv)
+ jtmb.setRelocationModel(llvm::Reloc::PIC_);
+#endif
Review Comment:
Can we always enable this? (Is it safe that we enable this on non-riscv64?)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-50862: [C++][Gandiva] Fix Gandiva tests on riscv64 with an LLVM JIT relocation error [arrow]
Posted by "domibel (via GitHub)" <gi...@apache.org>.
domibel commented on code in PR #50799:
URL: https://github.com/apache/arrow/pull/50799#discussion_r3781116457
##########
cpp/src/gandiva/engine.cc:
##########
@@ -140,6 +140,9 @@ Result<llvm::orc::JITTargetMachineBuilder> MakeTargetMachineBuilder(
const Configuration& conf) {
llvm::orc::JITTargetMachineBuilder jtmb(
(llvm::Triple(llvm::sys::getDefaultTargetTriple())));
+#if defined(__riscv)
+ jtmb.setRelocationModel(llvm::Reloc::PIC_);
+#endif
Review Comment:
The other archs are defaulting to llvm::Reloc::Static , so that change needs to be carefully tested.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] MINOR: [C++][Gandiva] Fix Gandiva tests on riscv64 with an LLVM JIT relocation error [arrow]
Posted by "domibel (via GitHub)" <gi...@apache.org>.
domibel commented on PR #50799:
URL: https://github.com/apache/arrow/pull/50799#issuecomment-5288684247
@kou Could you please help merging this one too please?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-50862: [C++][Gandiva] Fix Gandiva tests on riscv64 with an LLVM JIT relocation error [arrow]
Posted by "kou (via GitHub)" <gi...@apache.org>.
kou commented on code in PR #50799:
URL: https://github.com/apache/arrow/pull/50799#discussion_r3788878512
##########
cpp/src/gandiva/engine.cc:
##########
@@ -140,6 +140,9 @@ Result<llvm::orc::JITTargetMachineBuilder> MakeTargetMachineBuilder(
const Configuration& conf) {
llvm::orc::JITTargetMachineBuilder jtmb(
(llvm::Triple(llvm::sys::getDefaultTargetTriple())));
+#if defined(__riscv)
+ jtmb.setRelocationModel(llvm::Reloc::PIC_);
+#endif
Review Comment:
```suggestion
jtmb.setRelocationModel(llvm::Reloc::PIC_);
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-50862: [C++][Gandiva] Fix Gandiva tests on riscv64 with an LLVM JIT relocation error [arrow]
Posted by "domibel (via GitHub)" <gi...@apache.org>.
domibel commented on code in PR #50799:
URL: https://github.com/apache/arrow/pull/50799#discussion_r3789811916
##########
cpp/src/gandiva/engine.cc:
##########
@@ -140,6 +140,9 @@ Result<llvm::orc::JITTargetMachineBuilder> MakeTargetMachineBuilder(
const Configuration& conf) {
llvm::orc::JITTargetMachineBuilder jtmb(
(llvm::Triple(llvm::sys::getDefaultTargetTriple())));
+#if defined(__riscv)
+ jtmb.setRelocationModel(llvm::Reloc::PIC_);
+#endif
Review Comment:
Reloc::PIC_ was actually the default and #49063 changed it to Reloc::Static as a side effect.
https://github.com/llvm/llvm-project/blob/release/21.x/llvm/lib/ExecutionEngine/Orc/LLJIT.cpp#L801-L839
So it looks safe to drop the riscv guard.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-50862: [C++][Gandiva] Fix Gandiva tests on riscv64 with an LLVM JIT relocation error [arrow]
Posted by "kou (via GitHub)" <gi...@apache.org>.
kou merged PR #50799:
URL: https://github.com/apache/arrow/pull/50799
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] MINOR: [C++][Gandiva] Fix Gandiva tests on riscv64 with an LLVM JIT relocation error [arrow]
Posted by "uros-b (via GitHub)" <gi...@apache.org>.
uros-b commented on PR #50799:
URL: https://github.com/apache/arrow/pull/50799#issuecomment-5244442793
LGTM
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-50862: [C++][Gandiva] Fix Gandiva tests on riscv64 with an LLVM JIT relocation error [arrow]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #50799:
URL: https://github.com/apache/arrow/pull/50799#issuecomment-5288916191
:warning: GitHub issue #50862 **has been automatically assigned in GitHub** to PR creator.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-50862: [C++][Gandiva] Fix Gandiva tests on riscv64 with an LLVM JIT relocation error [arrow]
Posted by "kou (via GitHub)" <gi...@apache.org>.
kou commented on code in PR #50799:
URL: https://github.com/apache/arrow/pull/50799#discussion_r3787430536
##########
cpp/src/gandiva/engine.cc:
##########
@@ -140,6 +140,9 @@ Result<llvm::orc::JITTargetMachineBuilder> MakeTargetMachineBuilder(
const Configuration& conf) {
llvm::orc::JITTargetMachineBuilder jtmb(
(llvm::Triple(llvm::sys::getDefaultTargetTriple())));
+#if defined(__riscv)
+ jtmb.setRelocationModel(llvm::Reloc::PIC_);
+#endif
Review Comment:
Let's try in our CI.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-50862: [C++][Gandiva] Fix Gandiva tests on riscv64 with an LLVM JIT relocation error [arrow]
Posted by "conbench-apache-arrow[bot] (via GitHub)" <gi...@apache.org>.
conbench-apache-arrow[bot] commented on PR #50799:
URL: https://github.com/apache/arrow/pull/50799#issuecomment-5305704196
After merging your PR, Conbench analyzed the 3 benchmarking runs that have been run so far on merge-commit f64e90ac8305c2cab5abd849f02abac305d7a955.
There were no benchmark performance regressions. 🎉
The [full Conbench report](https://github.com/apache/arrow/runs/95114887450) has more details. It also includes information about 6 possible false positives for unstable benchmarks that are known to sometimes produce them.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] MINOR: [C++][Gandiva] Fix Gandiva tests on riscv64 with an LLVM JIT relocation error [arrow]
Posted by "kou (via GitHub)" <gi...@apache.org>.
kou commented on PR #50799:
URL: https://github.com/apache/arrow/pull/50799#issuecomment-5288804803
Could you open an issue for this instead of using MINOR?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org