LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-11-2012, 10:08 AM   #1
jonatan
LQ Newbie
 
Registered: Sep 2012
Distribution: CentOS 5
Posts: 8

Rep: Reputation: Disabled
CentOS 5.8 64-bit - cannot execute 32-bit binaries


Hi,

I am working on a customized version of CentOS 5.8 x86_64 (basically a minimal install with a handful of plugins and applications). Although it suffers from a serious lack of documentation I need to use this particular machine to run some tests. To add to that I am restricted to SSH for access.

The problem is that trying to run anything in the /lib/ or /usr/lib/ directories results in the error: "cannot execute binary file"

I saw it first when running an installer that depended on several 32-bit libraries. I can provide more details on the installation attempt if needed. The reason I need 32-bit binaries to run is that the installer itself is a binary whose instructions I cannot change. Here's the full dependency list (queried with ldd on a CentOS 5.8 system with functioning 32-bit libraries):
Code:
linux-gate.so.1 =>  (0xffffe000)
libdl.so.2 => /lib/libdl.so.2 (0x00c5e000)
librt.so.1 => /lib/librt.so.1 (0x00c65000)
libpthread.so.0 => /lib/libpthread.so.0 (0x00c42000)
libc.so.6 => /lib/libc.so.6 (0x00ae5000)
/lib/ld-linux.so.2 (0x00ac6000)

# ls -l /lib/ld-linux.so.2
lrwxrwxrwx 1 root root 9 Nov 20 17:45 /lib/ld-linux.so.2 -> ld-2.5.so
Potentially useful information:
Code:
# uname -a
Linux xxx 2.6.36-1.xx  x86_64 x86_64 x86_64 GNU/Linux

# /lib/ld-2.5.so
-bash: /lib/ld-2.5.so: cannot execute binary file

# file /lib/ld-2.5.so
/lib/ld-2.5.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), from 'tart', not stripped

#  ldd /lib/ld-2.5.so
/usr/bin/ldd: line 161: /lib/ld-linux.so.2: cannot execute binary file
        not a dynamic executable
After some extensive Google hiking I narrowed it down to a 32-bit emulation support issue. Sure enough, the source had been compiled without 32-bit emulation.

I recompiled it like this:
Code:
# cd /usr/src/linux
# make menuconfig
In the menu, under Executable file formats/Emulations I ticked IA32 Emulation and IA32 a.out support (with *, not M). Then
Code:
# make && make modules
# make module_install && make
Then a reboot, but it didn't solve the problem (is there anything important I missed here?)

I then removed packages compat-libstdc++, compat-glibc and libgcc, and glibc-2.5-42.i686 with yum remove, rebooted and then:
Code:
# yum reinstall glibc
Running Transaction
  Erasing        : glibc                                                    1/4
  Installing     : glibc                                                    1/4
error: %post(glibc-2.5-81.el5_8.7.i686) scriptlet failed, exit status 255
  Erasing        : glibc                                                    2/4
  Installing     : glibc                                                    2/4
Removed:
glibc.i686 0:2.5-81.el5_8.7
glibc.x86_64 0:2.5-81.el5_8.7
Installed:
glibc.i686 0:2.5-81.el5_8.7
glibc.x86_64 0:2.5-81.el5_8.7
I found a scriplet failed error reported here:
http://help.lockergnome.com/linux/RP...ict377592.html
and suggestions to disable SELinux, but it is already disabled.

I also used yum to install the packages compat-glibc, compat-libstdc++-296, compat-libstdc++-33 and glibc-devel as suggested on forums (https://bbs.archlinux.org/viewtopic.php?id=145568, http://www.linuxquestions.org/questi...378/page2.html)

as well as
Code:
# yum groupinstall "Legacy Software Support"
as suggested here: http://serverfault.com/questions/289...t-applications
adding compat-libgcc-296 and compat-libstdc++-296

Here's a list of the packages installed after the recompile:
Code:
compat-glibc-2.3.4-2.26
compat-glibc-headers-2.3.4-2.26
compat-glibc-2.3.4-2.26
compat-libgcc-296-2.96-138
compat-libstdc++-296-2.96-138
compat-libstdc++-33-3.2.3-61
compat-libstdc++-33-3.2.3-61
glibc-common-2.5-81.el5_8.7
glibc-devel-2.5-81.el5_8.7
glibc-devel-2.5-81.el5_8.7
glibc-2.5-81.el5_8.7
glibc-2.5-81.el5_8.7
glibc-headers-2.5-81.el5_8.7
I also tried
Code:
# /sbin/ldconfig
as suggested here: http://www.linuxquestions.org/questi...-linux-386030/

Am I headed in the right direction here?

Are there any other settings/packages I can look for with regards to 32-bit binaries on CentOS 64-bit?
 
Old 12-12-2012, 01:27 AM   #2
jonatan
LQ Newbie
 
Registered: Sep 2012
Distribution: CentOS 5
Posts: 8

Original Poster
Rep: Reputation: Disabled
Answering my own question: Yes, something went wrong when compiling. Very silly, I missed the "install" at the end the second line:
Code:
# make && make modules
# make module_install && make
It should be
Code:
# make module_install && make install
Running the correct command and rebooting solved the problem.

Last edited by jonatan; 12-12-2012 at 02:24 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] 32 bit binaries do not run on 64 bit machine frznchckn Linux - Software 51 02-28-2011 12:20 PM
LXer: Install HVM FreeBSD 7.0 DomU (32-bit) at Xen 3.2.1 CentOS 5.1 Dom0 (64-bit) LXer Syndicated Linux News 0 05-01-2008 08:00 PM
running 64-bit binaries on 32-bit Linux? cyberfishee Linux - Software 5 01-25-2008 05:12 AM
LXer: Install Xen 3.1 Solaris domU (64 bit) under CentOS 5 dom0 (64 bit) LXer Syndicated Linux News 0 09-21-2007 12:00 AM
32-bit binaries on 64-bit linux? vidar_nelson Linux - Software 3 11-26-2005 02:43 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:59 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration