How to test win32->PowerPC(860) cross complier
Vermeulen Jan
Jan.Vermeulen@siemens.atea.be
Mon Sep 3 01:02:00 GMT 2001
Hello again Mohammed.
Glad to see that you managed to build the cross tools :)
<...>
>
>and as a resutl of this I got the following files
>under
>/usr/local/powerpc-unknown-eabi/bin :
>*********************************
>total 8597
>-rwxr-xr-x 2 Administ None 1150092 Sep 2
>12:08 ar.exe
>-rwxr-xr-x 2 Administ None 1714881 Sep 2
>12:09 as.exe
>-rw-r--r-- 1 Administ None 0 Sep 2
>2001 files.txt
>-rwxr-xr-x 1 Administ None 190088 Sep 2
>12:37 gcc.exe
>-rwxr-xr-x 2 Administ None 1701451 Sep 2
>12:09 ld.exe
>-rwxr-xr-x 2 Administ None 1252422 Sep 2
>12:08 nm.exe
>-rwxr-xr-x 2 Administ None 1150604 Sep 2
>12:08 ranlib.exe
>-rwxr-xr-x 2 Administ None 1640233 Sep 2
>12:08 strip.exe
>*******************************************************
>Now I want the cross compiler to produce code for
>powerPC860.
>
>I have built compiler for powerpc-unknown-eabi.
>First, I don,t know how to tell the gcc to produce
>code for powerPC860.
You should also find
"powerpc-unknown-eabi-<something>" under
/usr/local/bin directory.
with <something> being:
as
ld
gcc
c++
and a whole lot more.
>If I try to compile a simple hello world application
>
>I get the following error message:
<snip of errors>
GCC is your native compiler (to produce windows executables in your case, as
you are using cygwin).
If you wish to compile for another target, you have to say :
[your prompt]$ powerpc-unknown-eabi-gcc -o test test.c
>If I try:
>$ gcc.exe test.c -o -mcpu=860 hello.elf 2>&1 | tee
>hello.log
>gcc.exe: hello.elf: No such file or directory
Please read the GCC manual on how to write a valid commandline :)
(see gcc.gnu.org)
The right syntax is: (as far as i know)
$ gcc.exe <general options> -o <your compiled exe-file> <your c file(s)>
so you get:
$ gcc.exe -O2 -o test.exe test.c
to compile test.c into a "test.exe" program running on your windows.
(-O2 is for optimisation)
what you are trying to do, is let the native GCC choose the back-end.
I do this the following way:
(mind you that i'm using the real thing: a *nix machine (linux in this
case), so I don't know if the same applies to cygwin)
i go into the /usr/lib/gcc-lib and I do:
$ ln -s /usr/local/lib/gcc-lib/powerpc-unknown-eabi/ ./powerpc-unknown-eabi/
If I want to choose between crosscompilers, I simply do a :
$ gcc -b m68k-coff -m68040 -o test.exe test.c
for my m68040 board
or
$ gcc -b xscale-elf -o test.exe test.c
for my xscale board
or
$ gcc -b powerpc-unknown-eabi -o test.exe test.c
for your case.
Best regards,
Jan
---
"The only way to accellerate a winnt server is at 9.81 m/s^2"
------
Want more information? See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com
More information about the crossgcc
mailing list