mellinoe / vk

Low-level Vulkan bindings for .NET.
Other
176 stars 35 forks source link

Link to libc instead of libdl on desktop linux #39

Open hitsounds opened 1 year ago

hitsounds commented 1 year ago

As of glibc v2.34 it is preferred to link against libc.so instead of libdl.so.

"In order to support smoother in-place-upgrades and to simplify the implementation of the runtime all functionality formerly implemented in the libraries libpthread, libdl, libutil, libanl has been integrated into libc" (src: https://sourceware.org/pipermail/libc-alpha/2021-August/129718.html).

Some distributions don't provide a libdl.so symlink any more which is causing issues.

Ideally merge #40 before this to fix the build as well.

Related issues: https://github.com/mellinoe/veldrid/issues/143 https://github.com/ppy/osu/issues/22956

Tacodiva commented 10 months ago

For .NET versions which have it (IE not dotnet standard 1.4), System.Runtime.InteropServices.NativeLibrary should really be used. That will use whatever the dotnet runtime is using as its linker so it should be much more reliable than trying hard-code the dynamic linker for each platform. You can see how I use it in my fork here.