Fix build with latest Swift toolchain snapshot#157
Merged
Conversation
32f3ef9 to
49ffc86
Compare
6c67b59 to
1c9ee19
Compare
- Update .swift-version to main-snapshot-2026-01-09 - Add C standard library shim headers to CPlaydate to avoid ARM newlib module conflicts with _DarwinFoundation on macOS 16+ - Remove ARM toolchain/sysroot include paths from Package.swift since shims now provide the required declarations - Add newlib syscall stubs and posix_memalign to setup.c for the new toolchain's linker requirements - Move posix_memalign from Swift to C for proper linking - Add TARGET_PLAYDATE=1 to toolset_device.json for conditional compilation - Fix Xkpd CLodePNG/CQRCode build with minimal shim headers - Fix qrcode_getModule Bool return type usage in Comic.swift
1c9ee19 to
87ed590
Compare
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.
Summary
.swift-versiontomain-snapshot-2026-01-09Package.swiftinto the PDC plugin's device build, so they only apply during ARM cross-compilation and don't conflict with_DarwinFoundationmodules on macOS 16+pd_rand/pd_srandC wrappers — macOS 16 marksrand()/srand()as__swift_unavailablein Swift, but they're still callable from Cposix_memalignfrom Swift to C insetup.c— the new toolchain'sswift_allocObjectcalls it, but the Swift@_cdeclversion was being dead-stripped by the whole-module optimizerswift_coroFrameAllocstub required by the new runtime_getentropy,_kill,_getpid,_close,_lseek,_read,_write,_fstat,_isatty) required by the linker-DTARGET_PLAYDATE=1to the device toolset to match the SDK'scommon.mksetup.cto usemalloc/realloc/freeinstead of directly referencingpdreallocfunction pointer (undefined behavior —pdreallocis a function pointer, not a function)string.h(shadows system header, needs the declarations)armSysrootPathandimport Foundationfrom XkpdPackage.swiftmacos-26to CI matrix, fix Xkpd artifact name collision across matrix entriesTest plan