I'm not using latest versions because it results in even bigger size. I cannot use latest version of wolfssl also because it fails to build when i start disabling unneeded options
git checkout v4.8.0-stable
export CFLAGS="-Wno-error -Os"
./configure \
--host=${ARCH} \
CC=${CROSS_COMPILE}-gcc LD=${CROSS_COMPILE}-ld \
AR=${CROSS_COMPILE}-ar RANLIB=${CROSS_COMPILE}-ranlib \
STRIP=${CROSS_COMPILE}-strip \
RANLIB=${CROSS_COMPILE}-ranlib \
--prefix=/tmp/wolf \
--disable-tls13 --disable-oldtls --disable-sslv3 --disable-tlsv10 \
--disable-sha512 --disable-sha384 --disable-sha224 --disable-sha3 --disable-chacha \
--disable-pkcs12 --disable-poly1305 --disable-dh --disable-rsa \
--disable-examples --disable-crypttests \
--disable-shared --enable-static
and tinycurl
export CFLAGS="-Os -ffunction-sections -fdata-sections -fno-unwind-tables -fno-asynchronous-unwind-tables -flto"
export LDFLAGS="-Wl,-s -Wl,-Bsymbolic -Wl,--gc-sections -lm"
...
disable-everything
...
--with-wolfssl=/tmp/wolf \
--disable-shared \
--enable-static
This results in 470k wolfSSL static lib and 200k curl without ssl, 470k curl with wolfssl