Skip to content

Commit

Permalink
ngtcp2.sh: fix OpenSSL lib order [ci skip]
Browse files Browse the repository at this point in the history
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
  • Loading branch information
vszakats committed Nov 7, 2024
1 parent 606c67a commit 3ef64a1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ngtcp2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit 3ef64a1

Please sign in to comment.