Compile for 32-bit on 64-bit CentOS 7

Issues related to applications and software problems
yueqing
Posts: 2
Joined: 2018/02/13 20:18:22

Compile for 32-bit on 64-bit CentOS 7

Postby yueqing » 2018/02/13 20:27:10

Hi all,

Want to use my centOS 7 to compile for 32-bit application using gcc. I have gcc 4.9.2 installed on my virtualbox.

When I tried to compile a simple C program,

#gcc hello.c -m32 -o hello

it gives the following error,

#/lib/libc.so.6: file not recognized: File truncated
#collect2: error: ld returned 1 exit status

Any suggestions? Thanks.

Qing

User avatar
avij
Forum Moderator
Posts: 2272
Joined: 2010/12/01 19:25:52
Location: Helsinki, Finland
Contact:

Re: Compile for 32-bit on 64-bit CentOS 7

Postby avij » 2018/02/13 21:11:18

Your /lib/libc.so.6 might be corrupted. See if yum reinstall glibc.i686 helps.

yueqing
Posts: 2
Joined: 2018/02/13 20:18:22

Re: Compile for 32-bit on 64-bit CentOS 7

Postby yueqing » 2018/02/13 23:40:39

avij wrote:Your /lib/libc.so.6 might be corrupted. See if yum reinstall glibc.i686 helps.


Thanks avij! That worked!