-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Description
When building libwebsockets configured with -DLWS_WITH_SSL=ON and -DLWS_WITH_MBEDTLS=ON from branch v4.3-stable the build fails when mbedtls library is built without MBEDTLS_VERSION_C defined.
The compiler warning is the following:
warning: implicit declaration of function 'mbedtls_version_get_string' [-Wimplicit-function-declaration]
791 | mbedtls_version_get_string(mbedtls_version);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
and this warning results in a linker error:
undefined reference to `mbedtls_version_get_string'
This issue is present on OpenWrt because the mbedtls library is built without the option MBEDTLS_VERSION_C as you can see here.
The solution to this problem is quite simple because there is actually no need to use the function mbedtls_version_get_string, you can simply use the definition MBEDTLS_VERSION_STRING and the code functionality will remain the same.
In the commit that introduced this issue the following changes need to be made:
- delete the code between lines
389and391 - delete the code between lines
790and792 - change the line
796to this:"LWS: %s, MbedTLS-%s %s%s", library_version, MBEDTLS_VERSION_STRING, opts_str, s);
I can also make a pull request with these changes if you would prefer that.