livekit / rust-sdks

LiveKit realtime and server SDKs for Rust
https://livekit.io
Apache License 2.0
212 stars 57 forks source link

fix {Open,Boring}SSL conflicts #376

Closed nbsp closed 3 months ago

nbsp commented 4 months ago

uses objcopy to rename all exported BoringSSL symbols, prepending LK_ to them, so that they don't conflict with native OpenSSL on the Rust side.

previous PR description before figuring this out below.


PR for review. trying a different approach than manually patching in the list (though that's still available & commented out), since even when it finally built (90 minute patch time!) it fixed nothing.

the BoringSSL build doc gives us an option to prefix all BSSL symbols with whatever we want, in our case LK. i've punched that into the BUILD.gn file, and it builds just fine in this diff, but the basic_room linking fails with a lot of the following error

/usr/bin/ld: openssl_adapter.cc:(.text+0x7f): undefined reference to `LK_i2d_X509' # and similar symbols

even after i've manually gone in and updated the files to use LK_-prefixed symbols, they just don't link. fresh building environment. i don't know exactly how it would compile by itself (clearly no undefined symbols) and then fail at the basic_room link phase.

kuba-- commented 3 months ago

Definitivelly awesome work!!! And looks like it all works (also if I add extra isahc which uses curl+openssl).