libmongocrypt wants to know the path for a loaded library, seemingly to compare if a library is already loaded (_validate_csfle_singleton). It has an implementation for Windows, macOS, and Linux (though this uses dlinfo which is also available on Solaris and *BSD, AFAIK). However, if there is no implementation, then it'll fail the build with an error. I'm building for AIX, so this is where I hit it.
I looked into implementing this on AIX myself, but it did seem pretty tricky. dlopen returns an opaque ID that starts from zero and increments. Now, dladdr can be implemented in terms of calling a function that gets all loaded libraries (loadquery with L_GETINFO) and checking if the pointer is in their text/data ranges. However, dlinfo uses the value of dlopen, and the structure returned by loadquery that doesn't contain the IDs that libdl uses internally. I really want to avoid reaching into dynamic linker internals if I don't have to.
An alternative might be to make it so that not having this function doesn't count as a hard error, and if not available, skip the validation logic. It'd be a lot easier than trying to implement it on all platforms, and I don't think it's that critical anyways.
- related to
-
MONGOCRYPT-603 Don't return a compile error if dll_path unsupported
- Closed