Topic: Minimal possible build for tinycurl

Hi, anyone got build options list that would allow at least something similar to "100k" from the release news?
I cant get even beyond 300 kilobytes for static library (which results in +200k to a tinycurl, which is already 220k in the smallest possible build)

So best case curl with libcurl and wolfssl embedded is 440k, which is extremely far from the "100k"

Trying on tinycurl 7.79.1 and wolfssl around 5.x

Share

Re: Minimal possible build for tinycurl

Hi de2,

Please share your build settings for wolfSSL and tinycurl, please also ensure you are using the latest version of each which is currently wolfSSL 5.7.4 and tinycurl 8.4.0.  Which TLS versions/algorithms do you require for your use case?

As you are using a static library, note that the library size is not the final size as the linker will discard a significant part of the library when linking to your application.  If you are using libcurl rather than tinycurl as a standalone application you will need to link it into your application then check the size with your toolchain's size utility or with the map file generated by your compiler.  Please also ensure that you are using your compiler's size optimization option (for example -Os) and have LTO enabled.

Thanks,
Kareem

Share

Re: Minimal possible build for tinycurl

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

Share

Re: Minimal possible build for tinycurl

The "100Kb" footprint was achieved with a limited build only supporting pre-shared keys. In order to support certificates for normal TLS, you will need to adjust your footprint expectations. Is PSK a viable path forward for your project?

Re: Minimal possible build for tinycurl

No, im expecting TLSv1.2 or TLSv1.3, whichever is smaller. I didn't expect to get exactly 100k ofcourse, but i cant get even 300k... but 400-600k instead. Recommended tinycurl version compiles into 201k with literally everything disabled. only HTTP enabled. That's why i'm wondering maybe need to use some specific version of curl? Because even curl without wolfSSL is much bigger than expected

Share