You are not logged in.

#1 2011-03-04 14:22:45

b0g
Member
Registered: 2011-02-18
Posts: 5

linking 32bit c and assembly object files on arch

Hello,
i have arch installed as a 64bit system, i am currently trying (to do my homework) which require me to link a code in c and a piece in assembly,
i have 2 files :
main.c
ass0.s

i assembled ass0 running : (i need it to be 32bit also tried with -f elf (instead of elf32)

nasm -f elf32 ass0.s -o ass0.o

and tried linking both files :

gcc -m32 main.c ass0.o -o ass0.out

and i get

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

i understand it's something to do with my gcc being 64bit, is there any package i need to install ?
i'm pretty much stuck any insights are greatly appreciated..

thanks !

Offline

#2 2011-03-04 14:36:59

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: linking 32bit c and assembly object files on arch

You'll need to enable the multilib repo and install gcc-multilib

Offline

#3 2011-03-04 14:37:45

b0g
Member
Registered: 2011-02-18
Posts: 5

Re: linking 32bit c and assembly object files on arch

thanks.. it work now

Offline

Board footer

Powered by FluxBB