This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


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: Canadian cross for powerpc target and mingw host built on Linux


Yay ... someone answered.  :) 
Heh ... I was just about to quit (kidding). I'm trying to
make something out of this for the last 30 hours or so.
Anyway ...

Kai Ruottu wrote:


>> Babarovic Ivica wrote:
>>
>  
>
>>>> I'm trying to create a cross-toolchain.
>>>> Build=i386-Linux, Host=i386-mingw32 for target=powerpc-603e.
>>>> I have two toolchains. One that runs on the build system and generates
>>>> code for the host system and one that runs on the build system and
>>>> generates code for the target system.
>>>>
>>>> First one was simply installed as pre-built debian package :
>>>> mingw32 - Minimalist GNU win32 (cross) compiler
>>>> mingw32-binutils - Minimalist GNU win32 (cross) binutils
>>>> mingw32-runtime - Minimalist GNU win32 (cross) runtime
>>>> This packages were result of /Volker Grabsch work./
>>>>
>>>> Second one I created with a crosstool.
>>>>
>>>> What I don't know is how to create the final one with these two.
>>>> Is this possible with above toolchains?
>>>>   
>>    
>>
>>
>> Surely producing that MinGW hosted toolchain is possible and even very
>> easy....
>  
>

This is the part where I'm hopelessly trying to find some information on
the web. I've scanned many mailing lists and finally found a crosstoolchain
built on Linux with mingw for MSWin targets. This is the work of Volker Grabsch.

Using this crosschain and the one I created with crosstool I tried producing
a canadian cross.  Not much specific information on the web about the
process. Only in general. So I ran this configure script from my build dir:

../../crosstool-0.43/build/powerpc-603e-linux-gnu/gcc-4.1.0-glibc-2.3.6/glibc-2.3.6/configure
--build=i386-pc-linux-gnu --host=i586-pc-mingw32msvc
--target=powerpc-603e-linux-gnu --prefix=/home/ivo/work/cpu32/xchain/
--exec-prefix=/home/ivo/work/cpu32/xchain/i586-pc-mingw32msvc
--enable-languages=c,c++

I wasn't even sure what else do I need to configure/compile besides the
above compiler. I still am not sure. Make process finished with a toolchain that ran on
Windows but wasn't able to produce executables.
--------------------------------------------------------------
ivo@debian:~/work/cpu32/xchain$ ls -l
total 20
drwxr-xr-x 6 ivo ivo 4096 2007-09-05 06:09 i586-pc-mingw32msvc
drwxr-xr-x 3 ivo ivo 4096 2007-09-05 06:37 include
drwxr-xr-x 2 ivo ivo 4096 2007-09-05 06:37 info
drwxr-xr-x 4 ivo ivo 4096 2007-09-05 06:09 man
drwxr-xr-x 3 ivo ivo 4096 2007-09-05 06:09 share
ivo@debian:~/work/cpu32/xchain$

ivo@debian:~/work/cpu32/xchain$ ls -l i586-pc-mingw32msvc/bin/
total 7344
-rwxr-xr-x 2 ivo ivo 1377408 2007-09-05 06:37 powerpc-603e-linux-gnu-c++.exe
-rwxr-xr-x 1 ivo ivo 1375888 2007-09-05 06:37 powerpc-603e-linux-gnu-cpp.exe
-rwxr-xr-x 2 ivo ivo 1373806 2007-09-05 06:37 powerpc-603e-linux-gnu-gcc-4.1.0
-rwxr-xr-x 1 ivo ivo   16119 2007-09-05 06:37 powerpc-603e-linux-gnu-gccbug
-rwxr-xr-x 2 ivo ivo 1373806 2007-09-05 06:37 powerpc-603e-linux-gnu-gcc.exe
-rwxr-xr-x 1 ivo ivo  586211 2007-09-05 06:37 powerpc-603e-linux-gnu-gcov.exe
-rwxr-xr-x 2 ivo ivo 1377408 2007-09-05 06:37 powerpc-603e-linux-gnu-g++.exe

ivo@debian:~/work/cpu32/xchain$ file
i586-pc-mingw32msvc/bin/powerpc-603e-linux-gnu-gcc.exe
i586-pc-mingw32msvc/bin/powerpc-603e-linux-gnu-gcc.exe: MS-DOS
executable PE  for MS Windows (console) Intel 80386 32-bit
------------------------------------------------------------

When trying to compile simple hello-world.c program on Windows host I got:

C:\work\xchain\i586-pc-mingw32msvc\bin>powerpc-603e-linux-gnu-gcc.exe
-static -o  helloworld.exe helloworld.c
powerpc-603e-linux-gnu-gcc.exe: _spawnvp: No such file or directory


helloworld.c:
int printf (char *,...);
int main(){
    printf("hello world ...\n");
    return 0;
}


To me it was weird that I even got this far as running gcc on host box.
Please if anyone sees what I'm doing wrong here I'd apprecciate the info.



>> But if one thinks whether you are doing any sane things, one cannot be
>> sure at
>> all  :(    More info required....  So please could you answer to the
>> following simple
>> questions about sanity :
>  
>

Gladly!


>>
>> 1. what is your 'powerpc-603e-linux-gnu' target?  Is it a) already
>> existing or b) still unexisting
>  
>

Yes. It's a MPC5200 clone with some additional  periphery. A nice
embedded platform


>>
>> 2. if the target is still unexisting, as using 'crosstool' hints, what
>> on earth role that
>>    final Windoze platform would play in your plans?
>  
>

Lets just say there are people around me that still are not to
comfortable with Linux desktop. They want their IDEs, GUIs and such on
M$ system. They made a request and  I said I'll try to make something 
out of it. It's also proving to be quite a challenge for me.


>>
>> And why you think that Windoze would a suitable place to do some embedded
>> Linux development?
>  
>

Why not if possible. At least for user space apps.


>> Producing Linux kernels, producing base Linux tools like
>> 'bash' etc. ?
>  
>

That will be my job. Of course, I will be using simple crosstool-chains
which are created in a breeze thanks to crosstool or buildroot on Linux
boxes.


>> As a plain "cross host for self-written apps made for an existing
>> Linux" it may serve somehow...
>  
>

This was exactly my intention. Two colleagues will be responsible
for userspace apps that will run on this target. Apps are being ported
from VxWorks. Everything else is my responsibility.


>>  I myself have created some MinGW-hosted
>> crosstoolchains a couple of years ago and remember that using "chained"
>> (the official term maybe being "linked") shared libs automatically
>> being a bad
>> problem in the GNU ld with the MinGW host because the native Windoze
>> doesn't use inode #'s, the GNU ld sources however use them when comparing
>> two files for being the same file...  So finding any stamped as NEEDED
>> shared
>> libs will fail  :(   For instance the base 'libc.so.6' in Linux has the
>> 'ld-linux.so.2'
>> stamped as NEEDED, one needs to mention only the 'libc.so.6' and then the
>> 'ld-linux.so.2' should be linked in too fully automatically...  Let's
>> hope this
>> problem being fixed in the newer binutils versions, otherwise getting
>> a working
>> MinGW-hosted 'ld' for any Linux or Solaris2 or SVR4.x or any other system
>> using shared '.so' files as its libraries, will still fail...
>  
>

What about if this cross-toolchain will only be used for creating static
apps?


>>
>> So "going with the madness of a wackoo" isn't ever recommended... 
>> Generally
>> it would be easy to help you to create "something" which looks like
>> being that
>> required crosstoolchain but really isn't that, the apps produced with
>> it for instance
>> not working 100% thly on that existing target because they weren't
>> linked against
>> 100% compatible target libraries (identical with those installed on
>> the target)  :( 
>>
>  
>
Ok, so shared libs are out of the question. Still though, special static
apps could be produced and ran on a system (built as it's supposed to be
built ). Correct?

Best regards!
I.


--
For unsubscribe information see http://sourceware.org/lists.html#faq


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