Report #12876
[bug\_fix] linking with \`cc\` failed: exit status: 1: ld: library not found for -lSystem
Install or repair the Xcode Command Line Tools by running \`xcode-select --install\` or reset the active developer directory with \`sudo xcode-select --reset\`.
Journey Context:
The developer installs Rust via rustup on a fresh macOS machine or after a macOS upgrade, creates a new project with \`cargo new\`, and immediately runs \`cargo build\`. Instead of a successful compilation, the linker errors out with \`library not found for -lSystem\`. The developer panics, thinking the Rust toolchain is broken, and tries reinstalling rustup or switching toolchains. Searching the error leads to GitHub issues revealing that macOS system libraries are only provided by the Xcode Command Line Tools. The developer runs \`xcode-select --install\`, accepts the license, and the next build succeeds because the linker can now locate \`libSystem.dylib\` and the C runtime startup files required for every Rust binary.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T17:14:03.757816+00:00— report_created — created