since the alpine issues have been fixed now - build receipe/instructions
for static rsync below.
ok - why using alpine for the build ?
alpine uses musl libc instead of glibc, and musl is designed to support
static linking cleanly and reliably — unlike glibc, which can make
static linking difficult or unpredictable.
because of that, you can build truly portable, self‑contained binaries
that don’t depend on specific shared libraries being present on the host*.*
you may have seen error messages like this for example when statically
linking with glibc based distro: "warning: Using 'getpwnam_r' in
statically linked applications requires at runtime the shared libraries
from the glibc version used for linking"
**
feedback welcome
regards **
Roland
1. install docker
2. run this script
-----
# cat make_rsync.sh
#!/bin/sh
VER=3.4.1
docker run -d --name alpine-edge-container -it alpine:edge /bin/sh
docker exec -it -e VER="$VER" alpine-edge-container /bin/sh -c '
cd /root
apk update
apk upgrade
apk add bash build-base openssl-dev openssl-libs-static zstd-dev
zstd-static clang nghttp2-dev nghttp2-static libssh2-dev libssh2-static
zlib-static acl-dev acl-static attr-dev openssl-libs-static openssl-dev
lz4-dev lz4-static xxhash-dev xxhash-static py3-commonmark python3
py3-commonmark attr-dev zlib-dev zlib-static popt-dev popt-static perl
rm rsync-$VER.tar.gz
wget https://download.samba.org/pub/rsync/src/rsync-$VER.tar.gz
tar xzvf rsync-$VER.tar.gz
cd rsync-$VER
./configure CFLAGS="-static"
make -j $(nproc)
strip rsync
'
docker cp alpine-edge-container:/root/rsync-$VER/rsync rsync-$VER-static
-----
3.
if you need older versions, here is a list how to adjust CFLAGS and
configure options. Mind that with 2.2.1 and below, sources need to be
patched appropriately
3.4.1 CFLAGS="-static" ./configure
3.4.0 CFLAGS="-static" ./configure
3.3.0 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu18"
./configure
3.2.7 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu18"
./configure
3.2.6 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu18"
./configure
3.2.5 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu18"
./configure
3.2.4 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu18"
./configure
3.2.3 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu18"
./configure
3.2.2 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu18"
./configure
3.2.1 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu18"
./configure
3.2.0 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu18"
./configure --disable-simd
3.1.3 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90"
./configure
3.1.2 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90"
./configure
3.1.1 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90"
./configure
3.1.0 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90"
./configure
3.0.9 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90"
./configure
3.0.8 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90"
./configure
3.0.7 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90"
./configure
3.0.6 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90"
./configure
3.0.5 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90"
./configure
3.0.4 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90"
./configure
3.0.3 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90"
./configure
3.0.2 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90"
./configure
3.0.1 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90"
./configure
3.0.0 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90"
./configure
2.6.9 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90"
./configure
2.6.8 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90"
./configure
2.6.7 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90"
./configure
2.6.6 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90"
./configure
2.6.5 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90"
./configure
2.6.4 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90"
./configure
2.6.3 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90"
./configure
2.6.2 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90"
./configure
2.6.1 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90"
./configure
2.6.0 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90"
./configure
2.5.7 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90"
./configure
2.5.6 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90"
./configure
2.5.5 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90"
./configure
2.5.4 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90"
./configure
2.5.3 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90"
./configure
2.5.2 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90"
./configure
2.5.1 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90"
./configure
2.5.0 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90
-DHAVE_INET_NTOP" ./configure
2.4.8 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90
-DHAVE_INET_NTOP" ./configure --host=x86_64-pc-linux-gnu
2.4.7 missing
2.4.6 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90
-DHAVE_INET_NTOP" ./configure --host=x86_64-pc-linux-gnu
2.4.5 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90
-DHAVE_INET_NTOP" ./configure --host=x86_64-pc-linux-gnu
2.4.4 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90
-DHAVE_INET_NTOP" ./configure --host=x86_64-pc-linux-gnu
2.4.3 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90
-DHAVE_INET_NTOP" ./configure --host=x86_64-pc-linux-gnu
2.4.2 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90
-DHAVE_INET_NTOP" ./configure --host=x86_64-pc-linux-gnu
2.4.1 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90
-DHAVE_INET_NTOP" ./configure --host=x86_64-pc-linux-gnu
2.4.0 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90
-DHAVE_INET_NTOP" ./configure --host=x86_64-pc-linux-gnu
2.3.3 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90
-DHAVE_INET_NTOP" ./configure --host=x86_64-pc-linux-gnu
2.3.2 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90
-DHAVE_INET_NTOP" ./configure --host=x86_64-pc-linux-gnu
2.3.1 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90
-DHAVE_INET_NTOP" ./configure --host=x86_64-pc-linux-gnu
2.3.0 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90
-DHAVE_INET_NTOP" ./configure --host=x86_64-pc-linux-gnu
2.2.1 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90
-DHAVE_INET_NTOP" ./configure --host=x86_64-pc-linux-gnu , uncomment
strlcat & strlcpy in proto.h and util.c
2.2.0 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90
-DHAVE_INET_NTOP" ./configure --host=x86_64-pc-linux-gnu , uncomment
strlcat & strlcpy in proto.h and util.c
2.1.1 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90
-DHAVE_INET_NTOP" ./configure --host=x86_64-pc-linux-gnu , uncomment
strlcat & strlcpy in proto.h and util.c
2.1.0 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90
-DHAVE_INET_NTOP" ./configure --host=x86_64-pc-linux-gnu , uncomment
strlcat & strlcpy in proto.h and util.c
2.0.19 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90
-DHAVE_INET_NTOP" ./configure --host=x86_64-pc-linux-gnu , uncomment
strlcat & strlcpy in proto.h and util.c
2.0.18 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90
-DHAVE_INET_NTOP" ./configure --host=x86_64-pc-linux-gnu , uncomment
strlcat & strlcpy in proto.h and util.c
2.0.17 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90
-DHAVE_INET_NTOP" ./configure --host=x86_64-pc-linux-gnu , uncomment
strlcat & strlcpy in proto.h and util.c
2.0.16 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90
-DHAVE_INET_NTOP" ./configure --host=x86_64-pc-linux-gnu , uncomment
strlcat & strlcpy in proto.h and util.c
2.0.15 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90
-DHAVE_INET_NTOP" ./configure --host=x86_64-pc-linux-gnu , uncomment
strlcat & strlcpy in proto.h and util.c
2.0.14 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90
-DHAVE_INET_NTOP" ./configure --host=x86_64-pc-linux-gnu , uncomment
strlcat & strlcpy in proto.h and util.c
2.0.13 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90
-DHAVE_INET_NTOP" ./configure --host=x86_64-pc-linux-gnu , uncomment
strlcat & strlcpy in proto.h and util.c
2.0.12 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90
-DHAVE_INET_NTOP" ./configure --host=x86_64-pc-linux-gnu , uncomment
strlcat & strlcpy in proto.h and util.c
2.0.11 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90
-DHAVE_INET_NTOP" ./configure --host=x86_64-pc-linux-gnu , uncomment
strlcat & strlcpy in proto.h and util.c
2.0.10 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90
-DHAVE_INET_NTOP" ./configure --host=x86_64-pc-linux-gnu , uncomment
strlcat & strlcpy in proto.h and util.c
2.0.9 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90
-DHAVE_INET_NTOP" ./configure --host=x86_64-pc-linux-gnu , uncomment
strlcat & strlcpy in proto.h and util.c
2.0.8 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90
-DHAVE_INET_NTOP" ./configure --host=x86_64-pc-linux-gnu , uncomment
strlcat & strlcpy in proto.h and util.c
2.0.7 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90
-DHAVE_INET_NTOP" ./configure --host=x86_64-pc-linux-gnu , uncomment
strlcat & strlcpy in proto.h and util.c
2.0.6 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90
-DHAVE_INET_NTOP" ./configure --host=x86_64-pc-linux-gnu , uncomment
strlcat & strlcpy in proto.h and util.c
2.0.5 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90
-DHAVE_INET_NTOP" ./configure --host=x86_64-pc-linux-gnu , uncomment
strlcat & strlcpy in proto.h and util.c
2.0.4 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90
-DHAVE_INET_NTOP" ./configure --host=x86_64-pc-linux-gnu , uncomment
strlcat & strlcpy in proto.h and util.c
2.0.3 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90
-DHAVE_INET_NTOP" ./configure --host=x86_64-pc-linux-gnu , uncomment
strlcpy in proto.h and util.c
2.0.2 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90
-DHAVE_INET_NTOP" ./configure --host=x86_64-pc-linux-gnu , uncomment
strlcpy in proto.h and util.c
2.0.1 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90
-DHAVE_INET_NTOP" ./configure --host=x86_64-pc-linux-gnu , uncomment
strlcpy in proto.h and util.c
2.0.0 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90
-DHAVE_INET_NTOP" ./configure --host=x86_64-pc-linux-gnu , uncomment
strlcpy in proto.h and util.c, change SIGCLD -> SIGCHLD in socket.c
1.7.4 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90
-DHAVE_INET_NTOP" ./configure --host=x86_64-pc-linux-gnu
1.7.3 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90
-DHAVE_INET_NTOP" ./configure --host=x86_64-pc-linux-gnu
1.7.2 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90
-DHAVE_INET_NTOP" ./configure --host=x86_64-pc-linux-gnu
1.7.1 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90
-DHAVE_INET_NTOP" ./configure --host=x86_64-pc-linux-gnu
1.7.0 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90
-DHAVE_INET_NTOP" ./configure --host=x86_64-pc-linux-gnu
1.6.9 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90
-DHAVE_INET_NTOP" ./configure --host=x86_64-pc-linux-gnu
1.6.8 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90
-DHAVE_INET_NTOP" ./configure --host=x86_64-pc-linux-gnu
1.6.7 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90
-DHAVE_INET_NTOP" ./configure --host=x86_64-pc-linux-gnu
1.6.6 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90
-DHAVE_INET_NTOP" ./configure --host=x86_64-pc-linux-gnu
1.6.5 CFLAGS="-static -Wno-incompatible-pointer-types -std=gnu90
-DHAVE_INET_NTOP" ./configure --host=x86_64-pc-linux-gnu
Am 07.03.26 um 14:36 schrieb RolandK:
hello,
initially driven by some special need and then because starting to
have fun with fiddling around fixing compile issues , i managed to
create static builds of every rsync version available since 1.6.5
(dating back to 1997).
i did not yet test if all builds are really functional, but i can tell
that i can locally create a copy of some dir with rsync 1.6.5 :)
would someone find this useful to share binaries & docs ?
it could probably be valuable for testing/debugging purpose or special
use case (like mine) or just for "information technology nostalgia"
(studying how opensource tool evolved or whatever).
regarding docs, i'm currently waiting for lib issue to be fixed in
alpine:edge (using docker container for build env)
regards
Roland
--
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html