Skip to content

GH-55505: Gandiva: normalize Darwin host triple to macosx so exp10 libcall is available - #55506

Open
lriggs wants to merge 2 commits into
apache:mainfrom
lriggs:gh-55505
Open

lriggs wants to merge 2 commits into
apache:mainfrom
lriggs:gh-55505

Conversation

@lriggs

@lriggs lriggs commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

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:

  • Human
  • AI

Reviewed before submission by:

  • Human
  • AI
  • Not reviewed

…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.
@github-actions

Copy link
Copy Markdown

⚠️ GitHub issue #55505 has been automatically assigned in GitHub to PR creator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants