problems compiling a program with -m32
darvish
mastapeel@hotmail.com
Sat Dec 1 05:54:00 GMT 2007
Hey, I'm running openSUSE 2.6.22.12-0.1-default with x86_64.
I have several files: pizza.asm, driver.c and asm_io.o
What I'm trying to do is to compile all these files to a single executable
file pizza, I use the following command:
nasm -g -f elf -d ELF_TYPE pizza.asm
gcc -m32 -o pizza -g driver.c pizza.o asm_io.o
and I get this whenever I execute the gcc line:
/usr/lib64/gcc/x86_64-suse-linux/4.2.1/../../../../x86_64-suse-linux/bin/ld:
skipping incompatible /usr/lib64/gcc/x86_64-suse-linux/4.2.1/libgcc.a when
searching for -lgcc
/usr/lib64/gcc/x86_64-suse-linux/4.2.1/../../../../x86_64-suse-linux/bin/ld:
cannot find -lgcc
collect2: ld returned 1 exit status
I tried to compile it again without the -m32 parameter and I get:
/usr/lib64/gcc/x86_64-suse-linux/4.2.1/../../../../x86_64-suse-linux/bin/ld:
i386 architecture of input file `pizza.o' is incompatible with i386:x86-64
output
/usr/lib64/gcc/x86_64-suse-linux/4.2.1/../../../../x86_64-suse-linux/bin/ld:
i386 architecture of input file `asm_io.o' is incompatible with i386:x86-64
output
collect2: ld returned 1 exit status
I don't understand...what am I doing wrong and how can I get pizza.o and
asm_io.o file to link with my 64bit architecture. I'd appreciate any help,
thanks.
--
View this message in context: http://www.nabble.com/problems-compiling-a-program-with--m32-tf4927203.html#a14102516
Sent from the gcc - Dev mailing list archive at Nabble.com.
More information about the Gcc
mailing list