Page 1 of 1

Compile for 32-bit on 64-bit CentOS 7

Posted: 2018/02/13 20:27:10
by yueqing
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

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

Posted: 2018/02/13 21:11:18
by avij
Your /lib/libc.so.6 might be corrupted. See if yum reinstall glibc.i686 helps.

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

Posted: 2018/02/13 23:40:39
by yueqing
avij wrote:Your /lib/libc.so.6 might be corrupted. See if yum reinstall glibc.i686 helps.
Thanks avij! That worked!