litespeedtech / lsquic

LiteSpeed QUIC and HTTP/3 Library
MIT License
1.53k stars 333 forks source link

Failing to build on Ubuntu 24.04 #507

Open ar-ag opened 2 months ago

ar-ag commented 2 months ago

I have installed the latest version of BoringSSL and of lsquic

After successfully building BoringSSL, i tried building lsquic

cmake -DBORINGSSL_DIR=$BORINGSSL .

above command ran successfully, however running make command generated the following error

[ 33%] Linking C executable http_server
/usr/bin/ld: /home/ar-ag/projects/QUICforge/boringssl/ssl/libssl.a(ssl_asn1.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/ar-ag/projects/QUICforge/boringssl/ssl/libssl.a(ssl_key_share.cc.o): in function `bssl::(anonymous namespace)::ECKeyShare::~ECKeyShare()':
/home/ar-ag/projects/QUICforge/boringssl/ssl/ssl_key_share.cc:42:(.text+0x2039): undefined reference to `operator delete(void*, unsigned long)'
/usr/bin/ld: /home/ar-ag/projects/QUICforge/boringssl/ssl/libssl.a(ssl_key_share.cc.o): in function `bssl::(anonymous namespace)::X25519KeyShare::~X25519KeyShare()':
/home/ar-ag/projects/QUICforge/boringssl/ssl/ssl_key_share.cc:139:(.text+0x211f): undefined reference to `operator delete(void*, unsigned long)'
/usr/bin/ld: /home/ar-ag/projects/QUICforge/boringssl/ssl/libssl.a(ssl_key_share.cc.o): in function `bssl::(anonymous namespace)::X25519Kyber768KeyShare::~X25519Kyber768KeyShare()':
/home/ar-ag/projects/QUICforge/boringssl/ssl/ssl_key_share.cc:195:(.text+0x2205): undefined reference to `operator delete(void*, unsigned long)'
/usr/bin/ld: /home/ar-ag/projects/QUICforge/boringssl/ssl/libssl.a(ssl_key_share.cc.o): in function `bssl::SSLKeyShare::~SSLKeyShare()':
/home/ar-ag/projects/QUICforge/boringssl/ssl/internal.h:1114:(.text._ZN4bssl11SSLKeyShareD0Ev[_ZN4bssl11SSLKeyShareD5Ev]+0x29): undefined reference to `operator delete(void*, unsigned long)'
/usr/bin/ld: /home/ar-ag/projects/QUICforge/boringssl/ssl/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/ar-ag/projects/QUICforge/boringssl/ssl/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/ar-ag/projects/QUICforge/boringssl/ssl/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/ar-ag/projects/QUICforge/boringssl/ssl/libssl.a(ssl_key_share.cc.o):(.data.rel.ro._ZTIN4bssl11SSLKeyShareE[_ZTIN4bssl11SSLKeyShareE]+0x0): undefined reference to `vtable for __cxxabiv1::__class_type_info'
collect2: error: ld returned 1 exit status
make[2]: *** [bin/CMakeFiles/http_server.dir/build.make:150: bin/http_server] Error 1
make[1]: *** [CMakeFiles/Makefile2:289: bin/CMakeFiles/http_server.dir/all] Error 2
make: *** [Makefile:146: all] Error 2
olokelo commented 1 month ago

Hello,

Not sure if that helps but I was building Nginx with BoringSSL support and also encountered the issue. In my case adding -lssl -lcrypto -lstdc++ to --with-ld-opt parameter when building Nginx seems to resolve the issue.

So my configure command now looks something like this

./configure ... --with-openssl="$BUILDROOT/boringssl" --with-cc-opt="-I${BUILDROOT}/boringssl/include" --with-ld-opt="-L${BUILDROOT}/boringssl/build/ssl -L${BUILDROOT}/boringssl/build/crypto -lssl -lcrypto -lstdc++"