So, I did a lot of experimentation with Emscripten. And what I noticed pretty much is that the musl-libc that is being used is impressively huge...like, really huge. A simple "Hello, World!" printing app is way above the 10kb...which is by far not practical.
Now how can I reduce this? So far, I figured that I could use -Os and --closure 1. But the latter only really works over JavaScript, so it does not affect the Wasm output.
What else can I do? Use a different libc implementation, maybe? I looked at uClibc and dietlibc as well as Metallic. I also thought about looing for a cheap - filesize-wise - deflate function so I could transfer a gzipped version of the Wasm binary. But so far, that is all I got.
Any suggestions? My last try was:
emcc test.cpp -o test.wasm -s WASM=1 -Os --closure 1
where test.cpp is just a printf("Hello, world");.