From 3ef64a185eb187f6c258b7ba093fe9ba148ffc72 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 6 Nov 2024 23:47:59 +0100 Subject: [PATCH] ngtcp2.sh: fix OpenSSL lib order [ci skip] libssl first, libcrypto second. Before this patch it was in reverse order and it prevented ngtcp2 to detect QUIC support because OPENSSL_malloc() and OPENSSL_free() symbols weren't found when using gcc. ``` [...ngtcp2...] -- Looking for SSL_set_quic_early_data_context CMake Warning at CMakeLists.txt:177 (message): Disabling BoringSSL due to lack of QUIC support in -- Looking for SSL_set_quic_early_data_context - not found -- Looking for arpa/inet.h /home/runner/work/curl-for-win/curl-for-win/awslc/_x64-linux-musl/usr/lib/libcrypto.a;/home/runner/work/curl-for-win/curl-for-win/awslc/_x64-linux-musl/usr/lib/libssl.a;-lpthread [...] /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /home/runner/work/curl-for-win/curl-for-win/awslc/_x64-linux-musl/usr/lib/libssl.a(ssl_lib.cc.o): in function `SSL_set_quic_early_data_context': (.text.SSL_set_quic_early_data_context+0x38): undefined reference to `OPENSSL_free' /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: (.text.SSL_set_quic_early_data_context+0x84): undefined reference to `OPENSSL_malloc' collect2: error: ld returned 1 exit status [...curl...] -- Looking for SSL_set1_ech_config_list -- Looking for SSL_set1_ech_config_list - found -- ECH enabled. -- Found NGHTTP2: /home/runner/work/curl-for-win/curl-for-win/nghttp2/_x64-linux-musl/usr/include (found version "1.64.0") CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message): Could NOT find NGTCP2 (missing: BoringSSL) (found version "1.8.1") Call Stack (most recent call first): /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE) CMake/FindNGTCP2.cmake:108 (find_package_handle_standard_args) CMakeLists.txt:891 (find_package) ``` https://github.com/curl/curl-for-win/actions/runs/11712448493/job/32623143919#step:3:3343 --- ngtcp2.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ngtcp2.sh b/ngtcp2.sh index 6660e39a0..4d8c781a2 100755 --- a/ngtcp2.sh +++ b/ngtcp2.sh @@ -33,7 +33,7 @@ _VER="$1" options+=' -DENABLE_OPENSSL=OFF' options+=' -DENABLE_BORINGSSL=ON' options+=" -DBORINGSSL_INCLUDE_DIR=${_TOP}/${_OPENSSL}/${_PP}/include" - options+=" -DBORINGSSL_LIBRARIES=${_TOP}/${_OPENSSL}/${_PP}/lib/libcrypto.a;${_TOP}/${_OPENSSL}/${_PP}/lib/libssl.a;-lpthread"; [ "${_OS}" = 'win' ] && options="${options};-lws2_32" + options+=" -DBORINGSSL_LIBRARIES=${_TOP}/${_OPENSSL}/${_PP}/lib/libssl.a;${_TOP}/${_OPENSSL}/${_PP}/lib/libcrypto.a;-lpthread"; [ "${_OS}" = 'win' ] && options="${options};-lws2_32" CPPFLAGS+=' -DNOCRYPT' elif [ "${_OPENSSL}" = 'quictls' ] || [ "${_OPENSSL}" = 'libressl' ]; then options+=' -DENABLE_OPENSSL=ON'