Problem for compiling 32-bit application using -m32 on 64-bit CentOS ...

Issues related to applications and software problems
Post Reply
Cyberman
Posts: 14
Joined: 2009/05/17 13:04:09

Problem for compiling 32-bit application using -m32 on 64-bit CentOS ...

Post by Cyberman » 2012/07/16 04:04:18

CentOS 6.2 x86_64
GCC 4.4.6

glibc installed:
glibc-2.12-1.47.el6.x86_64
glibc-headers-2.12-1.47.el6.x86_64
glibc-common-2.12-1.47.el6.x86_64
compat-glibc-headers-2.5-46.2.x86_64
compat-glibc-2.5-46.2.x86_64
glibc-2.12-1.47.el6.i686
glibc-utils-2.12-1.47.el6.x86_64
glibc-devel-2.12-1.47.el6.x86_64


Program code:
[code]
int main(int argc, char *argv[])
{
return 0;
}
[/code]

Compiling output:
[code]
$ gcc -m32 m32-test.c -o m32-test
/usr/bin/ld: crt1.o: No such file: No such file or directory
collect2: ld returned 1 exit status
[/code]

'crt1.o' searching result:
[code]
# find /lib64 /lib /usr/lib64 /usr/lib -name "crt1.o"
/usr/lib64/crt1.o
/usr/lib/x86_64-redhat-linux5E/lib64/crt1.o
[/code]

It seems maybe I sould install some libraies? But I don't know how to figure out them.
I installed some 32-bit binary software and they work.

User avatar
jlehtone
Posts: 2057
Joined: 2007/12/11 08:17:33
Location: Finland

Problem for compiling 32-bit application using -m32 on 64-bi

Post by jlehtone » 2012/07/16 07:25:37

Find cannot find what you don't have. Try:
[code]yum whatprovides */crt1.o[/code]
You are missing glibc-devel.i686 (and possibly some other i686 packages).

Curatica
Posts: 1
Joined: 2014/09/26 03:21:04

Re: Problem for compiling 32-bit application using -m32 on 6

Post by Curatica » 2014/09/26 03:29:17

Code: Select all

yum whatprovides */crt1.o
was a lifesaver for me.

Thanks to jlehtone!

dkam175
Posts: 1
Joined: 2016/05/29 08:59:32

Re: Problem for compiling 32-bit application using -m32 on 64-bi

Post by dkam175 » 2016/05/29 09:02:37

jlehtone wrote:Find cannot find what you don't have. Try:

Code: Select all

yum whatprovides */crt1.o
You are missing glibc-devel.i686 (and possibly some other i686 packages).
THIS WORKED for me after several hours of searching on:
configure:4990: checking whether gcc -m32 works
configure:5010: error: Cannot build a 32-bit program, you need to install 32-bit development libraries.

Big thanks!

Post Reply