Shared-Library Dependency Resolution This header contains all the relevant functions for resolving shared-libraries needed by ELF binaries. It does this through through threaded calls to LDD. Unlike Python-SB, SB++ computes dependencies in one shot, including both wildcards and directories. Therefore, there is no need for additional computation upon calling setup(), it can simply copy the found files to the SOF. LDD is the major bottle neck for speed, and thus the two implementations are comparable on speed on library resolution.
More...
|
|
using | lib_t = shared::set |
| |
|
|
std::filesystem::path | cache_name (std::string library, const std::string &function) |
| |
|
void | parse_ldd (lib_t &required, const std::string &library, const std::string_view &directory) |
| |
| void | get (lib_t &libraries, const std::string_view &library, std::string directory="") |
| | Recursively resolve all shared-libraries needed by a library.
|
| |
|
void | setup (const vector &libraries, const std::string_view &application, const std::filesystem::path &app_sof) |
| |
| void | setup (const shared::set &libraries, const std::string_view &application, const std::filesystem::path &app_sof) |
| | Setup an SOF directory.
|
| |
| void | symlink (shared::vector &command) |
| | Add symlink commands.
|
| |
|
std::filesystem::path | hash_cache (const std::string_view &program, const std::string &hash) |
| |
|
std::filesystem::path | hash_sof (const std::string_view &program, const std::string &hash) |
| |
|
template<class C> |
| void | resolve (const C &required, const std::string_view &program, const std::string &l_hash, const bool &exclude=true) |
| |
Shared-Library Dependency Resolution This header contains all the relevant functions for resolving shared-libraries needed by ELF binaries. It does this through through threaded calls to LDD. Unlike Python-SB, SB++ computes dependencies in one shot, including both wildcards and directories. Therefore, there is no need for additional computation upon calling setup(), it can simply copy the found files to the SOF. LDD is the major bottle neck for speed, and thus the two implementations are comparable on speed on library resolution.
◆ get()
| void libraries::get |
( |
lib_t & | libraries, |
|
|
const std::string_view & | library, |
|
|
std::string | directory = "" ) |
Recursively resolve all shared-libraries needed by a library.
- Parameters
-
| library | The path to the library. |
| directory | The sub-directory within /usr/lib. Used internally. |
- Returns
- : A set of all shared libraries used by the program and its dependencies.
- Note
- library can be any executable file, such as binaries in /usr/bin, but only shared-libraries in /usr/lib will be included in the return.
◆ setup()
| void libraries::setup |
( |
const shared::set & | libraries, |
|
|
const std::string_view & | application, |
|
|
const std::filesystem::path & | app_sof ) |
Setup an SOF directory.
- Parameters
-
| libraries | The libraries to copy into the SOF |
| sof | The path to the SOF directory |
| application | The name of the app. |
| command | The command vector to append the needed bwrap args to link to the SOF. |
◆ symlink()
| void libraries::symlink |
( |
shared::vector & | command | ) |
|
Add symlink commands.
- Parameters
-
| command | The command to append to |
| application | The running application. |
- Note
- This function symlinks /lib /lib64 and /usr/lib64 to /usr/lib, where the SOF is mounted