Skip to content
Snippets Groups Projects

runtime: Create libraries aliases in overrides

Merged Ludovico de Nittis requested to merge wip/lib_aliases into master
1 unresolved thread

If a library has different SONAMEs, called aliases in "steam-runtime-abi.json", it might lead to errors when a game tries to load a SONAME that is not the "real" library SONAME (the DT_SONAME that objdump shows). Because ld.so.cache will not consider the aliases when searching for the right match.

To workaround this problem we create a directory called "aliases" that contains symlinks of the libraries aliases that we know about.

By adding these directories, one for every multiarch, in the LD_LIBRARY_PATH, we ensure that even games that were linked to an alias will be able to find the library they were looking for.

Helps: https://github.com/ValveSoftware/steam-runtime/issues/246 Fixes: T26816

Merge request reports

Merge request pipeline #10298 passed

Merge request pipeline passed for 39a0cacd

Merged by Simon McVittieSimon McVittie 4 years ago (Mar 16, 2021 4:01pm UTC)

Loading

Pipeline #10300 passed

Pipeline passed for 027f908a on master

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
    • Inside the container we end up with:

      [ryuzaki@ryuzaki ~]$ ls -l /overrides/lib/x86_64-linux-gnu/aliases/
      lrwxrwxrwx 1 ryuzaki ryuzaki 33 Mar 12 16:27 libXaw7.so.7 -> /lib/x86_64-linux-gnu/libXaw.so.7
      lrwxrwxrwx 1 ryuzaki ryuzaki 35 Mar 12 16:27 libbz2.so.1 -> /lib/x86_64-linux-gnu/libbz2.so.1.0
      lrwxrwxrwx 1 ryuzaki ryuzaki 41 Mar 12 16:27 libcurl-gnutls.so.3 -> /lib/x86_64-linux-gnu/libcurl-gnutls.so.4
      lrwxrwxrwx 1 ryuzaki ryuzaki 34 Mar 12 16:27 libcurl.so.3 -> /lib/x86_64-linux-gnu/libcurl.so.4
      lrwxrwxrwx 1 ryuzaki ryuzaki 40 Mar 12 16:27 libldap-2.4.so.2 -> /lib/x86_64-linux-gnu/libldap_r-2.4.so.2
      lrwxrwxrwx 1 ryuzaki ryuzaki 33 Mar 12 16:27 libvpx.so.1.0 -> /lib/x86_64-linux-gnu/libvpx.so.1
      
      [ryuzaki@ryuzaki ~]$ ls -l /overrides/lib/i386-linux-gnu/aliases/  
      lrwxrwxrwx 1 ryuzaki ryuzaki 31 Mar 12 16:27 libXaw7.so.7 -> /lib/i386-linux-gnu/libXaw.so.7
      lrwxrwxrwx 1 ryuzaki ryuzaki 33 Mar 12 16:27 libbz2.so.1 -> /lib/i386-linux-gnu/libbz2.so.1.0
      lrwxrwxrwx 1 ryuzaki ryuzaki 39 Mar 12 16:27 libcurl-gnutls.so.3 -> /lib/i386-linux-gnu/libcurl-gnutls.so.4
      lrwxrwxrwx 1 ryuzaki ryuzaki 32 Mar 12 16:27 libcurl.so.3 -> /lib/i386-linux-gnu/libcurl.so.4
      lrwxrwxrwx 1 ryuzaki ryuzaki 38 Mar 12 16:27 libldap-2.4.so.2 -> /lib/i386-linux-gnu/libldap_r-2.4.so.2
      lrwxrwxrwx 1 ryuzaki ryuzaki 31 Mar 12 16:27 libvpx.so.1.0 -> /lib/i386-linux-gnu/libvpx.so.1
      
      [ryuzaki@ryuzaki ~]$ env | grep LD_LIB
      LD_LIBRARY_PATH=/overrides/lib/x86_64-linux-gnu:/overrides/lib/x86_64-linux-gnu/aliases:/overrides/lib/i386-linux-gnu:/overrides/lib/i386-linux-gnu/aliases:/run/media/hdd/Steam Games/steamapps/common/Torchlight II
    • And with a library taken from the host system:

      [ryuzaki@ryuzaki ~]$ ls -l /overrides/lib/x86_64-linux-gnu/aliases/
      lrwxrwxrwx 1 ryuzaki ryuzaki 33 Mar 12 16:32 libXaw7.so.7 -> /lib/x86_64-linux-gnu/libXaw.so.7
      lrwxrwxrwx 1 ryuzaki ryuzaki 35 Mar 12 16:32 libbz2.so.1 -> /lib/x86_64-linux-gnu/libbz2.so.1.0
      lrwxrwxrwx 1 ryuzaki ryuzaki 41 Mar 12 16:32 libcurl-gnutls.so.3 -> /lib/x86_64-linux-gnu/libcurl-gnutls.so.4
      lrwxrwxrwx 1 ryuzaki ryuzaki 34 Mar 12 16:32 libcurl.so.3 -> /lib/x86_64-linux-gnu/libcurl.so.4
      lrwxrwxrwx 1 ryuzaki ryuzaki 40 Mar 12 16:32 libldap-2.4.so.2 -> /lib/x86_64-linux-gnu/libldap_r-2.4.so.2
      lrwxrwxrwx 1 ryuzaki ryuzaki 33 Mar 12 16:32 libvpx.so.1.0 -> /lib/x86_64-linux-gnu/libvpx.so.1
      lrwxrwxrwx 1 ryuzaki ryuzaki 50 Mar 12 16:32 libxcb-xfixes-custom-alias.so.0 -> /overrides/lib/x86_64-linux-gnu/libxcb-xfixes.so.0
    • Please register or sign in to reply
  • Simon McVittie
  • Simon McVittie
  • added 1 commit

    • 12990166 - runtime: Create library aliases in overrides

    Compare with previous version

  • This mostly looks good, just one bit of wrong error handling.

  • added Enhancement ~37 labels

  • added 6 commits

    Compare with previous version

  • Simon McVittie mentioned in commit 027f908a

    mentioned in commit 027f908a

  • Please register or sign in to reply
    Loading