Nabla
Nabla copied to clipboard
Make sure Shared Library Load order is respected on Linux/POSIX
Description
On Windows we're forced to use Delay Load DLLs to make sure we try directories in the right order (current config build dir, current config & build install dir, next to EXE, then fallback to system-wide) https://github.com/Devsh-Graphics-Programming/Nabla/blob/master/include/nbl/system/IApplicationFramework.h#L19
But on Linux there exists RPATH https://github.com/Devsh-Graphics-Programming/Nabla/blob/master/include/nbl/system/IApplicationFramework.h#L30
Description of the related problem
I'm not a linux expert so I don't know if:
- One can set different RPATHs on a per-library basis
- Whether one can have a chain of fallback RPATHS to try before trying
/usr/libor whatever the systemwide dir is - Whether RPATH needs to be a thing on a shared library that uses another (i.e. Nabla loading DXC) or on the very final executable (ELF)
Solution proposal
Find out if RPATH can be leveraged, else find out how to delay load on Linux without manually writing "import library" glue code.
Additional context
This is to enable us to have NBL_BUILD_SHARED across Windows and Linux