Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure Shared Library Load order is respected on Linux/POSIX #474

Open
devshgraphicsprogramming opened this issue Mar 10, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@devshgraphicsprogramming
Copy link
Member

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:

  1. One can set different RPATHs on a per-library basis
  2. Whether one can have a chain of fallback RPATHS to try before trying /usr/lib or whatever the systemwide dir is
  3. 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant