bflattened / bflat

C# as you know it but with Go-inspired tooling (small, selfcontained, and native executables)
GNU Affero General Public License v3.0
3.64k stars 103 forks source link

Story for libssl and ICU on Linux #3

Closed MichalStrehovsky closed 1 year ago

MichalStrehovsky commented 3 years ago

Libssl is loaded dynamically through dlopen https://github.com/dotnet/runtimelab/blob/06f08facc0e0efbaff755dd5957485edf2771ea7/src/libraries/Native/Unix/System.Security.Cryptography.Native/opensslshim.c#L53-L134.

The same problem for ICU.

This doesn't work because of #2. We either need to fix #2 or rewrite this to link statically.

BrannonKing commented 3 years ago

I've statically compiled ICU into lbrycrd for several years. Maybe you can get a clue on that here: https://github.com/lbryio/lbrycrd/blob/master/depends/packages/icu.mk

Same story for openssl: https://github.com/lbryio/lbrycrd/blob/v19_master/depends/packages/openssl.mk

The boost file there shows the linking attributes. Namely:

$(package)_ldflags_mingw32=-lsicuio -lsicuuc -lsicudt
$(package)_ldflags_linux=-licuio -licuuc -licudata -licui18n
$(package)_ldflags_darwin=-licuio -licuuc -licudata -licui18n
MichalStrehovsky commented 1 year ago

I'll leave this as-is. Hardcoding libssl comes with drawbacks - each distro configures libssl differently and this would be a pain to e.g. have working certificate paths for https.