GH-50862: [C++][Gandiva] Fix Gandiva tests on riscv64 with an LLVM JIT relocation error - #50799
Merged
Conversation
uros-b
approved these changes
Aug 10, 2026
Member
|
LGTM |
Contributor
Author
|
@kou Could you please help merging this one too please? |
Member
|
Could you open an issue for this instead of using MINOR? |
|
|
kou
approved these changes
Aug 14, 2026
Comment on lines
+143
to
+145
| #if defined(__riscv) | ||
| jtmb.setRelocationModel(llvm::Reloc::PIC_); | ||
| #endif |
Member
There was a problem hiding this comment.
Can we always enable this? (Is it safe that we enable this on non-riscv64?)
Contributor
Author
There was a problem hiding this comment.
The other archs are defaulting to llvm::Reloc::Static , so that change needs to be carefully tested.
Contributor
Author
There was a problem hiding this comment.
Reloc::PIC_ was actually the default and #49063 changed it to Reloc::Static as a side effect.
So it looks safe to drop the riscv guard.
kou
reviewed
Aug 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rationale for this change
On riscv64, Gandiva fails at runtime with:
What changes are included in this PR?
I set the PIC relocation model on the JIT TargetMachine manually to restore pre #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.