<div dir="ltr">For anybody trying to build a static binary:<div><br></div><div>Thanks to Han Boetes for the post here, advising to use musl.</div><div>Thanks to Florian Dejonckheere for posting this script: <a href="https://github.com/JBBgameich/rsync-static">https://github.com/JBBgameich/rsync-static</a></div><div><br></div><div>Here is my small contrib on this, for the lazy folks.</div><div>I download the musl prebuild binaries for my arch from <a href="http://skarnet.org/toolchains">skarnet.org/toolchains</a></div><div>My script is posted here: </div><div><a href="https://github.com/nwaizer/rsync-static/blob/main/build_static.sh">https://github.com/nwaizer/rsync-static/blob/main/build_static.sh</a><br></div><div><br></div><div>or below:</div><div>#!/bin/bash<br># based on the solution by Florian Dejonckheere <<a href="mailto:florian@floriandejonckheere.be">florian@floriandejonckheere.be</a>><br># at <a href="https://github.com/JBBgameich/rsync-static">https://github.com/JBBgameich/rsync-static</a><br><br>mkdir toolchain<br>echo "I: Downloading prebuilt toolchain"<br>wget --continue <a href="https://skarnet.org/toolchains/native/x86_64-linux-musl_pc-11.3.0.tar.xz">https://skarnet.org/toolchains/native/x86_64-linux-musl_pc-11.3.0.tar.xz</a> -O /tmp/x86_64-linux-musl_pc.tar.xz|| echo "Failed to find x86_64-linux-musl_pc-11.3.0.tar.xz. Please open your browser at <a href="https://skarnet.org/toolchains/native">https://skarnet.org/toolchains/native</a> and find the correct file to fix this"<br>tar -xf /tmp/x86_64-linux-musl_pc.tar.xz -C toolchain<br><br>echo "Native compiler is called gcc"<br>TOOLCHAIN_PATH="$(readlink -f $(dirname $(find . -name "gcc"))/..)"<br>echo "Use local gcc instead of the OS installed one"<br>export PATH=$TOOLCHAIN_PATH/bin:$PATH<br><br>echo "Get rsync source"<br>git clone <a href="https://github.com/WayneD/rsync.git">https://github.com/WayneD/rsync.git</a><br><br>echo "Build rsync"<br>cd rsync/<br>make clean<br>export CC="gcc"<br>echo "Disable openssl xxhash zstd and lz4 as they did not configure even after consulting the INSTALL"<br>./configure CFLAGS="-static" --host="x86" --disable-openssl --disable-xxhash --disable-zstd --disable-lz4<br>make<br>strip rsync<br></div><div><br></div><div>Thanks for rsync,</div><div>Niv</div></div>