Skip to content

Conversation

@v1993
Copy link

@v1993 v1993 commented Sep 4, 2025

Adds a workaround based on discussion in #315. Seems like Steam's overlay somehow conflicts with olmod. This allows launching olmod directly from Steam by setting "Launch options" of Overload to

"${STEAM_COMPAT_INSTALL_PATH}/olmod.sh" # %command%

@derhass
Copy link
Member

derhass commented Oct 12, 2025

@CCraigen @v1993

This breaks starting if the path to olmod contains spaces. But the problem is not the actual steam fix. The problem is just changing the hardcoded ./olmod.so in LD_PRELOAD to ${olmodso} which contains the full path. And it turns out that in LD_PRELOAD, spaces can be used to separate entries for historical reasons (I found this https://stackoverflow.com/a/10073337/2327517 )

So for an installation like mine (using the default ~/GOG Games GOG install path), this breaks:

0009mh@ixtlilton$  ./olmod.sh  -gamedir /home/mh/GOG\ Games/Overload/game
ERROR: ld.so: object '/home/mh/GOG' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object 'Games/Overload/olmod-dev/olmod.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.

This is probably also the reason Arne must have hardcoded the ./olmod there in the first place. However, for the actual intended changes of this fix, this is irrelevant, one could easily change the ${olmodso} back to ./olmod.so.

For the actual Steam Overlay part: I don't have steam so I can't verify this, but I don't see any reason this would not work. I personally don't like the idea of resetting LD_PRELOAD completely, but I wouldn't mind as long as it stays inside that if [[ -v SteamAppId ]]; branch, so it doesn't affect me (because I need to additionally preload my glxhook, and sometimes I also want to be able to run olmod through renderdoc).

@derhass
Copy link
Member

derhass commented Oct 12, 2025

I can't directly push anything to this PR, but I made a recommended change: derhass@b33ab0c

@v1993 can you confirm that this change would also still work in Steam, or is the issue that Steam doesn't run olmod from the proper working directory and the full path is necessary? If that is the case, one could add the olmod directory to LD_LIBRARY_PATH.

@v1993
Copy link
Author

v1993 commented Oct 13, 2025

Sorry I didn't get a chance to test yet; I also probably should see if it's detecting properly when running under steam as a non-Steam game since some people have trouble getting the game working otherwise (missing system libraries compared to steam runtime, etc.).

If it's presence of a : that disables spaces as delimiters, couldn't you just add one at the beginning, i.e. olpreload=":${olmodso}"? Actually, I think steam does that for its own preload path and I've wondered why is that empty entry there.

@derhass
Copy link
Member

derhass commented Oct 13, 2025

@v1993

If it's presence of a : that disables spaces as delimiters,

No, it doesn't. I tried it. Space and colons are both used as separators, interchangeably. The manpage also doesn't suggest anything other in that regard:

https://man.archlinux.org/man/ld.so.8.en

LD_PRELOAD
A list of additional, user-specified, ELF shared objects to be loaded before all others. This feature can be used to selectively override functions in other shared objects.

The items of the list can be separated by spaces or colons, and there is no support for escaping either separator. [...]

@CCraigen
Copy link
Collaborator

Once all the details of this get figured out I'll pull it in for 0.6.

@v1993
Copy link
Author

v1993 commented Oct 19, 2025

Wouldn't this already be a problem when running with an empty LD_PRELOAD from a directory that contains spaces in path (without Steam)? Seems like it's more or less an existing issue. That said, using LD_LIBRARY_PATH looks like the best solution. I'll implement that.

Should help with paths with spaces in them.
@v1993
Copy link
Author

v1993 commented Oct 20, 2025

Switched to LD_LIBRARY_PATH; please re-test. Also confirmed that when running as a non-Steam game SteamAppId is set (to zero) so detection still works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants