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

LibreSSL build is broken #678

Closed
sreimers opened this issue Feb 3, 2023 · 3 comments
Closed

LibreSSL build is broken #678

sreimers opened this issue Feb 3, 2023 · 3 comments

Comments

@sreimers
Copy link
Member

sreimers commented Feb 3, 2023

/home/runner/work/re/re/src/tls/openssl/tls.c:1904:25: warning: implicit declaration of function ‘tls_enable_sni’ [-Wimplicit-function-declaration]
 1904 |                         tls_enable_sni(tls);
      |                         ^~~~~~~~~~~~~~
/home/runner/work/re/re/src/tls/openssl/tls.c:1904:25: warning: nested extern declaration of ‘tls_enable_sni’ [-Wnested-externs]
[205/215] Building C object CMakeFiles/re-objs.dir/src/hmac/openssl/hmac.c.o
[206/215] Building C object CMakeFiles/re-objs.dir/src/tls/openssl/sni.c.o
FAILED: CMakeFiles/re-objs.dir/src/tls/openssl/sni.c.o 
/usr/bin/cc -DARCH=\"x86_64\" -DHAVE_ACCEPT4 -DHAVE_ATOMIC -DHAVE_EPOLL -DHAVE_EXECINFO -DHAVE_FORK -DHAVE_GETIFADDRS -DHAVE_GETOPT -DHAVE_INET6 -DHAVE_PTHREAD -DHAVE_PWD_H -DHAVE_RESOLV -DHAVE_ROUTE_LIST -DHAVE_SELECT -DHAVE_SELECT_H -DHAVE_SETRLIMIT -DHAVE_SIGNAL -DHAVE_STRERROR_R -DHAVE_STRINGS_H -DHAVE_SYSLOG -DHAVE_SYS_TIME_H -DHAVE_THREADS -DHAVE_UNAME -DHAVE_UNISTD_H -DHAVE_UNIXSOCK=1 -DLINUX -DOS=\"Linux\" -DUSE_DTLS -DUSE_OPENSSL -DUSE_OPENSSL_AES -DUSE_OPENSSL_DTLS -DUSE_OPENSSL_HMAC -DUSE_OPENSSL_SRTP -DUSE_TLS -DUSE_ZLIB -DVERSION=\"2.11.0\" -DVER_MAJOR=2 -DVER_MINOR=11 -DVER_PATCH=0 -D_GNU_SOURCE -I/home/runner/work/re/re/. -I/home/runner/work/re/re/include -I/home/runner/work/re/re/assets/libressl/include -fPIC -pedantic -Wall -Wbad-function-cast -Wcast-align -Wextra -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wno-strict-aliasing -Wold-style-definition -Wshadow -Waggregate-return -Wstrict-prototypes -Wuninitialized -Wvla -std=c11 -MD -MT CMakeFiles/re-objs.dir/src/tls/openssl/sni.c.o -MF CMakeFiles/re-objs.dir/src/tls/openssl/sni.c.o.d -o CMakeFiles/re-objs.dir/src/tls/openssl/sni.c.o -c /home/runner/work/re/re/src/tls/openssl/sni.c
/home/runner/work/re/re/src/tls/openssl/sni.c: In function ‘ssl_set_verify_client’:
/home/runner/work/re/re/src/tls/openssl/sni.c:163:15: error: ‘tc’ undeclared (first use in this function); did you mean ‘tm’?
  163 |         (void)tc;
      |               ^~
      |               tm
/home/runner/work/re/re/src/tls/openssl/sni.c:163:15: note: each undeclared identifier is reported only once for each function it appears in
/home/runner/work/re/re/src/tls/openssl/sni.c:139:39: warning: unused parameter ‘ssl’ [-Wunused-parameter]
  139 | static int ssl_set_verify_client(SSL *ssl, const char *host)
      |                                  ~~~~~^~~
/home/runner/work/re/re/src/tls/openssl/sni.c: In function ‘ssl_use_cert’:
/home/runner/work/re/re/src/tls/openssl/sni.c:183:13: warning: implicit declaration of function ‘SSL_use_cert_and_key’ [-Wimplicit-function-declaration]
  183 |         r = SSL_use_cert_and_key(ssl, tls_cert_x509(uc), tls_cert_pkey(uc),
      |             ^~~~~~~~~~~~~~~~~~~~
/home/runner/work/re/re/src/tls/openssl/sni.c:183:13: warning: nested extern declaration of ‘SSL_use_cert_and_key’ [-Wnested-externs]
/home/runner/work/re/re/src/tls/openssl/sni.c: At top level:
/home/runner/work/re/re/src/tls/openssl/sni.c:224:6: warning: no previous prototype for ‘tls_enable_sni’ [-Wmissing-prototypes]
  224 | void tls_enable_sni(struct tls *tls)
      |      ^~~~~~~~~~~~~~

@cspiel1 can you have a look?

@sreimers
Copy link
Member Author

sreimers commented Feb 3, 2023

Btw. you can remove the OpenSSL >=1.1.0 checks, older versions are not supported anymore:

@cspiel1
Copy link
Collaborator

cspiel1 commented Feb 3, 2023

I was looking for a while how to reproduce this on my dev host. The installed openssl should be ignored. I downloaded the assets.tar.gtz and tried with:

cmake -B build -DUSE_OPENSSL=OFF -DCMAKE_C_FLAGS="-Iassets/libressl/include -Werror" -DCMAKE_EXE_LINKER_FLAGS="-Lassets/libressl"

Then I got this:

[ 15%] Building C object CMakeFiles/re-objs.dir/src/hmac/hmac_sha1.c.o
/home/cspiel/tmp/re/src/hmac/hmac_sha1.c: In function ‘hmac_sha1’:
/home/cspiel/tmp/re/src/hmac/hmac_sha1.c:58:2: error: #error missing HMAC-SHA1 backend
   58 | #error missing HMAC-SHA1 backend

Do you have any hints? In the meanwhile I'll dig into it further.

edit: I tried this #677 and this is how it can be reproduced.

export OPENSSL_ROOT_DIR=`pwd`/assets/libressl
cmake -B build -DCMAKE_C_FLAGS="-Werror" -DCMAKE_EXE_LINKER_FLAGS="-Lassets/libressl"

@cspiel1
Copy link
Collaborator

cspiel1 commented Feb 3, 2023

PR: #679

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

No branches or pull requests

2 participants