This is the mail archive of the crossgcc@cygnus.com mailing list for the crossgcc project.


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

Re: Linux->Cygwin->PowerPC.


Brendan Simon wrote:

> The next stage is to build a Cygwin->PowerPC cross-compiler using the
> above cross-compiler.  I gave configure the --target=powerpc-eabi and
> --host=i586-cygwin32 options and tried to build binutils-2.9.1.  It
> succeeded and installed in the correct place with .exe extensions.  I
> thought great !! but then I thought I would try to execute them on the
> linux box and they did.  eg powerpc-eabi-ar -V gave me the version
> number etc.

 Are you sure you haven't equivalently named Linux binaries earlier in your 
PATH?  Using commands like './powerpc-eabi-ar.exe -V' in the directory where 
the binary is now doesn't hurt... If you leaved the '.exe' out of the 
command name, it just cannot be the right one, but a 'powerpc-eabi-ar' 
somewhere in your PATH. The '.exe' means nothing special in Linux.

 The Linux-command 'file' will tell the file type:

    $ file powerpc-eabi-ar.exe

 Anyway, you MUST have the Linux-to-powerpc-eabi cross-toolset before you can 
try the Cygwin-to-powerpc-eabi. The Canadian Cross needs THREE toolsets: the 
native, for the host and for the target, all running in your Linux system...

 The target toolset is needed to build libraries like 'libgcc.a', 'libstdc++.a' 
etc. for the target under Linux. Building them again, when you already have the 
libs with the Linux-hosted toolset is of course just a waste of time (or a 
means to check that everything seems ok -- if the generated libs are identical 
with the earlier ones...)
 
> I thinking setting CC_FOR_TARGET=i586-cygwin32-gcc will work.  I guess
> all other XXX_FOR_TARGET would need to be setup correctly as well.  I
> thought that specifying --host=i586-cygwin32 would do all this for me.
> Any ideas what I'm doing wrong.

 The XXX_FOR_TARGET are for the '--target=your-coming-target', just as 
the name says, the YYY_FOR_BUILD are for the '--build=your-build-host' and the 
ZZZ without no postfix are for the '--host=your-coming-host'. Telling all the
necessary things to configure in a pre-made 'config_cygwin-to-ppc-eabi' script:

 CC=i586-cygwin32-gcc \
 AR=i586-cygwin32-ar \
 RANLIB=i586-cygwin32-ranlib \
 NM=i586-cygwin32-nm \
 CFLAGS=-O \
 CXXFLAGS=-O2 \
 CC_FOR_BUILD=gcc \
 AR_FOR_BUILD=ar \
 ...........
 ...........
 RANLIB_FOR_TARGET=powerpc-eabi-ranlib \
 NM_FOR_TARGET=powerpc-eabi-nm \
 ./configure --build=i586-linux-gnu --host=i586-cygwin32 --target=powerpc-eabi

and using the script for the configuring doesn't hurt... It serves as a 
template for your further Canadian Crosses...

Cheers, Kai
_______________________________________________
New CrossGCC FAQ: http://www.objsw.com/CrossGCC
_______________________________________________
To remove yourself from the crossgcc list, send
mail to crossgcc-request@cygnus.com with the
text 'unsubscribe' (without the quotes) in the
body of the message.

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