Skip to content

cmake: enable C++ library for GCC in AWS-LC/BoringSSL static builds - #23179

Closed
vszakats wants to merge 6 commits into
curl:masterfrom
vszakats:cm-cxx-gcc
Closed

vszakats wants to merge 6 commits into
curl:masterfrom
vszakats:cm-cxx-gcc

Conversation

@vszakats

@vszakats vszakats commented Sep 29, 2026 •

Copy link
Copy Markdown
Member

Before this patch it was only enabled for clang. To allow building curl
against default BoringSSL builds (building static libs), with GCC too.

Also: break out C++ library name into a variable.

Follow-up to c991902
Cherry-picked from #23177


Tested OK:
https://github.com/curl/curl/actions/runs/36627708766/job/109608842277?pr=23179#step:45:30

/bld/lib/libcurl.a: current ar archive
./bld/src/curl:      ELF 64-bit LSB pie executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=39df41a8bae3db9d56e747ec232ff0d5ff45ebe5, for GNU/Linux 3.2.0, with debug_info, not stripped
   1859192 bytes: ./bld/lib/libcurl.a
  22696336 bytes: ./bld/src/curl
curl 8.23.0-DEV (x86_64-unknown-linux-gnu) libcurl/8.23.0-DEV BoringSSL zlib/1.3 brotli/1.1.0 zstd/1.5.5 libpsl/0.21.2 nghttp2/1.59.0 OpenLDAP/2.6.10

```
-- Found Zstd (via pkg-config): /usr/include (found version "1.5.5")
-- Looking for DES_ecb_encrypt
-- Looking for DES_ecb_encrypt - found
-- Looking for SSL_set0_wbio
-- Looking for SSL_set0_wbio - not found
-- Looking for SSL_set1_ech_config_list
-- Looking for SSL_set1_ech_config_list - not found
CMake Error at CMakeLists.txt:1078 (message):
  ECH support missing in AWS-LC/BoringSSL/OpenSSL/Rustls/wolfSSL
```

```
        FAILED: [code=1] cmTC_12986
        : && /usr/bin/cc -DCHECK_FUNCTION_EXISTS=SSL_set1_ech_config_list  -Werror-implicit-function-declaration -W -Wall -Wpedantic -Wbad-function-cast -Wconversion -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wno-long-long -Wno-multichar -Wpointer-arith -Wshadow -Wsign-compare -Wundef -Wunused -Wwrite-strings -Waddress -Wattributes -Wcast-align -Wcast-qual -Wdeclaration-after-statement -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-security -Wignored-qualifiers -Wmissing-field-initializers -Wmissing-noreturn -Wno-padded -Wno-sign-conversion -Wno-switch-default -Wno-switch-enum -Wno-system-headers -Wold-style-definition -Wredundant-decls -Wstrict-prototypes -Wtype-limits -Wunreachable-code -Wunused-parameter -Wvla -Wclobbered -Wmissing-parameter-type -Wold-style-declaration -Wpragmas -Wstrict-aliasing=3 -ftree-vrp -Wjump-misses-init -Wdouble-promotion -Wformat=2 -Wlogical-op -Wtrampolines -Warray-bounds=2 -Wformat-signedness -Wduplicated-cond -Wnull-dereference -fdelete-null-pointer-checks -Wshift-negative-value -Wshift-overflow=2 -Wunused-const-variable -Walloc-zero -Wduplicated-branches -Wformat-truncation=2 -Wimplicit-fallthrough -Wrestrict -Warith-conversion -Wenum-conversion -Warray-compare -Wenum-int-mismatch -Wxor-used-as-pow  CMakeFiles/cmTC_12986.dir/CheckFunctionExists.c.o -o cmTC_12986  /home/runner/boringssl/lib/libssl.a  /home/runner/boringssl/lib/libcrypto.a  /usr/lib/x86_64-linux-gnu/libz.so  -ldl && :
        /usr/bin/ld: /home/runner/boringssl/lib/libssl.a(extensions.cc.o): warning: relocation against `_ZTVSt9exception' in read-only section `.text._ZNSt9exceptionC2Ev[_ZNSt9exceptionC5Ev]'
        /usr/bin/ld: /home/runner/boringssl/lib/libssl.a(encrypted_client_hello.cc.o): in function `std::unique_ptr<bssl::ECHServerConfig, bssl::internal::Deleter>* std::__do_uninit_copy<std::move_iterator<std::unique_ptr<bssl::ECHServerConfig, bssl::internal::Deleter>*>, std::unique_ptr<bssl::ECHServerConfig, bssl::internal::Deleter>*>(std::move_iterator<std::unique_ptr<bssl::ECHServerConfig, bssl::internal::Deleter>*>, std::move_iterator<std::unique_ptr<bssl::ECHServerConfig, bssl::internal::Deleter>*>, std::unique_ptr<bssl::ECHServerConfig, bssl::internal::Deleter>*)':
        /usr/include/c++/13/bits/stl_uninitialized.h:123:(.text._ZSt16__do_uninit_copyISt13move_iteratorIPSt10unique_ptrIN4bssl15ECHServerConfigENS2_8internal7DeleterEEES7_ET0_T_SA_S9_[_ZSt16__do_uninit_copyISt13move_iteratorIPSt10unique_ptrIN4bssl15ECHServerConfigENS2_8internal7DeleterEEES7_ET0_T_SA_S9_]+0x7f): undefined reference to `__cxa_begin_catch'
        /usr/bin/ld: /usr/include/c++/13/bits/stl_uninitialized.h:126:(.text._ZSt16__do_uninit_copyISt13move_iteratorIPSt10unique_ptrIN4bssl15ECHServerConfigENS2_8internal7DeleterEEES7_ET0_T_SA_S9_[_ZSt16__do_uninit_copyISt13move_iteratorIPSt10unique_ptrIN4bssl15ECHServerConfigENS2_8internal7DeleterEEES7_ET0_T_SA_S9_]+0x97): undefined reference to `__cxa_rethrow'
        /usr/bin/ld: /usr/include/c++/13/bits/stl_uninitialized.h:123:(.text._ZSt16__do_uninit_copyISt13move_iteratorIPSt10unique_ptrIN4bssl15ECHServerConfigENS2_8internal7DeleterEEES7_ET0_T_SA_S9_[_ZSt16__do_uninit_copyISt13move_iteratorIPSt10unique_ptrIN4bssl15ECHServerConfigENS2_8internal7DeleterEEES7_ET0_T_SA_S9_]+0xa3): undefined reference to `__cxa_end_catch'
        /usr/bin/ld: /home/runner/boringssl/lib/libssl.a(encrypted_client_hello.cc.o):(.data.rel.local.DW.ref.__gxx_personality_v0[DW.ref.__gxx_personality_v0]+0x0): undefined reference to `__gxx_personality_v0'
        /usr/bin/ld: /home/runner/boringssl/lib/libssl.a(extensions.cc.o): in function `std::exception::exception()':
        /usr/include/c++/13/bits/exception.h:62:(.text._ZNSt9exceptionC2Ev[_ZNSt9exceptionC5Ev]+0xf): undefined reference to `vtable for std::exception'
        /usr/bin/ld: /home/runner/boringssl/lib/libssl.a(extensions.cc.o): in function `std::bad_optional_access::~bad_optional_access()':
        /usr/include/c++/13/optional:102:(.text._ZNSt19bad_optional_accessD2Ev[_ZNSt19bad_optional_accessD5Ev]+0x26): undefined reference to `std::exception::~exception()'
        /usr/bin/ld: /home/runner/boringssl/lib/libssl.a(extensions.cc.o): in function `std::bad_optional_access::~bad_optional_access()':
        /usr/include/c++/13/optional:102:(.text._ZNSt19bad_optional_accessD0Ev[_ZNSt19bad_optional_accessD5Ev]+0x29): undefined reference to `operator delete(void*, unsigned long)'
        /usr/bin/ld: /home/runner/boringssl/lib/libssl.a(extensions.cc.o): in function `std::__throw_bad_optional_access()':
        /usr/include/c++/13/optional:111:(.text._ZSt27__throw_bad_optional_accessv[_ZSt27__throw_bad_optional_accessv]+0x13): undefined reference to `__cxa_allocate_exception'
        /usr/bin/ld: /usr/include/c++/13/optional:111:(.text._ZSt27__throw_bad_optional_accessv[_ZSt27__throw_bad_optional_accessv]+0x41): undefined reference to `__cxa_throw'
        /usr/bin/ld: /home/runner/boringssl/lib/libssl.a(extensions.cc.o): in function `std::bad_variant_access::~bad_variant_access()':
        /usr/include/c++/13/variant:1329:(.text._ZNSt18bad_variant_accessD2Ev[_ZNSt18bad_variant_accessD5Ev]+0x26): undefined reference to `std::exception::~exception()'
        /usr/bin/ld: /home/runner/boringssl/lib/libssl.a(extensions.cc.o): in function `std::bad_variant_access::~bad_variant_access()':
        /usr/include/c++/13/variant:1329:(.text._ZNSt18bad_variant_accessD0Ev[_ZNSt18bad_variant_accessD5Ev]+0x29): undefined reference to `operator delete(void*, unsigned long)'
        /usr/bin/ld: /home/runner/boringssl/lib/libssl.a(extensions.cc.o): in function `std::__throw_bad_variant_access(char const*)':
        /usr/include/c++/13/variant:1349:(.text._ZSt26__throw_bad_variant_accessPKc[_ZSt26__throw_bad_variant_accessPKc]+0x17): undefined reference to `__cxa_allocate_exception'
        /usr/bin/ld: /usr/include/c++/13/variant:1349:(.text._ZSt26__throw_bad_variant_accessPKc[_ZSt26__throw_bad_variant_accessPKc]+0x45): undefined reference to `__cxa_throw'
        /usr/bin/ld: /home/runner/boringssl/lib/libssl.a(extensions.cc.o): in function `std::variant<bssl::SSLImportedPSK, std::unique_ptr<bssl::SSLSession, bssl::internal::Deleter> >* std::__do_uninit_copy<std::move_iterator<std::variant<bssl::SSLImportedPSK, std::unique_ptr<bssl::SSLSession, bssl::internal::Deleter> >*>, std::variant<bssl::SSLImportedPSK, std::unique_ptr<bssl::SSLSession, bssl::internal::Deleter> >*>(std::move_iterator<std::variant<bssl::SSLImportedPSK, std::unique_ptr<bssl::SSLSession, bssl::internal::Deleter> >*>, std::move_iterator<std::variant<bssl::SSLImportedPSK, std::unique_ptr<bssl::SSLSession, bssl::internal::Deleter> >*>, std::variant<bssl::SSLImportedPSK, std::unique_ptr<bssl::SSLSession, bssl::internal::Deleter> >*)':
        /usr/include/c++/13/bits/stl_uninitialized.h:123:(.text._ZSt16__do_uninit_copyISt13move_iteratorIPSt7variantIJN4bssl14SSLImportedPSKESt10unique_ptrINS2_10SSLSessionENS2_8internal7DeleterEEEEESA_ET0_T_SD_SC_[_ZSt16__do_uninit_copyISt13move_iteratorIPSt7variantIJN4bssl14SSLImportedPSKESt10unique_ptrINS2_10SSLSessionENS2_8internal7DeleterEEEEESA_ET0_T_SD_SC_]+0x7f): undefined reference to `__cxa_begin_catch'
        /usr/bin/ld: /usr/include/c++/13/bits/stl_uninitialized.h:126:(.text._ZSt16__do_uninit_copyISt13move_iteratorIPSt7variantIJN4bssl14SSLImportedPSKESt10unique_ptrINS2_10SSLSessionENS2_8internal7DeleterEEEEESA_ET0_T_SD_SC_[_ZSt16__do_uninit_copyISt13move_iteratorIPSt7variantIJN4bssl14SSLImportedPSKESt10unique_ptrINS2_10SSLSessionENS2_8internal7DeleterEEEEESA_ET0_T_SD_SC_]+0x97): undefined reference to `__cxa_rethrow'
        /usr/bin/ld: /usr/include/c++/13/bits/stl_uninitialized.h:123:(.text._ZSt16__do_uninit_copyISt13move_iteratorIPSt7variantIJN4bssl14SSLImportedPSKESt10unique_ptrINS2_10SSLSessionENS2_8internal7DeleterEEEEESA_ET0_T_SD_SC_[_ZSt16__do_uninit_copyISt13move_iteratorIPSt7variantIJN4bssl14SSLImportedPSKESt10unique_ptrINS2_10SSLSessionENS2_8internal7DeleterEEEEESA_ET0_T_SD_SC_]+0xa3): undefined reference to `__cxa_end_catch'
        /usr/bin/ld: /home/runner/boringssl/lib/libssl.a(extensions.cc.o):(.data.rel.ro._ZTISt18bad_variant_access[_ZTISt18bad_variant_access]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
        /usr/bin/ld: /home/runner/boringssl/lib/libssl.a(extensions.cc.o):(.data.rel.ro._ZTISt18bad_variant_access[_ZTISt18bad_variant_access]+0x10): undefined reference to `typeinfo for std::exception'
        /usr/bin/ld: /home/runner/boringssl/lib/libssl.a(extensions.cc.o):(.data.rel.ro._ZTISt19bad_optional_access[_ZTISt19bad_optional_access]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
        /usr/bin/ld: /home/runner/boringssl/lib/libssl.a(extensions.cc.o):(.data.rel.ro._ZTISt19bad_optional_access[_ZTISt19bad_optional_access]+0x10): undefined reference to `typeinfo for std::exception'
        /usr/bin/ld: /home/runner/boringssl/lib/libssl.a(ssl_cert.cc.o): in function `std::unique_ptr<bssl::SSLCredential, bssl::internal::Deleter>* std::__do_uninit_copy<std::move_iterator<std::unique_ptr<bssl::SSLCredential, bssl::internal::Deleter>*>, std::unique_ptr<bssl::SSLCredential, bssl::internal::Deleter>*>(std::move_iterator<std::unique_ptr<bssl::SSLCredential, bssl::internal::Deleter>*>, std::move_iterator<std::unique_ptr<bssl::SSLCredential, bssl::internal::Deleter>*>, std::unique_ptr<bssl::SSLCredential, bssl::internal::Deleter>*)':
        /usr/include/c++/13/bits/stl_uninitialized.h:123:(.text._ZSt16__do_uninit_copyISt13move_iteratorIPSt10unique_ptrIN4bssl13SSLCredentialENS2_8internal7DeleterEEES7_ET0_T_SA_S9_[_ZSt16__do_uninit_copyISt13move_iteratorIPSt10unique_ptrIN4bssl13SSLCredentialENS2_8internal7DeleterEEES7_ET0_T_SA_S9_]+0x7f): undefined reference to `__cxa_begin_catch'
        /usr/bin/ld: /usr/include/c++/13/bits/stl_uninitialized.h:126:(.text._ZSt16__do_uninit_copyISt13move_iteratorIPSt10unique_ptrIN4bssl13SSLCredentialENS2_8internal7DeleterEEES7_ET0_T_SA_S9_[_ZSt16__do_uninit_copyISt13move_iteratorIPSt10unique_ptrIN4bssl13SSLCredentialENS2_8internal7DeleterEEES7_ET0_T_SA_S9_]+0x97): undefined reference to `__cxa_rethrow'
        /usr/bin/ld: /usr/include/c++/13/bits/stl_uninitialized.h:123:(.text._ZSt16__do_uninit_copyISt13move_iteratorIPSt10unique_ptrIN4bssl13SSLCredentialENS2_8internal7DeleterEEES7_ET0_T_SA_S9_[_ZSt16__do_uninit_copyISt13move_iteratorIPSt10unique_ptrIN4bssl13SSLCredentialENS2_8internal7DeleterEEES7_ET0_T_SA_S9_]+0xa3): undefined reference to `__cxa_end_catch'
        /usr/bin/ld: /home/runner/boringssl/lib/libssl.a(ssl_credential.cc.o): in function `bssl::Array<unsigned char>* std::__do_uninit_copy<std::move_iterator<bssl::Array<unsigned char>*>, bssl::Array<unsigned char>*>(std::move_iterator<bssl::Array<unsigned char>*>, std::move_iterator<bssl::Array<unsigned char>*>, bssl::Array<unsigned char>*)':
        /usr/include/c++/13/bits/stl_uninitialized.h:123:(.text._ZSt16__do_uninit_copyISt13move_iteratorIPN4bssl5ArrayIhEEES4_ET0_T_S7_S6_[_ZSt16__do_uninit_copyISt13move_iteratorIPN4bssl5ArrayIhEEES4_ET0_T_S7_S6_]+0x7f): undefined reference to `__cxa_begin_catch'
        /usr/bin/ld: /usr/include/c++/13/bits/stl_uninitialized.h:126:(.text._ZSt16__do_uninit_copyISt13move_iteratorIPN4bssl5ArrayIhEEES4_ET0_T_S7_S6_[_ZSt16__do_uninit_copyISt13move_iteratorIPN4bssl5ArrayIhEEES4_ET0_T_S7_S6_]+0x97): undefined reference to `__cxa_rethrow'
        /usr/bin/ld: /usr/include/c++/13/bits/stl_uninitialized.h:123:(.text._ZSt16__do_uninit_copyISt13move_iteratorIPN4bssl5ArrayIhEEES4_ET0_T_S7_S6_[_ZSt16__do_uninit_copyISt13move_iteratorIPN4bssl5ArrayIhEEES4_ET0_T_S7_S6_]+0xa3): undefined reference to `__cxa_end_catch'
        /usr/bin/ld: /home/runner/boringssl/lib/libssl.a(ssl_key_share.cc.o): in function `bssl::(anonymous namespace)::ECKeyShare::~ECKeyShare()':
        /home/runner/work/curl/curl/boringssl-0.20260929.0/ssl/ssl_key_share.cc:42:(.text+0x27db): undefined reference to `operator delete(void*, unsigned long)'
        /usr/bin/ld: /home/runner/boringssl/lib/libssl.a(ssl_key_share.cc.o): in function `bssl::(anonymous namespace)::X25519KeyShare::~X25519KeyShare()':
        /home/runner/work/curl/curl/boringssl-0.20260929.0/ssl/ssl_key_share.cc:139:(.text+0x28c1): undefined reference to `operator delete(void*, unsigned long)'
        /usr/bin/ld: /home/runner/boringssl/lib/libssl.a(ssl_key_share.cc.o): in function `bssl::(anonymous namespace)::X25519MLKEM768KeyShare::~X25519MLKEM768KeyShare()':
        /home/runner/work/curl/curl/boringssl-0.20260929.0/ssl/ssl_key_share.cc:196:(.text+0x29a7): undefined reference to `operator delete(void*, unsigned long)'
        /usr/bin/ld: /home/runner/boringssl/lib/libssl.a(ssl_key_share.cc.o): in function `bssl::(anonymous namespace)::MLKEM1024KeyShare::~MLKEM1024KeyShare()':
        /home/runner/work/curl/curl/boringssl-0.20260929.0/ssl/ssl_key_share.cc:289:(.text+0x2a8d): undefined reference to `operator delete(void*, unsigned long)'
        /usr/bin/ld: /home/runner/boringssl/lib/libssl.a(ssl_key_share.cc.o): in function `bssl::SSLKeyShare::~SSLKeyShare()':
        /home/runner/work/curl/curl/boringssl-0.20260929.0/ssl/internal.h:909:(.text._ZN4bssl11SSLKeyShareD0Ev[_ZN4bssl11SSLKeyShareD5Ev]+0x29): undefined reference to `operator delete(void*, unsigned long)'
        /usr/bin/ld: /home/runner/boringssl/lib/libssl.a(ssl_key_share.cc.o):(.data.rel.ro+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
        /usr/bin/ld: /home/runner/boringssl/lib/libssl.a(ssl_key_share.cc.o):(.data.rel.ro+0x18): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
        /usr/bin/ld: /home/runner/boringssl/lib/libssl.a(ssl_key_share.cc.o):(.data.rel.ro+0x30): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
        /usr/bin/ld: /home/runner/boringssl/lib/libssl.a(ssl_key_share.cc.o):(.data.rel.ro+0x48): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
        /usr/bin/ld: /home/runner/boringssl/lib/libssl.a(ssl_key_share.cc.o):(.data.rel.ro._ZTIN4bssl11SSLKeyShareE[_ZTIN4bssl11SSLKeyShareE]+0x0): undefined reference to `vtable for __cxxabiv1::__class_type_info'
        /usr/bin/ld: /home/runner/boringssl/lib/libssl.a(ssl_lib.cc.o): in function `bssl::ALPSConfig* std::__do_uninit_copy<std::move_iterator<bssl::ALPSConfig*>, bssl::ALPSConfig*>(std::move_iterator<bssl::ALPSConfig*>, std::move_iterator<bssl::ALPSConfig*>, bssl::ALPSConfig*)':
        /usr/include/c++/13/bits/stl_uninitialized.h:123:(.text._ZSt16__do_uninit_copyISt13move_iteratorIPN4bssl10ALPSConfigEES3_ET0_T_S6_S5_[_ZSt16__do_uninit_copyISt13move_iteratorIPN4bssl10ALPSConfigEES3_ET0_T_S6_S5_]+0x7f): undefined reference to `__cxa_begin_catch'
        /usr/bin/ld: /usr/include/c++/13/bits/stl_uninitialized.h:126:(.text._ZSt16__do_uninit_copyISt13move_iteratorIPN4bssl10ALPSConfigEES3_ET0_T_S6_S5_[_ZSt16__do_uninit_copyISt13move_iteratorIPN4bssl10ALPSConfigEES3_ET0_T_S6_S5_]+0x97): undefined reference to `__cxa_rethrow'
        /usr/bin/ld: /usr/include/c++/13/bits/stl_uninitialized.h:123:(.text._ZSt16__do_uninit_copyISt13move_iteratorIPN4bssl10ALPSConfigEES3_ET0_T_S6_S5_[_ZSt16__do_uninit_copyISt13move_iteratorIPN4bssl10ALPSConfigEES3_ET0_T_S6_S5_]+0xa3): undefined reference to `__cxa_end_catch'
        /usr/bin/ld: /home/runner/boringssl/lib/libssl.a(ssl_lib.cc.o): in function `bssl::CertCompressionAlg* std::__do_uninit_copy<std::move_iterator<bssl::CertCompressionAlg*>, bssl::CertCompressionAlg*>(std::move_iterator<bssl::CertCompressionAlg*>, std::move_iterator<bssl::CertCompressionAlg*>, bssl::CertCompressionAlg*)':
        /usr/include/c++/13/bits/stl_uninitialized.h:123:(.text._ZSt16__do_uninit_copyISt13move_iteratorIPN4bssl18CertCompressionAlgEES3_ET0_T_S6_S5_[_ZSt16__do_uninit_copyISt13move_iteratorIPN4bssl18CertCompressionAlgEES3_ET0_T_S6_S5_]+0x7f): undefined reference to `__cxa_begin_catch'
        /usr/bin/ld: /usr/include/c++/13/bits/stl_uninitialized.h:126:(.text._ZSt16__do_uninit_copyISt13move_iteratorIPN4bssl18CertCompressionAlgEES3_ET0_T_S6_S5_[_ZSt16__do_uninit_copyISt13move_iteratorIPN4bssl18CertCompressionAlgEES3_ET0_T_S6_S5_]+0x97): undefined reference to `__cxa_rethrow'
        /usr/bin/ld: /usr/include/c++/13/bits/stl_uninitialized.h:123:(.text._ZSt16__do_uninit_copyISt13move_iteratorIPN4bssl18CertCompressionAlgEES3_ET0_T_S6_S5_[_ZSt16__do_uninit_copyISt13move_iteratorIPN4bssl18CertCompressionAlgEES3_ET0_T_S6_S5_]+0xa3): undefined reference to `__cxa_end_catch'
        /usr/bin/ld: /home/runner/boringssl/lib/libssl.a(tls13_enc.cc.o): in function `bssl::(anonymous namespace)::NullRecordNumberEncrypter::~NullRecordNumberEncrypter()':
        /home/runner/work/curl/curl/boringssl-0.20260929.0/ssl/tls13_enc.cc:300:(.text+0x4c75): undefined reference to `operator delete(void*, unsigned long)'
        /usr/bin/ld: /home/runner/boringssl/lib/libssl.a(tls13_enc.cc.o): in function `bssl::(anonymous namespace)::AES128RecordNumberEncrypter::~AES128RecordNumberEncrypter()':
        /home/runner/work/curl/curl/boringssl-0.20260929.0/ssl/tls13_enc.cc:257:(.text+0x4d5b): undefined reference to `operator delete(void*, unsigned long)'
        /usr/bin/ld: /home/runner/boringssl/lib/libssl.a(tls13_enc.cc.o): in function `bssl::(anonymous namespace)::AES256RecordNumberEncrypter::~AES256RecordNumberEncrypter()':
        /home/runner/work/curl/curl/boringssl-0.20260929.0/ssl/tls13_enc.cc:262:(.text+0x4e41): undefined reference to `operator delete(void*, unsigned long)'
        /usr/bin/ld: /home/runner/boringssl/lib/libssl.a(tls13_enc.cc.o): in function `bssl::(anonymous namespace)::ChaChaRecordNumberEncrypter::~ChaChaRecordNumberEncrypter()':
        /home/runner/work/curl/curl/boringssl-0.20260929.0/ssl/tls13_enc.cc:267:(.text+0x4f27): undefined reference to `operator delete(void*, unsigned long)'
        /usr/bin/ld: /home/runner/boringssl/lib/libssl.a(tls13_enc.cc.o): in function `bssl::RecordNumberEncrypter::~RecordNumberEncrypter()':
        /home/runner/work/curl/curl/boringssl-0.20260929.0/ssl/internal.h:721:(.text._ZN4bssl21RecordNumberEncrypterD0Ev[_ZN4bssl21RecordNumberEncrypterD5Ev]+0x29): undefined reference to `operator delete(void*, unsigned long)'
        /usr/bin/ld: /home/runner/boringssl/lib/libssl.a(tls13_enc.cc.o):(.data.rel.ro+0x38): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
        /usr/bin/ld: /home/runner/boringssl/lib/libssl.a(tls13_enc.cc.o):(.data.rel.ro+0x50): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
        /usr/bin/ld: /home/runner/boringssl/lib/libssl.a(tls13_enc.cc.o):(.data.rel.ro+0x68): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
        /usr/bin/ld: /home/runner/boringssl/lib/libssl.a(tls13_enc.cc.o):(.data.rel.ro+0x80): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
        /usr/bin/ld: /home/runner/boringssl/lib/libssl.a(tls13_enc.cc.o):(.data.rel.ro+0x98): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
        /usr/bin/ld: /home/runner/boringssl/lib/libssl.a(tls13_enc.cc.o):(.data.rel.ro._ZTIN4bssl21RecordNumberEncrypterE[_ZTIN4bssl21RecordNumberEncrypterE]+0x0): undefined reference to `vtable for __cxxabiv1::__class_type_info'
        /usr/bin/ld: /home/runner/boringssl/lib/libssl.a(s3_both.cc.o): in function `std::__sv_check(unsigned long, unsigned long, char const*)':
        /usr/include/c++/13/string_view:73:(.text._ZSt10__sv_checkmmPKc[_ZSt10__sv_checkmmPKc]+0x41): undefined reference to `std::__throw_out_of_range_fmt(char const*, ...)'
        /usr/bin/ld: /home/runner/boringssl/lib/libcrypto.a(evp_ctx.cc.o): in function `bssl::EvpPkeyCtx::~EvpPkeyCtx()':
        /home/runner/work/curl/curl/boringssl-0.20260929.0/crypto/evp/evp_ctx.cc:126:(.text+0x59d): undefined reference to `operator delete(void*, unsigned long)'
        /usr/bin/ld: warning: creating DT_TEXTREL in a PIE
        collect2: error: ld returned 1 exit status
        ninja: build stopped: subcommand failed.

      exitCode: 1
```

https://github.com/curl/curl/actions/runs/36613110493/job/109559244983
@vszakats vszakats added the cmake label Sep 29, 2026
@vszakats vszakats changed the title cmake: enable C++ library for GCC too in AWS-LC/BoringSSL static builds cmake: enable C++ library for GCC in AWS-LC/BoringSSL static builds Sep 29, 2026
@github-actions github-actions Bot added the CI Continuous Integration label Sep 29, 2026
```
CMakeLists.txt:812,06: [C0103] Invalid directory variable name
"_CURL_STDLIB_CXX" doesn't match
`([A-Z][0-9A-Z_]+|[A-Z][A-Za-z0-9]+_FOUND|[a-z]+_SOURCES|prefix|exec_prefix|includedir|libdir|ssize_t|_FILE_OFFSET_BITS)|_[0-9a-z_]+`
```
https://github.com/curl/curl/actions/runs/36627708841/job/109608838376
This reverts commit 740d4ff.
@github-actions github-actions Bot added the build label Sep 29, 2026
@vszakats vszakats closed this in 39c8f9d Sep 29, 2026
@vszakats
vszakats deleted the cm-cxx-gcc branch September 29, 2026 21:04
vszakats added a commit that referenced this pull request Sep 29, 2026
BoringSSL builds static libs by default. Switch to this default and
adjust curl build options to link with it correctly, with default GCC.

Slight downside is that libcurl must be built statically also, to avoid:
```
/usr/bin/ld: /home/runner/boringssl/lib/libssl.a(extensions.cc.o): warning: relocation against `_ZTVSt18bad_variant_access' in read-only section `.text._ZNSt18bad_variant_accessD2Ev[_ZNSt18bad_variant_accessD5Ev]'
/usr/bin/ld: /home/runner/boringssl/lib/libssl.a(extensions.cc.o): relocation R_X86_64_PC32 against symbol `_ZTVSt9exception@@GLIBCXX_3.4' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: bad value
```
(libcurl is already built with `-fPIC`.)

BoringSSL remains built and linked as shared library in GHA/http3-linux.

Follow-up to 39c8f9d #23179

Closes #23177
@dg0yt

dg0yt commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

Normally you don't need to poorly guess the C++ lib name: It is (in) the difference between CMAKE_C_IMPLICIT_LINK_LIBRARIES and CMAKE_CXX_IMPLICIT_LINK_LIBRARIES.
(That's how vcpkg successfully carries C++ linkage through pc files for static libary linkage.)

@vszakats

Copy link
Copy Markdown
Member Author

Normally you don't need to poorly guess the C++ lib name: It is (in) the difference between CMAKE_C_IMPLICIT_LINK_LIBRARIES and CMAKE_CXX_IMPLICIT_LINK_LIBRARIES. (That's how vcpkg successfully carries C++ linkage through pc files for static libary linkage.)

Thanks, I'll check that. One downside comes to mind: for the CXX
variable to get filled by CMake, curl needs to add C++ as a project
language, and require setting this toolchain up accordingly, even
though the project itself doesn't require C++ (or the toolchain), only
the C++ lib for this dependency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build CI Continuous Integration cmake

Development

Successfully merging this pull request may close these issues.

2 participants