Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: cmake - WOLFSSL_LEAN_TLS broken #8456

Closed
jrolli opened this issue Feb 15, 2025 · 3 comments · Fixed by #8460
Closed

[Bug]: cmake - WOLFSSL_LEAN_TLS broken #8456

jrolli opened this issue Feb 15, 2025 · 3 comments · Fixed by #8460
Assignees
Labels

Comments

@jrolli
Copy link

jrolli commented Feb 15, 2025

Contact Details

[email protected]

Version

5.7.6-stable

Description

Using WOLFSSL_LEAN_TLS causes a transient compilations issue when WOLFSSL_MEMORY=OFF is not provided. The compilation will initially fail with the error given in the logs section, but touching any file that would trigger recompilation of WolfSSL will cause subsequent compilations to succeed. At first glance, CMakeLists.txt:1133 appears to be a bad assumption as the only difference between runs is that WOLFSSL_MEMORY=OFF is in the cache. Both removing the conditional as well as adding the list command in place of this line fix the issue.

Reproduction steps

  1. Create a new directory with the attached files (CMakeLists.txt and save C code below as "repro.c" - cannot upload due to GitHub restrictions...)
#include "wolfssl/options.h"
#include "wolfssl/wolfssl.h"

#include <sys/socket.h>

int
main (void)
{
    const SSL_METHOD *method = wolfTLS_client_method();
    SSL_CTX          *ctx    = wolfSSL_CTX_new(method);
    wolfSSL_CTX_free(ctx);
    return EXIT_FAILURE;
}
  1. Run cmake -B build -DWOLFSSL_LEAN_TLS=ON .
  2. Run cmake --build build

CMakeLists.txt

Relevant log output

Undefined symbols for architecture arm64:
  "_wolfSSL_Free", referenced from:
      _wc_HashNew in hash.c.o
      _wc_HashDelete in hash.c.o
      _wc_rng_new in random.c.o
      __InitRng in random.c.o
      _wc_rng_new_ex in random.c.o
      _wc_rng_free in random.c.o
      _wc_FreeRng in random.c.o
      ...
  "_wolfSSL_Malloc", referenced from:
      _wc_HashNew in hash.c.o
      _wc_rng_new in random.c.o
      __InitRng in random.c.o
      _wc_rng_new_ex in random.c.o
      __sp_invmod_mont_ct in sp_int.c.o
      __sp_exptmod_nct in sp_int.c.o
      _wc_AesNew in aes.c.o
      ...
  "_wolfSSL_Realloc", referenced from:
      _wolfSSL_EVP_CipherUpdate_GCM in ssl.c.o
      _wolfSSL_EVP_PKEY_CTX_add1_hkdf_info in ssl.c.o
      _ECC_populate_EVP_PKEY in ssl.c.o
      _wolfssl_asn1_bit_string_grow in ssl.c.o
      _wolfSSL_BIO_set_conn_hostname in ssl.c.o
      _wolfSSL_BUF_MEM_resize in ssl.c.o
      _wolfSSL_X509_set_ext in ssl.c.o
      ...
ld: symbol(s) not found for architecture arm64
cc: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [_deps/wolfssl-build/libwolfssl.43.0.0.dylib] Error 1
make[1]: *** [_deps/wolfssl-build/CMakeFiles/wolfssl.dir/all] Error 2
make: *** [all] Error 2
@jrolli jrolli added the bug label Feb 15, 2025
@jrolli
Copy link
Author

jrolli commented Feb 15, 2025

I'm willing to create a merge request for either of the fixes, but I lack the larger context of why this comment was made (and don't know who else is depending on its current behavior).

@embhorn embhorn self-assigned this Feb 17, 2025
@embhorn embhorn mentioned this issue Feb 17, 2025
4 tasks
@embhorn
Copy link
Member

embhorn commented Feb 17, 2025

Hi @jrolli

Thanks for letting us know about the cmake build issue. I've opened a PR to fix this issue here #8460

Could you tell us a bit about your project using wolfSSL?

Kind regards,
@embhorn - wolfSSL Support

@jrolli
Copy link
Author

jrolli commented Feb 17, 2025

@embhorn, the project that raised this issue is an attempt at a lightweight equivalent of stunnel and is mostly just some tinkering to get a feel for integrating wolfSSL into a project. My longer-term side project is to poke at using it with ngtcp2 for QUIC support to get more hands-on with QUIC and test out some other ideas.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants