Escribe para buscar…

Cross

Esta página todavía no se ha traducido — se muestra en su idioma original:English

macOS

Tell Rustup to download the standard library for Linux.

shell
rustup target add x86_64-unknown-linux-musl

macOS doesn’t come with a linker that understands Linux binaries. Use musl-cross:

shell
brew install messense/macos-cross-toolchains/x86_64-unknown-linux-musl

You need to tell Cargo to use that specific linker when building for Linux.

Verify the binary name: Run ls /opt/homebrew/bin | grep musl to see the exact filename.

It is usually x86_64-unknown-linux-musl-gcc.

Create or edit .cargo/config.toml in your project folder:

yaml
[target.x86_64-unknown-linux-musl]
linker = "x86_64-unknown-linux-musl-gcc"
shell
cargo build --target x86_64-unknown-linux-musl --release

Estás leyendo una vista previa.

Inicia sesión con Google para leer la página completa. Una cuenta de Google incluye 5 páginas gratuitas en total; el alumnado y el profesorado leen las páginas de su curso sin límite.

Iniciar sesión