Build against SDKs older than macOS 26 - #59
Open
abhas9 wants to merge 1 commit into
Open
Conversation
Two symbols used unconditionally are unavailable on SDKs earlier than macOS 26, so the build fails on a current macOS 15 toolchain. h3_ffmpeg.c uses SSIZE_MAX without including <limits.h>. It resolves only incidentally on newer SDKs; under -std=c11 on the macOS 15 SDK it is undeclared. Include the header that defines it. h3_metal.m reads MTLGPUFamilyMetal4, which the macOS 15 SDK does not declare. The existing `if (@available(macOS 26.0, *))` guard is a runtime check and cannot hide a symbol the headers never define, so compilation fails before the guard can help. Gate the block on the SDK version as well. h3_metal_probe already memsets the whole struct, so info->metal4 stays 0 when the block is compiled out, matching what the runtime guard produces on a pre-Metal 4 device. Behaviour is unchanged when building against the macOS 26 SDK. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NixTm9kQ7hojQo8nWUQGpS
abhas9
marked this pull request as ready for review
September 7, 2026 04:59
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.
makefails with the macOS 15.2 SDK because of a missing standard header and an unguarded reference to a macOS 26 SDK enum. Three added lines, no behaviour change when building against the macOS 26 SDK.The failures
1.
SSIZE_MAXundeclared -h3_ffmpeg.cThe file uses
SSIZE_MAXwithout including<limits.h>, its POSIX defining header. Compilation relies on transitive includes, which do not supply it in the tested macOS 15.2 toolchain.SSIZE_MAXitself is not a macOS 26 addition.2.
MTLGPUFamilyMetal4undeclared -h3_metal.mMTLGPUFamilyMetal4first appears in the macOS 26 SDK. The existingif (@available(macOS 26.0, *))guard is a runtime check, so it cannot hide a symbol the headers never declare.The fix
h3_ffmpeg.cincludes<limits.h>.h3_metal.mgates the probe on the SDK version in addition to the runtime check:No
#elseis needed:h3_metal_probealready doesmemset(info, 0, sizeof(*info)), soinfo->metal4stays0when the block is compiled out.This is a conservative fallback: binaries built with an older SDK report
Metal 4 noeven when subsequently run on macOS 26 with capable hardware. Builds using SDK 26 retain the existing runtime capability check.Verification
Verified at commit
91452961c0af4f1f3efa920e3d831014aca80fa9.macOS 15.2 / Command Line Tools SDK 15.2
Clean build with no errors or new warnings;
make testexits 0. Native AudioVAE Metal primitives and the FFmpeg video/PCM pipe test pass. Fixture-dependent checks skip because the required fixtures are not installed.Device inspection reports
Metal 4 no, as expected for this OS/SDK combination, not as a limitation of M4 hardware.End-to-end FL2VA generation with first-frame conditioning and
--ssd-streamingsucceeds at 576x1024.macOS 26.6.2 / Command Line Tools SDK 26.5
On Metal 4-capable Apple Silicon:
The CLI, library, and selected test binaries build without warnings. The host suite passes 1,768 checks; native AudioVAE Metal primitives and FFmpeg A/V integration also pass.
A standalone assertion harness linked to the build's actual
h3_metal.oconfirms the positive branch against Apple's direct capability query:The preprocessed
h3_metal_probefunction is identical to the base revision with SDK 26.5.SDK and deployment-target coverage
-Werrormetal4 = 0, confirming the compiled-out fallback-mmacosx-version-min=15.0-Werror -Wunguarded-availability; returnsmetal4 = 1when run on macOS 26The original Metal enum compilation failure reproduces with SDK 15.4. The original
SSIZE_MAXfailure does not reproduce with SDK 15.4; it was observed with SDK 15.2.The SDK 26 build has not been run on macOS 15. Fixture-dependent tests and end-to-end generation were not repeated on macOS 26.
Note
The change was done by claude but has been manually reviewed by me. Happy to discuss this with fellow humans if needed (without any AI use in discussion)