Remove need for libc6-dev on known linux runtimes #208
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The current mechanism to dynamically load the PKCS#11 library on Linux (and macOS) requires
libc6-dev
to be installed on the target systems. It also requires the methodsdlopen
& co to be present in thelibld
library.On some linux flavors (e.g. Ubuntu 22.04)
dlopen
& co were moved fromlibld
tolibc
. Other systems may not havelibc6-dev
installed at all.This PR proposes to leverage the runtimes packaging of the required functions to mitigate those (potential) issues. The solution is inspired by the dynamic loading implementation of the grpc library found here: https://github.com/grpc/grpc/blob/be80a7047bc5a2be19b994756060fda4d779d141/src/csharp/Grpc.Core/Internal/UnmanagedLibrary.cs
Merging this PR would allow the usage of the Pkcs#11Interop library on Ubuntu 22.04 and other linux flavors with atypical placement of the functions required to dynamically load libraries.