Compiling 32-bit applications on 64-bit Hardy

Sonal Santan sonal.santan at gmail.com
Sat Jul 26 14:57:07 UTC 2008


Hello,

I am trying to a compile a simple 32 bit hello world C application on my 
x86_64 Hardy. gcc provides a switch -m32 to generate code for x86 using 
a x86_64 gcc. However, compilation or rather linking fails with the 
following message:

/usr/bin/ld: skipping incompatible 
/usr/lib/gcc/x86_64-linux-gnu/4.2.3/libgcc.a when searching for -lgcc
/usr/bin/ld: skipping incompatible 
/usr/lib/gcc/x86_64-linux-gnu/4.2.3/libgcc.a when searching for -lgcc
/usr/bin/ld: cannot find -lgcc
collect2: ld returned 1 exit status

If I take out the -m32 switch, I get a regular 64 bit binary without any 
issues.

Package lib32gcc1 is installed on my machine. However, it does not 
provide the missing 32 bit version of libgcc.a. Is gcc -m32 option 
supported on Hardy? I know this works on RHEL 5.2.

Sonal

 








More information about the ubuntu-users mailing list