Skip to content

Conversation

jserv
Copy link
Contributor

@jserv jserv commented Oct 13, 2025

The original assumed that Clang always provides llvm-ar, which fails on macOS where Apple Clang is the default compiler but doesn't include llvm-ar. This causes build failures when ENABLE_EXT_F=1.

Add runtime detection using 'which llvm-ar' to check availability before using it. Falls back to system 'ar' when llvm-ar is not found, ensuring builds work correctly with both Apple Clang and Homebrew LLVM.


Summary by cubic

Fix macOS builds by detecting llvm-ar in the Makefile when ENABLE_EXT_F=1. Use llvm-ar if available; otherwise fall back to ar, so Apple Clang builds succeed and Homebrew LLVM remains supported.

Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 1 file

Prompt for AI agents (all 1 issues)

Understand the root cause of the following 1 issues and fix them.


<file name="Makefile">

<violation number="1" location="Makefile:121">
The fallback to the system `ar` when `llvm-ar` is not found can break LTO builds on non-macOS systems. When LTO is enabled with Clang (the default), `llvm-ar` is required to handle LLVM bitcode in object files. The system `ar` on platforms like Linux may not be LTO-aware, causing link-time failures when creating or using static libraries like `softfloat.a`.</violation>
</file>

React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.

The original code unconditionally used llvm-ar with Clang, causing build
failures on macOS where Apple Clang doesn't provide llvm-ar.

When LTO is enabled with Clang, llvm-ar is required to handle LLVM
bitcode in object files. System ar on Linux cannot process LLVM bitcode,
leading to link-time failures when creating static libraries like
'softfloat.a'.
Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 1 file

@sysprog21 sysprog21 deleted a comment from cubic-dev-ai bot Oct 13, 2025
@sysprog21 sysprog21 deleted a comment from cubic-dev-ai bot Oct 13, 2025
Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 1 file

@jserv jserv merged commit caae282 into master Oct 13, 2025
21 of 25 checks passed
@jserv jserv deleted the fix-llvm-ar branch October 13, 2025 17:22
@jserv jserv added this to the release-2025.2 milestone Oct 16, 2025
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