building gcc-3.2.3 as a cross compiler to make cygwin programs

Joel Sherrill joel.sherrill@OARcorp.com
Tue Apr 13 17:53:00 GMT 2004


Daniel Kegel wrote:

> Some developers will tell you that copying crt0.o etc. from the
> target system is in fact the proper approach.  While this is
> the only possible approach when the target is closed-source,
> open source targets can be handled by actually
> building the crt0.o yourself.  This works well for relatively stable
> targets like Linux and glibc, but might work poorly for
> targets under rapid development like cygwin.

I recall having to copy more than just crt0.o and the libc.a to
get a working** linux->cygwin toolset.  It is easier to just take
the prepackaged binaries for the target libraries you are
not interested in building, untar them and use them.  The goal
is probably not to completely rebuild Cygwin from scratch. :)

** My definition of "working" in this case was able to
build a Cygwin hosted cross compiler.

> Anyway, copying the .o's is the way to go unless you're
> willing to add cygwin target support to crosstool :-)
> - Dan
> 
> bertrand marquis wrote:
> 
>> try to copie crt0.o and gcrt0.o from cygwin in i686-pc-cygwin/lib and 
>> it will work (it is for me)
>>
>> But i'm really not sure that it is the right way to do that,
>>
>> Any one know where does crt0.o and gcrt0.o must come from when 
>> building a cross compiler ??
>>
>>
>> Rainer Hochreiter a écrit:
>>
>>>> it seems that you have forgotten to add the include and lib files from
>>>> cygwin
>>>>
>>>> you must take the file needed in the cygwin installed files or find a
>>>> developpement tree that add those files, here stdio.h and put them into
>>>> $PREFIX/i686-pc-cygwin/include and $PREFIX/i686-pc-cygwin/lib
>>>>   
>>>
>>>
>>>
>>> thanks for your hint - it works!
>>>
>>> i also successfully built a cross-gcc for c++!
>>>
>>> the next problem which occured is that during linking i get the 
>>> following
>>> error message:
>>>
>>> [raho@pcraho cygwin]$ /opt/cygwin-cross-gcc/bin/i686-pc-cygwin-g++ 
>>> hello.cpp
>>> /opt/cygwin-cross-gcc/lib/gcc-lib/i686-pc-cygwin/3.2.3/../../../../i686-pc-cygwin/bin/ld: 
>>>
>>> crt0.o: No such file: No such file or directory
>>> collect2: ld returned 1 exit status
>>>
>>> this happens also on linking c sources:
>>>
>>> [raho@pcraho cygwin]$ /opt/cygwin-cross-gcc/bin/i686-pc-cygwin-gcc 
>>> hello.c
>>> /opt/cygwin-cross-gcc/lib/gcc-lib/i686-pc-cygwin/3.2.3/../../../../i686-pc-cygwin/bin/ld: 
>>>
>>> crt0.o: No such file: No such file or directory
>>> collect2: ld returned 1 exit status
>>>
>>> any hints to this problem?
> 
> 
> 
> ------
> Want more information?  See the CrossGCC FAQ, 
> http://www.objsw.com/CrossGCC/
> Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com
> 



------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com



More information about the crossgcc mailing list