You are not logged in.

#1 2012-07-22 00:35:36

deadguys
Member
Registered: 2011-09-20
Posts: 6

[SOLVED] Cannot run 32-bit executables

Hi All,

I'm trying to build a program as a 32-bit binary on my x86_64 machine and run it locally.  The program is:

// test.c

int main(void) {
  return 0;
}

Everything works as expected when building for 64-bit:

$ /usr/bin/gcc test.c
$ file a.out 
a.out: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=0x30e6ad62aa6052e7e6fedd7aca341036b2c3927d, not stripped
$ ldd a.out 
        linux-vdso.so.1 (0x00007fffecbce000)
        libc.so.6 => /lib/libc.so.6 (0x00007f1c4cdfb000)
        /lib/ld-linux-x86-64.so.2 (0x00007f1c4d19f000)
$ ./a.out 
$

32-bit doesn't work, though:

$ /usr/bin/gcc -m32 test.c
$ file a.out 
a.out: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=0x36c22ccf4fba70042ed49700f3bb2c54c347be5b, not stripped
$ ldd a.out 
        not a dynamic executable
$ ./a.out 
bash: ./a.out: No such file or directory

I have gcc-multilib and lib32-glibc installed.  Any ideas what the problem is?

Thanks!

Last edited by deadguys (2012-07-22 00:56:17)

Offline

#2 2012-07-22 00:38:52

deadguys
Member
Registered: 2011-09-20
Posts: 6

Re: [SOLVED] Cannot run 32-bit executables

Quick update:  it looks like I can't run any 32-bit programs, e.g. skype.  I used to be able to, and recently updated, so I guess that probably has something to do with it...

Offline

#3 2012-07-22 00:42:33

progandy
Member
Registered: 2012-05-17
Posts: 5,190

Re: [SOLVED] Cannot run 32-bit executables

Try to reinstall lib32-glibc. You need to have /lib/ld-linux.so.2 (or symlink /lib -> /usr/lib and /usr/lib/ld-linux.so.2)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#4 2012-07-22 00:55:31

deadguys
Member
Registered: 2011-09-20
Posts: 6

Re: [SOLVED] Cannot run 32-bit executables

Thanks! /lib is not symlinked to /usr/lib, but I symlinked:

 # ln -s /usr/lib/ld-linux.so.2 /lib/ld-linux.so.2

Which did the trick.

Offline

#5 2012-07-22 00:58:29

progandy
Member
Registered: 2012-05-17
Posts: 5,190

Re: [SOLVED] Cannot run 32-bit executables

deadguys wrote:

Thanks! /lib is not symlinked to /usr/lib

Then your glibc is not up to date.


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

Board footer

Powered by FluxBB