View Issue Details

IDProjectCategoryView StatusLast Update
0031560RunnerUbuntu (YYC)Public2020-02-27 12:21
ReporterPatrick RocheAssigned ToRussell Kay 
PriorityMediumSeverityB - MajorReproducibilityUnable To Reproduce
Status ResolvedResolutionFixed 
PlatformUbuntuOSOS Version
Product Version2.2.3 
Target Version2.3.0Fixed in Version2.3.0 
Summary0031560: Ubuntu YYC: Uses an incorrect default file path to libsteam_api.so
DescriptionWith Steam support enabled, the Linux executable tries, at startup, to call dlopen("libsteam_api.so") to access the Steamworks API, but this library is generally not in the system's library path, even when launched from Steam.

The packaged game ships with libsteam_api.so but this dlopen() call won't find it. The way to fix this is to have the generated executable list the executable's current directory in its rpath. You can set this at link time, and list the path as $ORIGIN instead of a real directory.

This string needs escaping to make it from the makefile to the linker correctly, so in the makefile, it should look like this:

$(COMPILER) $(COMPILEOPTS) $(LINKEROPTS) -I . -o MyProject obj/*.o -DYYLLVM libyoyo_yyc-x64.a $(LIBS) -Wl,-rpath,\$$ORIGIN

That's a backslash and two dollar signs on the new argument, which escapes it correctly for both the Makefile and the shell that will launch clang. You can verify this is correct on the final binary with the readelf command:

readelf -d ./MyProject

There will be a line in the output that looks like this if you did it correctly:

0x000000000000000f (RPATH) Library rpath: [$ORIGIN]

Once this is in the binary, dlopen("libsteam_api.so") will correctly find the Steamworks library in the same directory as the executable.
Steps To ReproduceWe have been unable to reproduce this internally.
Additional InformationThis bug is for tracking and CoreTech investigation.
TagsGM2KI, GMKI, GMSKI
1.4 Found In
2.x Runtime Found In2.2.3.344
2.x Runtime Verified In

Activities

Russell Kay

2020-01-22 16:13

Manager   ~0065318

Fixed in gitlab