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

[1.x] Build failure using BoringSSL #3456

Closed
jackwilsdon opened this issue Oct 20, 2024 · 6 comments
Closed

[1.x] Build failure using BoringSSL #3456

jackwilsdon opened this issue Oct 20, 2024 · 6 comments
Labels
multistream Related to Janus 1.x

Comments

@jackwilsdon
Copy link

What version of Janus is this happening on?
1.3.0 (b092e3d)

Have you tested a more recent version of Janus too?
No, this is the latest version

Was this working before?
Yes, on older versions of BoringSSL (prior to google/boringssl@c528061).

Is there a gdb or libasan trace of the issue?

/usr/bin/ld: /opt/boringssl/lib/libssl.a(d1_lib.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: /opt/boringssl/lib/libssl.a(ssl_aead_ctx.cc.o): in function `bssl::RecordNumberEncrypter::~RecordNumberEncrypter()':
/boringssl/ssl/internal.h:1034: undefined reference to `operator delete(void*, unsigned long)'
/usr/bin/ld: /opt/boringssl/lib/libssl.a(ssl_aead_ctx.cc.o): in function `bssl::AESRecordNumberEncrypter::~AESRecordNumberEncrypter()':
/boringssl/ssl/internal.h:1178: undefined reference to `operator delete(void*, unsigned long)'
/usr/bin/ld: /opt/boringssl/lib/libssl.a(ssl_aead_ctx.cc.o): in function `bssl::AES128RecordNumberEncrypter::~AES128RecordNumberEncrypter()':
/boringssl/ssl/internal.h:1187: undefined reference to `operator delete(void*, unsigned long)'
/usr/bin/ld: /opt/boringssl/lib/libssl.a(ssl_aead_ctx.cc.o): in function `bssl::AES256RecordNumberEncrypter::~AES256RecordNumberEncrypter()':
/boringssl/ssl/internal.h:1192: undefined reference to `operator delete(void*, unsigned long)'
/usr/bin/ld: /opt/boringssl/lib/libssl.a(ssl_aead_ctx.cc.o): in function `bssl::ChaChaRecordNumberEncrypter::~ChaChaRecordNumberEncrypter()':
/boringssl/ssl/internal.h:1197: undefined reference to `operator delete(void*, unsigned long)'
/usr/bin/ld: /opt/boringssl/lib/libssl.a(ssl_aead_ctx.cc.o):(.data.rel.ro._ZTIN4bssl27ChaChaRecordNumberEncrypterE[_ZTIN4bssl27ChaChaRecordNumberEncrypterE]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
/usr/bin/ld: /opt/boringssl/lib/libssl.a(ssl_aead_ctx.cc.o):(.data.rel.ro._ZTIN4bssl27AES256RecordNumberEncrypterE[_ZTIN4bssl27AES256RecordNumberEncrypterE]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
/usr/bin/ld: /opt/boringssl/lib/libssl.a(ssl_aead_ctx.cc.o):(.data.rel.ro._ZTIN4bssl27AES128RecordNumberEncrypterE[_ZTIN4bssl27AES128RecordNumberEncrypterE]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
/usr/bin/ld: /opt/boringssl/lib/libssl.a(ssl_aead_ctx.cc.o):(.data.rel.ro._ZTIN4bssl24AESRecordNumberEncrypterE[_ZTIN4bssl24AESRecordNumberEncrypterE]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
/usr/bin/ld: /opt/boringssl/lib/libssl.a(ssl_aead_ctx.cc.o):(.data.rel.ro._ZTIN4bssl21RecordNumberEncrypterE[_ZTIN4bssl21RecordNumberEncrypterE]+0x0): undefined reference to `vtable for __cxxabiv1::__class_type_info'
/usr/bin/ld: /opt/boringssl/lib/libssl.a(s3_both.cc.o): in function `bssl::(anonymous namespace)::CNsaCipherScorer::~CNsaCipherScorer()':
/boringssl/ssl/s3_both.cc:697: undefined reference to `operator delete(void*, unsigned long)'
/usr/bin/ld: /opt/boringssl/lib/libssl.a(s3_both.cc.o): in function `bssl::(anonymous namespace)::AesHwCipherScorer::~AesHwCipherScorer()':
/boringssl/ssl/s3_both.cc:680: undefined reference to `operator delete(void*, unsigned long)'
/usr/bin/ld: /opt/boringssl/lib/libssl.a(s3_both.cc.o):(.data.rel.ro+0x28): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
/usr/bin/ld: /opt/boringssl/lib/libssl.a(s3_both.cc.o):(.data.rel.ro+0x40): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
/usr/bin/ld: /opt/boringssl/lib/libssl.a(s3_both.cc.o):(.data.rel.ro+0x58): undefined reference to `vtable for __cxxabiv1::__class_type_info'
/usr/bin/ld: /opt/boringssl/lib/libssl.a(ssl_key_share.cc.o): in function `bssl::(anonymous namespace)::ECKeyShare::~ECKeyShare()':
/boringssl/ssl/ssl_key_share.cc:43: undefined reference to `operator delete(void*, unsigned long)'
/usr/bin/ld: /opt/boringssl/lib/libssl.a(ssl_key_share.cc.o): in function `bssl::(anonymous namespace)::X25519KeyShare::~X25519KeyShare()':
/boringssl/ssl/ssl_key_share.cc:140: undefined reference to `operator delete(void*, unsigned long)'
/usr/bin/ld: /opt/boringssl/lib/libssl.a(ssl_key_share.cc.o): in function `bssl::(anonymous namespace)::X25519Kyber768KeyShare::~X25519Kyber768KeyShare()':
/boringssl/ssl/ssl_key_share.cc:197: undefined reference to `operator delete(void*, unsigned long)'
/usr/bin/ld: /opt/boringssl/lib/libssl.a(ssl_key_share.cc.o): in function `bssl::(anonymous namespace)::X25519MLKEM768KeyShare::~X25519MLKEM768KeyShare()':
/boringssl/ssl/ssl_key_share.cc:286: undefined reference to `operator delete(void*, unsigned long)'
/usr/bin/ld: /opt/boringssl/lib/libssl.a(ssl_key_share.cc.o): in function `bssl::SSLKeyShare::~SSLKeyShare()':
/boringssl/ssl/internal.h:1384: undefined reference to `operator delete(void*, unsigned long)'
/usr/bin/ld: /opt/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: /opt/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: /opt/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: /opt/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: /opt/boringssl/lib/libssl.a(ssl_key_share.cc.o):(.data.rel.ro._ZTIN4bssl11SSLKeyShareE[_ZTIN4bssl11SSLKeyShareE]+0x0): undefined reference to `vtable for __cxxabiv1::__class_type_info'

Additional context
I assume this is because BoringSSL now uses libstdc++ but janus-gateway isn't linking it.

@lminiero
Copy link
Member

We already fixed the missing linking to libstdc++ in 7d65bd9 (which was brought up to our attention in #3395). That said, I always use static builds of boringssl, not sure if using a shared build of that changes things.

@jackwilsdon
Copy link
Author

I'm able to reproduce the issue on b092e3d on Debian - I think the issue might be to do with linking using the C linker instead of the C++ linker (see https://github.com/NixOS/nixpkgs/blob/ff111f8105bf28d23615ee8bcf42b420553a5b6e/pkgs/by-name/ja/janus-gateway/package.nix#L84-L86, where it was patched in nixpkgs).

@lminiero
Copy link
Member

If you have a way to contribute the same fix to our autoconf/automake setup as a PR, I'd be happy to review it! Not sure if setting that CCLD env var would be enough in our case as well.

@ashkalor
Copy link

ashkalor commented Nov 9, 2024

Hey any updates for this?
Build is failing with boringSSL.

Update: I was able to build janus v1.2.4 successfully by doing the following

# Openssl build steps 
git clone https://boringssl.googlesource.com/boringssl
cd boringssl
# Don't barf on errors
sed -i s/" -Werror"//g CMakeLists.txt
mkdir -p build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/opt/boringssl -DCMAKE_CXX_FLAGS="-lrt" ..
make
make install 

# Janus Build steps 
 ./configure --prefix=/opt/janus --enable-post-processing --enable-boringssl --enable-dtls-settimeout
# Manually pass the CCLD parameter that is required to build with boringssl
make CCLD=c++
make CCLD=c++ install 

@lminiero
Copy link
Member

So the CCLD=c++ is the only part that's needed to get it working? In case, I'll update the BoringSSL README section to make it clearer.

@ashkalor
Copy link

ashkalor commented Nov 12, 2024

Yes, I also directly built it with a prefix instead of manually copying the files. Those were the only changes that was required to build successfully.

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

No branches or pull requests

3 participants