Skip to content

llvm: expose target ABI name option - #2

Merged
cpunion merged 1 commit into
llvm-corofrom
coro/target-abi-name
Jul 15, 2026
Merged

llvm: expose target ABI name option#2
cpunion merged 1 commit into
llvm-corofrom
coro/target-abi-name

Conversation

@cpunion

@cpunion cpunion commented Jul 15, 2026

Copy link
Copy Markdown
Owner

Summary

  • add ABIName to TargetMachineOptions and apply it before target-machine construction
  • use the official target-machine options C API on LLVM 18+, with an equivalent LLVM 14-17 compatibility shim
  • verify RISC-V lp64 versus lp64d through emitted ELF flags and floating-point calling convention

Motivation

LLGo target resolution carries an explicit target ABI. Applying it at target-machine construction avoids guessing LLVM backend defaults and is required for correct calling conventions and object metadata.

Validation

  • full tests: default LLVM 19 and tagged LLVM 14, 18, 19, 20
  • modern API path also exercised with local LLVM 22; PR CI covers real LLVM 21
  • go vet, gofmt, clang-format, and diff check

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds support for specifying the target ABI name (ABIName) when creating a target machine, updating both the Go API and the underlying C++ bindings to handle this across different LLVM versions (including LLVM 18+ and legacy versions). Feedback suggests initializing the JIT boolean variable to false in TargetBindings.cpp to prevent issues with uninitialized variables, and using t.Skipf instead of t.Fatal in the RISC-V test to gracefully handle environments where the RISC-V backend is not installed.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread target_test.go
Comment thread TargetBindings.cpp Outdated
@cpunion
cpunion force-pushed the coro/target-abi-name branch from 5328d84 to 4f46e28 Compare July 15, 2026 16:05
@cpunion
cpunion merged commit b20c3fb into llvm-coro Jul 15, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant