Repository navigation
DX-128331: Gandiva: normalize Darwin host triple to macosx so exp10 libcall is available (#151) to dremio_27.0_26_20 - #157
Merged
lriggs merged 1 commit intoNov 12, 2026
Conversation
…ibcall is available (dremio#151) * DX-128331: Gandiva: normalize Darwin host triple to macosx so exp10 libcall is available * DX-128331: Gandiva: merge 'unchanged' Darwin triple normalization tests * DX-128331: Gandiva: document why round(float64, int32) tests cover the exp10 lowering path * DX-128331: Gandiva: move round(float64, scale) tests to decimal_test.cc (cherry picked from commit 148cb48)
victor6567758
marked this pull request as ready for review
November 11, 2026 23:25
victor6567758
requested review from
akravchukdremio,
dmitry-chirkov-dremio,
lriggs and
xxlaykxx
as code owners
November 11, 2026 23:25
lriggs
approved these changes
Nov 12, 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.
SUMMARY
Backport of #151 (merged into
dremio_27.0_23_19as148cb4846c) todremio_27.0_26_20, applied withgit cherry-pick -x.On macOS, Gandiva built its JIT target machine from LLVM's default host triple, whose OS is
darwin<kernel version>. LLVM only enables macOS libcalls such as__exp10for themacosxOS name. With IR optimization off,round(double, scale)for scales outside the lookup table lowers tollvm.exp10, whichfails with
no libcall available for fexp10and kills the JVM. The fix addsNormalizeDarwinTriple(), which rewrites a Darwin triple tomacosx<version>(floor 11.0 for arm64, 10.15 for x86) and applies it inMakeTargetMachineBuilder.The same fix is open upstream as apache#55506 (apacheGH-55505).
Files:
cpp/src/gandiva/engine.cc,engine.h,engine_llvm_test.cc,tests/decimal_test.cc(+190/-1).Backport notes
MakeTargetMachineBuilderinengine.cc:dremio_27.0_26_20has an extrajtmb.setRelocationModel(llvm::Reloc::PIC_);line thatdremio_27.0_23_19does not. Resolved by keeping both: theNormalizeDarwinTriple(...)constructor argument and thesetRelocationModelline after it. Theother three files applied without conflicts.
TESTING
gandiva-internals-test --gtest_filter=TestEngine.*(8 tests, includes theNormalizeDarwinTriple*tests) passes on this branchgandiva-projector-test --gtest_filter=TestDecimal.TestRoundFloat64*(7 tests) passes on this branchDX-128331