From aac2ab4c83a582a77c8f4838dfec46f64f4e7c68 Mon Sep 17 00:00:00 2001 From: Bendik Aagaard Lynghaug Date: Sat, 8 Aug 2026 22:57:31 +0200 Subject: [PATCH] build: disable crt-static for musl targets Alpine has no libxkbcommon.a, so static linking fails at ld. --- .cargo/config.toml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .cargo/config.toml diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 0000000..4df4b19 --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,11 @@ +# Alpine/musl hosts: rustup's *-linux-musl targets default to crt-static, which +# tries to statically link system libraries as well. Alpine ships libxkbcommon.so +# but no libxkbcommon.a, so the final link fails with: +# ld: cannot find -lxkbcommon +# ld: have you installed the static version of the xkbcommon library ? +# Link dynamically instead, which is what a binary running on the host wants. +[target.aarch64-unknown-linux-musl] +rustflags = ["-C", "target-feature=-crt-static"] + +[target.x86_64-unknown-linux-musl] +rustflags = ["-C", "target-feature=-crt-static"]