portable icon indicating copy to clipboard operation
portable copied to clipboard

Freeradius build failure with Librssl 3.5

Open orbea opened this issue 3 years ago • 2 comments

OS: Gentoo libressl: 3.5.2 freeradius: https://github.com/FreeRADIUS/freeradius-server/commit/5517ed19ca059735b07049542a9ea96ded9f3201

The build fails with libressl and it seems there have been multiple changes upstream since the version currently in OpenBSD.

src/lib/tls/base.c: In function ‘_openssl_thread_free’:
src/lib/tls/base.c:290:9: warning: implicit declaration of function ‘ASYNC_cleanup_thread’ [-Wimplicit-function-declaration]
  290 |         ASYNC_cleanup_thread();
      |         ^~~~~~~~~~~~~~~~~~~~
src/lib/tls/base.c:290:9: warning: nested extern declaration of ‘ASYNC_cleanup_thread’ [-Wnested-externs]
src/lib/tls/base.c: In function ‘fr_openssl_thread_init’:
src/lib/tls/base.c:314:21: warning: implicit declaration of function ‘ASYNC_init_thread’ [-Wimplicit-function-declaration]
  314 |                 if (ASYNC_init_thread(async_pool_size_max, async_pool_size_init) != 1) {
      |                     ^~~~~~~~~~~~~~~~~
src/lib/tls/base.c:314:21: warning: nested extern declaration of ‘ASYNC_init_thread’ [-Wnested-externs]
src/lib/tls/base.c: In function ‘fr_openssl_cleanup’:
src/lib/tls/base.c:367:9: warning: implicit declaration of function ‘OPENSSL_cleanup’; did you mean ‘OPENSSL_cleanse’? [-Wimplicit-function-declaration]
  367 |         OPENSSL_cleanup();
      |         ^~~~~~~~~~~~~~~
      |         OPENSSL_cleanse
src/lib/tls/base.c:367:9: warning: nested extern declaration of ‘OPENSSL_cleanup’ [-Wnested-externs]
src/lib/tls/base.c: In function ‘fr_openssl_init’:
src/lib/tls/base.c:387:38: warning: passing argument 1 of ‘CRYPTO_set_mem_functions’ from incompatible pointer type [-Wincompatible-pointer-types]
  387 |         if (CRYPTO_set_mem_functions(fr_openssl_talloc, fr_openssl_talloc_realloc, fr_openssl_talloc_free) != 1) {
      |                                      ^~~~~~~~~~~~~~~~~
      |                                      |
      |                                      void * (*)(size_t,  const char *, int) {aka void * (*)(long unsigned int,  const char *, int)}
In file included from /usr/include/openssl/bio.h:69,
                 from src/lib/tls/log.h:35,
                 from src/lib/tls/base.c:33:
/usr/include/openssl/crypto.h:408:38: note: expected ‘void * (*)(size_t)’ {aka ‘void * (*)(long unsigned int)’} but argument is of type ‘void * (*)(size_t,  const char *, int)’ {aka ‘void * (*)(long unsigned int,  const char *, int)’}
  408 | int CRYPTO_set_mem_functions(void *(*m)(size_t), void *(*r)(void *, size_t), void (*f)(void *));
      |                              ~~~~~~~~^~~~~~~~~~
src/lib/tls/base.c:387:57: warning: passing argument 2 of ‘CRYPTO_set_mem_functions’ from incompatible pointer type [-Wincompatible-pointer-types]
  387 |         if (CRYPTO_set_mem_functions(fr_openssl_talloc, fr_openssl_talloc_realloc, fr_openssl_talloc_free) != 1) {
      |                                                         ^~~~~~~~~~~~~~~~~~~~~~~~~
      |                                                         |
      |                                                         void * (*)(void *, size_t,  const char *, int) {aka void * (*)(void *, long unsigned int,  const char *, int)}
In file included from /usr/include/openssl/bio.h:69,
                 from src/lib/tls/log.h:35,
                 from src/lib/tls/base.c:33:
/usr/include/openssl/crypto.h:408:58: note: expected ‘void * (*)(void *, size_t)’ {aka ‘void * (*)(void *, long unsigned int)’} but argument is of type ‘void * (*)(void *, size_t,  const char *, int)’ {aka ‘void * (*)(void *, long unsigned int,  const char *, int)’}
  408 | int CRYPTO_set_mem_functions(void *(*m)(size_t), void *(*r)(void *, size_t), void (*f)(void *));
      |                                                  ~~~~~~~~^~~~~~~~~~~~~~~~~~
src/lib/tls/base.c:387:84: warning: passing argument 3 of ‘CRYPTO_set_mem_functions’ from incompatible pointer type [-Wincompatible-pointer-types]
  387 |         if (CRYPTO_set_mem_functions(fr_openssl_talloc, fr_openssl_talloc_realloc, fr_openssl_talloc_free) != 1) {
      |                                                                                    ^~~~~~~~~~~~~~~~~~~~~~
      |                                                                                    |
      |                                                                                    void (*)(void *, const char *, int)
In file included from /usr/include/openssl/bio.h:69,
                 from src/lib/tls/log.h:35,
                 from src/lib/tls/base.c:33:
/usr/include/openssl/crypto.h:408:85: note: expected ‘void (*)(void *)’ but argument is of type ‘void (*)(void *, const char *, int)’
  408 | int CRYPTO_set_mem_functions(void *(*m)(size_t), void *(*r)(void *, size_t), void (*f)(void *));
      |                                                                              ~~~~~~~^~~~~~~~~~
src/lib/tls/base.c:400:29: error: ‘OPENSSL_INIT_NO_ATEXIT’ undeclared (first use in this function); did you mean ‘OPENSSL_INIT_ATFORK’?
  400 |         OPENSSL_init_crypto(OPENSSL_INIT_NO_ATEXIT | OPENSSL_INIT_LOAD_CONFIG, NULL);
      |                             ^~~~~~~~~~~~~~~~~~~~~~
      |                             OPENSSL_INIT_ATFORK
src/lib/tls/base.c:400:29: note: each undeclared identifier is reported only once for each function it appears in
src/lib/tls/base.c:434:9: warning: implicit declaration of function ‘OPENSSL_atexit’; did you mean ‘OPENSSL_init’? [-Wimplicit-function-declaration]
  434 |         OPENSSL_atexit(_openssl_engine_free);
      |         ^~~~~~~~~~~~~~
      |         OPENSSL_init
src/lib/tls/base.c:434:9: warning: nested extern declaration of ‘OPENSSL_atexit’ [-Wnested-externs]
dlibtool-shared: error logged in slbt_exec_compile(), line 209: Success.
make: *** [scripts/boiler.mk:734: build/objs/src/lib/tls/base.lo] Error 2

Full build log - freeradius.log

orbea avatar May 06 '22 16:05 orbea

This issue is blocking me from trying to get an unrelated slibtool build issue fixed in Freeradius upstream, any help would be appreciated.

https://bugs.gentoo.org/786102

orbea avatar May 10 '22 17:05 orbea