From 02fe9ddf08b73cb915de7cac02875a5d82bd87fc Mon Sep 17 00:00:00 2001 From: Patrick Erichsen Date: Mon, 2 Feb 2026 10:38:51 -0800 Subject: [PATCH] fix: use lld linker for macOS builds to support Sequoia (15.x) macOS 15 (Sequoia) requires the SG_READ_ONLY flag (0x10) on __DATA_CONST segments. The osxcross ld64 linker from cctools-port doesn't set this flag, causing binaries to fail with: dyld: __DATA_CONST segment missing SG_READ_ONLY flag Switch to LLVM's lld linker for darwin builds, which properly sets segment flags for modern macOS versions. --- .dagger/build.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.dagger/build.go b/.dagger/build.go index 7dbfb52..01f6861 100644 --- a/.dagger/build.go +++ b/.dagger/build.go @@ -113,7 +113,9 @@ func (t *Tapes) buildLinux(outputs *dagger.Directory, ldflags string) *dagger.Di // cross-compilers inside a Linux container. func (t *Tapes) buildDarwin(outputs *dagger.Directory, ldflags string) *dagger.Directory { cgoFlags := "-I/opt/sqlite" - cgoLdFlags := "" + // Use lld instead of osxcross's ld64 to properly set SG_READ_ONLY flag on __DATA_CONST + // segment, which is required by macOS 15 (Sequoia) and later. + cgoLdFlags := "-fuse-ld=lld" targets := []buildTarget{ {"darwin", "amd64", "o64-clang", "o64-clang++", cgoFlags, cgoLdFlags},