[Libwebsockets] libwebsockets.so.17 almost ten times bigger than libwebsockets.so.16

Andy Green andy at warmcat.com
Tue Sep 29 18:37:26 CEST 2020

On 9/29/20 3:58 PM, thomas.spitz at hestia-france.com wrote:
> With -DCMAKE_BUILD_TYPE=RELEASE libwebsockets.so.16 is well reduced from 
> 398,2kB to 364,6kB but libwebsockets.so.17 stays unchanged.
> I tried removing HTTP2 support with -DLWS_WITH_HTTP2=OFF and 
> libwebsockets.so.17 decreases from 3.1MB to 2.8MB. This confirms options 
> are taken into account.

H2 doesn't have a way to take up 200KB, it's more like 20KB.  So it is 
just being built with -g / debug sections in the elf.

I saw in the top level ./CMakeLists.txt that underwent a lot of changes, 
-g is always added.  It's just the -g (add the debug info sections) not 
the -O0 that is separately applied by cmake, so it shouldn't affect the 
code, just the size of the elf on disk.

I pushed a patch on master + v4.1-stable that removes the hardcoded -g 
and checked that solves it.

Thanks for reporting it.


More information about the Libwebsockets mailing list