Repository navigation
Conversation
…p10 libcall is available An incorrect target machine setting leads to an undefined function reference in LLVM resulting in a crash. LLVM's default host triple names the OS "darwin", but LLVM only enables macOS libcalls (e.g. __exp10 for llvm.exp10) for the "macosx" OS. Fix the naming of the target machine.
|
|
victor6567758
approved these changes
Nov 11, 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
An incorrect target machine setting leads to an undefined function reference in LLVM resulting in a crash for MacOS.
Gandiva builds its JIT target machine from llvm::sys::getDefaultTargetTriple(), which on macOS is an unversioned/kernel-versioned arm64-apple-darwin. LLVM only enables macOS libcalls such as __exp10 for the macosx OS name. With optimization off, pow(10, x) (used by get_scale_multiplier for scales outside 0..19) is
lowered to llvm.exp10, and the backend finds no libcall for it.
What changes are included in this PR?
Changes to the target machine configuration on Mac. Unit test.
Are these changes tested?
Yes manual with a repro and unit test.
Are there any user-facing changes?
No.
This PR contains a "Critical Fix". Fixes a potential crash on MacOs when optimization is disabled for llvm.
Was AI used for this PR?
PR code and description written by:
Reviewed before submission by: