From 0047691ab27721fcfe898ab3340457b4e0c6219e Mon Sep 17 00:00:00 2001 From: Carlos Fernandez Date: Sat, 17 Oct 2026 16:25:45 -0700 Subject: [PATCH] Drop Corrosion's hard-coded CLT SDK link dir on macOS Corrosion adds /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib as an interface link directory of the Rust static library on macOS (still the case in Corrosion 0.6.1). Since the macos-26-arm64 runner image of 2026-10-13, that symlink points to a macOS 27 SDK while the selected toolchain is Xcode 26.6, and its ld rejects the 27 SDK's .tbd stubs ("unknown architecture"). Every macOS CMake build has failed to link since. The libraries rustc asks for (-lSystem -lc -lm) resolve through the compiler's own SDK without the extra -L, as the shell and autoconf builds on the same runner show, so clear the property. --- src/rust/CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/rust/CMakeLists.txt b/src/rust/CMakeLists.txt index 61e7482cc..35134f93f 100644 --- a/src/rust/CMakeLists.txt +++ b/src/rust/CMakeLists.txt @@ -41,6 +41,14 @@ corrosion_import_crate( FEATURES ${FEATURES} ) +# Corrosion hard-codes the Command Line Tools SDK's usr/lib as a link +# directory on macOS. When that SDK is newer than the Xcode toolchain doing +# the link (e.g. macOS 27 SDK, Xcode 26 ld), ld rejects its .tbd stubs. +# The system libraries rustc asks for resolve through the compiler's own SDK. +if(APPLE) + set_property(TARGET ccx_rust-static PROPERTY INTERFACE_LINK_DIRECTORIES "") +endif() + add_test( NAME ccx_rust_test COMMAND $ test