Skip to content

Instantly share code, notes, and snippets.

@noahp
Created September 27, 2021 23:51
Show Gist options
  • Save noahp/98bc8b0341bb76894ea4e91439424bdb to your computer and use it in GitHub Desktop.
Save noahp/98bc8b0341bb76894ea4e91439424bdb to your computer and use it in GitHub Desktop.
Cross-compile rsync in static mode
# get rsync
❯ git clone git@github.com:WayneD/rsync.git
❯ git checkout v3.2.3 # recent tag
# get musl cross toolchain from https://musl.cc/
❯ wget https://musl.cc/arm-linux-musleabihf-cross.tgz
❯ tar zxvf arm-linux-musleabihf-cross.tgz
# now add the toolchain to path and configure + make
export PATH=$PATH:$PWD/arm-linux-musleabihf-cross/bin
export CC=arm-linux-musleabihf-gcc
❯ ./configure CFLAGS='-static' --host=arm-linux-musleabihf \
--disable-simd \
--disable-openssl \
--disable-xxhash \
--disable-zstd \
--disable-lz4 \
--disable-asm
❯ make -j $(getconf _NPROCESSORS_CONF)
# install qemu to test
❯ sudo apt install qemu-user-static
❯ ./rsync --help
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment