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

thomas.spitz at hestia-france.com thomas.spitz at hestia-france.com
Tue Sep 29 16:58:41 CEST 2020


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.

In case it helps here my last compilation logs:

cmake .. -DCMAKE_INSTALL_PREFIX:PATH=./ 
-DCMAKE_TOOLCHAIN_FILE=../cross-arm-linux-apf28.cmake 
-DOPENSSL_ROOT_DIR=/home/thomas/Armadeus/armadeus-7.0-linux3.19.8-noUboot/buildroot/output/build/libopenssl-1.1.1o 
-DOPENSSL_INCLUDE_DIR=/home/thomas/Armadeus/armadeus-7.0-linux3.19.8-noUboot/buildroot/output/build/libopenssl-1.1.1o/include/ 
-DOPENSSL_LIBRARIES=/home/thomas/Armadeus/armadeus-7.0-linux3.19.8-noUboot/buildroot/output/build/libopenssl-1.1.1o/ 
-DLWS_WITHOUT_DAEMONIZE=ON -DCMAKE_BUILD_TYPE=RELEASE
-- Compiled with LWS_WITH_DIR and LWS_WITH_LEJP_CONF
Git commit hash: 22d043a
-- CMAKE_TOOLCHAIN_FILE='../cross-arm-linux-apf28.cmake'
Compiling with SSL support
-- Found OpenSSL: /usr/lib/x86_64-linux-gnu/libcrypto.so
OpenSSL include dir: 
/home/thomas/Armadeus/armadeus-7.0-linux3.19.8-noUboot/buildroot/output/build/libopenssl-1.1.1o/include
OpenSSL libraries: 
/usr/lib/x86_64-linux-gnu/libssl.so;/usr/lib/x86_64-linux-gnu/libcrypto.so;ssl;crypto
Searching for OpenSSL executable and dlls
OpenSSL executable: /usr/bin/openssl
  GENCERTS = 1
Generating SSL Certificates for the test-server...
Generating a RSA private key
......+++++
..................................+++++
writing new private key to 
'/home/thomas/workspace/Varuna4/0_librairies_sources/libwebsockets/libwebsockets-4.1-stable-20200922/libwebsockets-test-server.key.pem'
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:State or Province Name (full name) 
[Some-State]:Locality Name (eg, city) []:Organization Name (eg, company) 
[Internet Widgits Pty Ltd]:Organizational Unit Name (eg, section) 
[]:Common Name (e.g. server FQDN or YOUR name) []:Email Address 
[]:SUCCESSFULLY generated SSL certificate
DIR 
/home/thomas/workspace/Varuna4/0_librairies_sources/libwebsockets/libwebsockets-4.1-stable-20200922 
CMP 
/home/thomas/workspace/Varuna4/0_librairies_sources/libwebsockets/libwebsockets-4.1-stable-20200922/cmake
-- Configuring done
-- Generating done
-- Build files have been written to: 
/home/thomas/workspace/Varuna4/0_librairies_sources/libwebsockets/libwebsockets-4.1-stable-20200922
-- Cache values
BUILD_TESTING:BOOL=ON
CMAKE_BUILD_TYPE:STRING=RELEASE
CMAKE_INSTALL_PREFIX:PATH=.
DISABLE_WERROR:BOOL=OFF
LIBWEBSOCKETS_INCLUDE_DIRS:PATH=/home/thomas/workspace/Varuna4/0_librairies_sources/libwebsockets/libwebsockets-4.1-stable-20200922/lib;/home/thomas/workspace/Varuna4/0_librairies_sources/libwebsockets/libwebsockets-4.1-stable-20200922
LIBWEBSOCKETS_LIBRARIES:STRING=websockets;websockets_shared
LIBWEBSOCKETS_LIBRARIES_SHARED:STRING=websockets_shared
LIBWEBSOCKETS_LIBRARIES_STATIC:STRING=websockets
LWS_AVOID_SIGPIPE_IGN:BOOL=OFF
LWS_CLIENT_HTTP_PROXYING:BOOL=ON
LWS_CTEST_INTERNET_AVAILABLE:BOOL=ON
LWS_EXT_PTHREAD_INCLUDE_DIR:PATH=
LWS_EXT_PTHREAD_LIBRARIES:PATH=
LWS_FALLBACK_GETHOSTBYNAME:BOOL=OFF
LWS_FOR_GITOHASHI:BOOL=OFF
LWS_HTTP_HEADERS_ALL:BOOL=OFF
LWS_INSTALL_BIN_DIR:PATH=bin
LWS_INSTALL_CMAKE_DIR:PATH=lib/cmake/libwebsockets
LWS_INSTALL_EXAMPLES_DIR:PATH=bin
LWS_INSTALL_INCLUDE_DIR:PATH=include
LWS_INSTALL_LIB_DIR:PATH=lib
LWS_IPV6:BOOL=OFF
LWS_LIBMOUNT_INCLUDE_DIRS:PATH=
LWS_LIBMOUNT_LIBRARIES:PATH=
LWS_LINK_TESTAPPS_DYNAMIC:BOOL=OFF
LWS_LOGGING_BITFIELD_CLEAR:STRING=0
LWS_LOGGING_BITFIELD_SET:STRING=0
LWS_LOGS_TIMESTAMP:BOOL=ON
LWS_OPENSSL_CLIENT_CERTS:PATH=../share
LWS_OPENSSL_INCLUDE_DIRS:PATH=
LWS_OPENSSL_LIBRARIES:PATH=
LWS_PLAT_ANDROID:BOOL=OFF
LWS_PLAT_FREERTOS:BOOL=OFF
LWS_PLAT_OPTEE:BOOL=OFF
LWS_REPRODUCIBLE:BOOL=ON
LWS_ROLE_DBUS:BOOL=OFF
LWS_ROLE_H1:BOOL=ON
LWS_ROLE_MQTT:BOOL=OFF
LWS_ROLE_RAW_FILE:BOOL=ON
LWS_ROLE_RAW_PROXY:BOOL=OFF
LWS_ROLE_WS:BOOL=ON
LWS_SQLITE3_INCLUDE_DIRS:PATH=
LWS_SQLITE3_LIBRARIES:PATH=
LWS_SSL_CLIENT_USE_OS_CA_CERTS:BOOL=ON
LWS_SSL_SERVER_WITH_ECDH_CERT:BOOL=OFF
LWS_STATIC_PIC:BOOL=OFF
LWS_UNIX_SOCK:BOOL=ON
LWS_WITHOUT_BUILTIN_GETIFADDRS:BOOL=OFF
LWS_WITHOUT_BUILTIN_SHA1:BOOL=OFF
LWS_WITHOUT_CLIENT:BOOL=OFF
LWS_WITHOUT_DAEMONIZE:BOOL=ON
LWS_WITHOUT_EXTENSIONS:BOOL=ON
LWS_WITHOUT_SERVER:BOOL=OFF
LWS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F
LWS_WITH_JOSE:BOOL=OFF
LWS_WITH_LEJP:BOOL=ON
LWS_WITH_LEJP_CONF:BOOL=ON
LWS_WITH_LIBEV:BOOL=OFF
LWS_WITH_LIBEVENT:BOOL=OFF
LWS_WITH_LIBUV:BOOL=OFF
LWS_WITH_LWSAC:BOOL=ON
LWS_WITH_LWSWS:BOOL=OFF
LWS_WITH_LWS_DSH:BOOL=OFF
LWS_WITH_MBEDTLS:BOOL=OFF
LWS_WITH_MINIMAL_EXAMPLES:BOOL=OFF
LWS_WITH_MINIZ:BOOL=OFF
LWS_WITH_NETWORK:BOOL=ON
LWS_WITH_NO_LOGS:BOOL=OFF
LWS_WITH_PEER_LIMITS:BOOL=OFF
LWS_WITH_PLUGINS:BOOL=OFF
LWS_WITH_PLUGINS_API:BOOL=OFF
LWS_WITH_RANGES:BOOL=OFF
LWS_WITH_SECURE_STREAMS:BOOL=OFF
LWS_WITH_SECURE_STREAMS_PROXY_API:BOOL=OFF
LWS_WITH_SECURE_STREAMS_STATIC_POLICY_ONLY:BOOL=OFF
LWS_WITH_SECURE_STREAMS_SYS_AUTH_API_AMAZON_COM:BOOL=OFF
LWS_WITH_SELFTESTS:BOOL=OFF
LWS_WITH_SEQUENCER:BOOL=ON
LWS_WITH_SERVER_STATUS:BOOL=OFF
LWS_WITH_SHARED:BOOL=ON
LWS_WITH_SOCKS5:BOOL=OFF
LWS_WITH_SPAWN:BOOL=OFF
LWS_WITH_SQLITE3:BOOL=OFF
LWS_WITH_SSL:BOOL=ON
LWS_WITH_STATIC:BOOL=ON
LWS_WITH_STATS:BOOL=OFF
LWS_WITH_STRUCT_JSON:BOOL=OFF
LWS_WITH_STRUCT_SQLITE3:BOOL=OFF
LWS_WITH_SUL_DEBUGGING:BOOL=OFF
LWS_WITH_SYS_ASYNC_DNS:BOOL=OFF
LWS_WITH_SYS_DHCP_CLIENT:BOOL=OFF
LWS_WITH_SYS_NTPCLIENT:BOOL=OFF
LWS_WITH_SYS_SMD:BOOL=ON
LWS_WITH_SYS_STATE:BOOL=ON
LWS_WITH_THREADPOOL:BOOL=OFF
LWS_WITH_UDP:BOOL=ON
LWS_WITH_WOLFSSL:BOOL=OFF
LWS_WITH_ZIP_FOPS:BOOL=OFF
LWS_WITH_ZLIB:BOOL=OFF
LWS_WOLFSSL_INCLUDE_DIRS:PATH=
LWS_WOLFSSL_LIBRARIES:PATH=
LWS_ZLIB_INCLUDE_DIRS:PATH=
LWS_ZLIB_LIBRARIES:PATH=

Cmake - L  cache values seem also similar between LWS 4.0 and LWS 4.1. 
Here below the one of LWS4.0. I highlighted in bold the differences:

LWS_WITH_STATIC = ON
  LWS_WITH_SHARED = ON
  LWS_WITH_SSL = ON (SSL Support)
  LWS_SSL_CLIENT_USE_OS_CA_CERTS = 1
  LWS_WITH_WOLFSSL = OFF (wolfSSL/CyaSSL replacement for OpenSSL)
  LWS_WITH_MBEDTLS = OFF (mbedTLS replacement for OpenSSL)
  LWS_WITHOUT_BUILTIN_SHA1 = OFF
  LWS_WITHOUT_BUILTIN_GETIFADDRS = OFF
  LWS_WITHOUT_CLIENT = OFF
  LWS_WITHOUT_SERVER = OFF
  LWS_LINK_TESTAPPS_DYNAMIC = OFF
  LWS_WITHOUT_TESTAPPS = OFF
  LWS_WITHOUT_TEST_SERVER = OFF
  LWS_WITHOUT_TEST_SERVER_EXTPOLL = OFF
  LWS_WITHOUT_TEST_PING = OFF
  LWS_WITHOUT_TEST_CLIENT = OFF
  LWS_WITHOUT_EXTENSIONS = ON
  LWS_WITHOUT_DAEMONIZE = ON
  LWS_WITH_LIBEV = OFF
  LWS_WITH_LIBUV = OFF
  LWS_WITH_LIBEVENT = OFF
  LWS_WITH_GLIB = OFF
  LWS_IPV6 = OFF
***LWS_UNIX_SOCK**= OFF*
  LWS_WITH_HTTP2 = 1
  LWS_ROLE_MQTT = OFF
  LWS_SSL_SERVER_WITH_ECDH_CERT = OFF
  LWS_MAX_SMP = 1
* LWS_HAVE_PTHREAD_H = 1*
  LWS_WITH_CGI = OFF
* LWS_HAVE_OPENSSL_ECDH_H = 1**
** LWS_HAVE_SSL_CTX_set1_param = 1*
* LWS_HAVE_RSA_SET0_KEY = 1*
  LWS_WITH_HTTP_PROXY = OFF
  LIBHUBBUB_LIBRARIES =
  PLUGINS =
  LWS_WITH_ACCESS_LOG = OFF
  LWS_WITH_SERVER_STATUS = OFF
  LWS_WITH_LEJP = ON
  LWS_WITH_LEJP_CONF = ON
* LWS_WITH_GENERIC_SESSIONS = OFF*
  LWS_STATIC_PIC = OFF
  LWS_WITH_RANGES = OFF
  LWS_PLAT_OPTEE = OFF
  LWS_PLAT_FREERTOS = OFF
  LWS_WITH_ZIP_FOPS = OFF
  LWS_AVOID_SIGPIPE_IGN = OFF
  LWS_WITH_STATS = OFF
  LWS_WITH_SOCKS5 = OFF
* LWS_HAVE_SYS_CAPABILITY_H = **
** LWS_HAVE_LIBCAP = *
  LWS_WITH_PEER_LIMITS = OFF
* LWS_HAVE_ATOLL = 1**
** LWS_HAVE__ATOI64 = **
** LWS_HAVE_STAT32I64 = **
** LWS_HAS_INTPTR_T = 1*
  LWS_WITH_EXPORT_LWSTARGETS = ON
* LWS_WITH_ABSTRACT = *

I hope this could help...

Best regards,

Thomas


On 29/09/2020 14:30, andy at warmcat.com wrote:
>
> On September 29, 2020 12:23:57 PM UTC, "thomas.spitz at hestia-france.com" <thomas.spitz at hestia-france.com> wrote:
>> Hello everyone, hello Andy,
>>
>> Using the same compilation directive, libwebsockets 4.1 stable creates
>> lib that is almost ten times bigger than libwebsockets 4.0.
>> Respectively
>> 3.1MB instead of 398,2 kB
> Size of the elf is pretty meaningless metric, since debug sections go in there if you build with -g, (on old or newer versions), try -DCMAKE_BUILD_TYPE=RELEASE.
>
> Debug sections don't get loaded into memory with the code and data sections but stay on disk...
>
> -Andy

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://libwebsockets.org/pipermail/libwebsockets/attachments/20200929/c8303a82/attachment.htm>


More information about the Libwebsockets mailing list