From 44805ef45d12a00a9169cc06232ef10277265f40 Mon Sep 17 00:00:00 2001 From: parazyd Date: Thu, 14 Dec 2023 11:52:48 +0100 Subject: [PATCH] book/dev: Document native musl builds --- doc/src/dev/dev.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/doc/src/dev/dev.md b/doc/src/dev/dev.md index 30db7b884..989f48d90 100644 --- a/doc/src/dev/dev.md +++ b/doc/src/dev/dev.md @@ -96,6 +96,8 @@ You can then find the reports in `target/llvm-cov/html/index.html` ## Static binary builds +### Using LXC + Using musl-libc, we should be able to produce statically linked binaries from our codebase. A short setup using a Debian system and `lxc` can be the following: @@ -135,3 +137,15 @@ And now we should be able to build a statically linked binary: # sed -e 's,^#RUSTFLAGS ,RUSTFLAGS ,' -i Makefile # make darkirc ``` + +### Native + +In certain cases, it might also be possible to build natively by +installing the musl toolchain: + +``` +$ rustup target add x86_64-unknown-linux-musl --toolchain nightly +## Uncomment RUSTFLAGS in the main Makefile +$ sed -e 's,^#RUSTFLAGS ,RUSTFLAGS ,' -i Makefile +$ make RUST_TARGET=x86_64-unknown-linux-musl darkirc +```