Draft
Conversation
We can, so let's not ask if we should!
Rangi42
requested changes
Apr 14, 2026
| - name: Install deps | ||
| run: | | ||
| ./.github/scripts/install_deps.sh macos | ||
| brew install lld |
Contributor
There was a problem hiding this comment.
Even if this is meant as a temporary solution prior to #1906, it's still a niche enough use case that it should be clearly commented.
Suggested change
| brew install lld | |
| brew install lld # Apple's linker cannot support Mac OS X 10.4, so we use `lld` |
Comment on lines
+5
to
11
| # The `-mmacosx-version-min=10.4` flag ensures that the binary only uses APIs available on Mac OS X 10.4 Tiger. | ||
| # The `-arch` flags build a "fat binary" that works on both Apple architectures: | ||
| # older Intel x64 Macs and newer ARM "Apple Silicon" ones. | ||
| set(secret_sauce -mmacosx-version-min=10.9 "SHELL:-arch x86_64" "SHELL:-arch arm64") # Avoid `-arch` being dedup'd. | ||
| set(secret_sauce -mmacosx-version-min=10.4 "SHELL:-arch x86_64" "SHELL:-arch arm64") # Avoid `-arch` being dedup'd. | ||
| add_compile_options(${secret_sauce}) | ||
| add_link_options(${secret_sauce}) | ||
| add_link_options(${secret_sauce} -fuse-ld=lld) # Apple's linker just crashes. | ||
| set(PNG_HARDWARE_OPTIMIZATIONS OFF) # These do not play well with a dual-arch build. |
Contributor
There was a problem hiding this comment.
There's never been a problem with Apple's ld on 10.9 or above, and supporting 10.9 Mavericks from 2013 is already niche enough -- so any changes that are needed for 10.4 Tiger from 2005, over two decades ago, really ought to be explained.
Suggested change
| # The `-mmacosx-version-min=10.4` flag ensures that the binary only uses APIs available on Mac OS X 10.4 Tiger. | |
| # The `-arch` flags build a "fat binary" that works on both Apple architectures: | |
| # older Intel x64 Macs and newer ARM "Apple Silicon" ones. | |
| set(secret_sauce -mmacosx-version-min=10.9 "SHELL:-arch x86_64" "SHELL:-arch arm64") # Avoid `-arch` being dedup'd. | |
| set(secret_sauce -mmacosx-version-min=10.4 "SHELL:-arch x86_64" "SHELL:-arch arm64") # Avoid `-arch` being dedup'd. | |
| add_compile_options(${secret_sauce}) | |
| add_link_options(${secret_sauce}) | |
| add_link_options(${secret_sauce} -fuse-ld=lld) # Apple's linker just crashes. | |
| set(PNG_HARDWARE_OPTIMIZATIONS OFF) # These do not play well with a dual-arch build. | |
| # The `-mmacosx-version-min=10.4` flag ensures that the binary only uses APIs available on Mac OS X 10.4 Tiger. | |
| # The `-arch` flags build a "fat binary" that works on both Apple architectures: | |
| # older Intel x64 Macs and newer ARM "Apple Silicon" ones. | |
| set(secret_sauce -mmacosx-version-min=10.4 "SHELL:-arch x86_64" "SHELL:-arch arm64") # Avoid `-arch` being dedup'd. | |
| add_compile_options(${secret_sauce}) | |
| # The `-fuse-ld=lld` flag specifies an alternative to Apple's linker, because recent versions warn that | |
| # "support for macOS with 10.4 minimum deployment target is deprecated and will be removed in future release", | |
| # and may crash with an assertion failure. | |
| add_link_options(${secret_sauce} -fuse-ld=lld) | |
| set(PNG_HARDWARE_OPTIMIZATIONS OFF) # These do not play well with a dual-arch build. |
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.
We can, so let's not ask if we should!
Okay, so, turns out that Apple's linker just... throws an assertion failure:
So we have to use LLD instead, which needs to be installed explicitly. I'm doing it as a bodge in the initial version of this PR, as I want to use the “toolset” mechanism from #1906 to do that properly.