Created
September 27, 2021 23:51
-
-
Save noahp/98bc8b0341bb76894ea4e91439424bdb to your computer and use it in GitHub Desktop.
Cross-compile rsync in static mode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# get rsync | |
❯ git clone [email protected]: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