Skip to content

Enable GNU ar tool selection on MacOS - #2774

Merged
nickclark2016 merged 1 commit into
premake:masterfrom
theComputeKid:macos
Aug 19, 2026
Merged

Enable GNU ar tool selection on MacOS#2774
nickclark2016 merged 1 commit into
premake:masterfrom
theComputeKid:macos

Conversation

@theComputeKid

@theComputeKid theComputeKid commented Aug 17, 2026

Copy link
Copy Markdown
Contributor
  • select gcc-ar rather than Apple ar (which is neither llvm or gnu).
  • there is no point using "gcc" as a toolset on macos as it symlinks to clang, and changing that symlink to actual GNU is dangerous. Premake treats "gcc" as a GNU toolchain and passes GNU flags, which may not apply to apple clang.
  • probably macos users have added gcc-N to path and that is what they mean when they explicitly specify --cc=gcc-N (e.g. gcc-16). This is what homebrew does. In which case, this change is reflective of the actual intentions of the user to use the real GNU toolchain.

I am not sure what to do. Making this change means that it might break compilation for users who rely on this behaviour:

$ gcc --version  
Apple clang version 21.0.0 (clang-2100.1.1.101)
Target: arm64-apple-darwin25.5.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

Fixes #2773

- select gcc-ar rather than Apple ar (which is neither llvm or gnu).
- there is no point using "gcc" as a toolset on macos as it symlinks to clang, and changing that symlink is dangerous
- probably macos users have added gcc-N to path and that is what they mean when they explicitly specify --cc=gcc-N (e.g. gcc-16).
@nickclark2016
nickclark2016 merged commit 8b98365 into premake:master Aug 19, 2026
246 of 249 checks passed
@theComputeKid
theComputeKid deleted the macos branch August 19, 2026 13:13
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.

MacOS Homebrew GCC needs gcc-ar rather than ar

3 participants