mirror of
https://github.com/clearlinux/linux-steam-integration.git
synced 2026-10-03 23:48:34 +00:00
shim: Set LD_PRELOAD for libredirect if enabled
Signed-off-by: Ikey Doherty <ikey@solus-project.com>
This commit is contained in:
@@ -32,6 +32,13 @@
|
||||
*/
|
||||
#define AUDIT_PATH "/usr/\$LIB/liblsi-intercept.so"
|
||||
|
||||
/**
|
||||
* Redirect path is used for the libredirect library to perform internal
|
||||
* redirections in functions like `open()` where needed to hotfix games
|
||||
* at runtime.
|
||||
*/
|
||||
#define REDIRECT_PATH "/usr/\$LIB/liblsi-redirect.so"
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
LsiConfig config = { 0 };
|
||||
@@ -67,6 +74,14 @@ int main(int argc, char **argv)
|
||||
if (config.use_libintercept) {
|
||||
setenv("LD_AUDIT", AUDIT_PATH, 1);
|
||||
}
|
||||
#endif
|
||||
#ifdef HAVE_LIBREDIRECT
|
||||
/* Only use libredirect in combination with native runtime!
|
||||
* TODO: Respect existing preload libraries?
|
||||
*/
|
||||
if (config.use_libredirect) {
|
||||
setenv("LD_PRELOAD", REDIRECT_PATH, 1);
|
||||
}
|
||||
#endif
|
||||
} else {
|
||||
/* Only preload when needed. */
|
||||
|
||||
Reference in New Issue
Block a user