This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: problems compiling a program with -m32


On Dec 1, 2007 6:54 AM, darvish <mastapeel@hotmail.com> wrote:
>
> 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.

First, this is off-topic for this list, use gcc-help for this kind of
questions.  Second,
you probably miss the gcc-32bit package.

Richard.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]