WebFaction
Community site: login faq

I'm having a bit of a struggle with steamcmd.sh from the Linux command line version of Steam claiming

/lib/ld-linux.so.2: bad ELF interpreter: No such file or directory

When I played with a CentOS 6 virtual machine I had to install glibc.686 via yum which is not an option here. I managed to get ld-linux.so.2 into ~/lib by modifying http://community.webfaction.com/questions/6584/cant-install-irssi-glib-not-found#6586 as such:

mkdir ~/src  
cd ~/src  
wget http://mirror.centos.org/centos/6/os/x86_64/Packages/glibc-2.12-1.107.el6.i686.rpm  
rpm2cpio glibc-2.12-1.107.el6.i686.rpm | cpio -idmv --no-absolute-filenames

I then moved all the files from ~/src/lib/ to ~/lib/

Also played around with adding ~/src/lib/ to LD_ LIBRARY_PATH however since ld-linux.so.2 is the library loader it throws the same error.

Is it possible to somehow convince Steam to use the ld-linux.so.2 in my home directory?

asked 25 Jun '13, 02:54

bitspill
31310
accept rate: 0%


Allow me to preface this by stating that this will be somewhat of an uphill battle.

The Steam binary is a 32-bit executable and we do not really run a multiarch system. So, you will probably need to install many 32-bit libraries into $HOME/lib first of all, and then "export LD_LIBRARY_PATH=$HOME/lib".

This could take awhile as you encounter one unsatisfied dependency after another. One way to expedite this may be to install a 32-bit CentOS 6 server inside of a virtual machine locally, so that you can copy libraries from it. But then you could have path issues in some of them, which will need to be recompiled in your home directory (ensure that your username in the VM is the same as the username on WebFaction, so that the paths match!)

That's all well and good, if frustrating, but what about the ld-linux.so.2 in your home directory? The way to tell a program which interpreter to use can only be done by actually modifying that binary itself. The program to use for this is called PatchELF.

I have two builds of this program which are 100% static executables, one for 32-bit systems and one for 64-bit systems, so they should "just work" on nearly any system:

Just "chmod 755 ./patchelf" and "./patchelf" to run it.

So, if your own ld-linux.so.2 is at /home/myuser/lib/ld-linux.so.2, you would (for example):

./patchelf --set-interpreter '/home/myuser/lib/ld-linux.so.2' $HOME/bin/steam

which will modify the binary to use your interpreter. You can also set an rpath to choose a default search path for shared libraries:

./patchelf --set-rpath '/home/myuser/lib:' $HOME/bin/steam

but in my experience, I still find setting LD_LIBRARY_PATH necessary in practice (corner cases).

Hope that helps!

permanent link

answered 25 Jun '13, 04:02

ryans ♦♦
5.0k83159
accept rate: 43%

Oh, thanks it's making progress, now I'm onto error while loading shared libraries: libgcc_s.so.1 I'll work my way through these dependencies and post back here if I get hung up again.

(25 Jun '13, 04:19) bitspill

Well, luckily that was as far as the dependencies went so far, but I did have to re-run patchelf a few times as the auto-updater was undoing the patch when it replaced the original executable however it is now running successfully

(25 Jun '13, 04:30) bitspill
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×6
×1
×1

question asked: 25 Jun '13, 02:54

question was seen: 4,688 times

last updated: 25 Jun '13, 04:30

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2016 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM