Page 1 of 1

Gcc64 => 32bit

Posted: Sat Jun 11, 2005 9:14 am
by Code
Hello, i downloaded a 64bit cross gcc for cygwin.(http://aireos.com/)
Is there a compiler option to generate 32bit code ?

Re:Gcc64 => 32bit

Posted: Sat Jun 11, 2005 11:14 am
by zyp
-m32

Re:Gcc64 => 32bit

Posted: Sat Jun 11, 2005 2:09 pm
by Code
xgcc -m32 -c init.c
Assembler messages:
FATAL: can't create init.o: Invalid bfd target

Re:Gcc64 => 32bit

Posted: Sun Jun 12, 2005 2:50 am
by Pype.Clicker
i suggest you try "gcc -dumpspecs" and "ld --specs" make sure your copy of gcc/binutils support the model you're trying to use.

Re:Gcc64 => 32bit

Posted: Sun Jun 12, 2005 7:52 am
by Code
Hello, can anyone tell me how to build a cross gcc for 32bit & 64bit in one compiler on cygwin ?

Re:Gcc64 => 32bit

Posted: Sun Jun 26, 2005 6:31 am
by Code
Hello, i installed Linux Slamd64 today.
I tried use -m32 -m64 both are working with gcc.
Now i want link -m32 object file
ld -Ttext 0x10000 --oformat binary test.o

"ld: warning: i386 architecture of input file `yeah.o' is incompatible with i386:x86-64 output"

A binary file is generated.
If i compile with gcc -m32 to a.out there are no warnings

Is the generated binary file 32bit ?

Re:Gcc64 => 32bit

Posted: Sun Jun 26, 2005 6:45 am
by proxy
a good way to test what type of binary a file is with the "file" command:

example:

Code: Select all

$ file /usr/bin/test
/usr/bin/test: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.6.5, dynamically linked (uses shared libs), stripped
proxy