Problems to build a cross compiler under Linux

Kai Ruottu kai.ruottu@luukku.com
Wed Nov 20 05:19:00 GMT 2002


"karim" <bernardet.karim@wanadoo.fr> wrote:

> I want to have under linux a compiler which produces binaries for windows
> (with cygwin). So I try cross compiling. I use the script below to do that
> and I use binutils-20021107-2, gcc-3.2-3, newlib-1.9.0 and cygwin-1.3.15-2
> for the headers.

 The assumed way is to get the target headers and libraries from the
Cygwin release, and build binutils and GCC against the RedHat-
provided ready-made Cygwin-libraries. It may be fully possible that
gcc-3.2 cannot compile the C-library, only gcc-3.2... In any case one
should use the custom Cygwin C-library sources, not the generic
newlib-release, if really wanting to "reinvent the wheel". Then
building also the Cygwin-specific gcc-2.95.3-6 may be required

> ./../lib/gcc-lib/i686-cygwin32/3.2/../../../../i686-cygwin32/bin/ld: ne peut
> trouver -lcygwin
> collect2: ld a retourné 1 code d'état d'exécution
> (sorry for the french language)
>
> so it can t find a cygwin library ...

 Of course it cannot because the newlib-sources don't include this
library.  The Cygwin-C-library sources and the 'winsup' there should
have its sources. But as written, rebuilding the C-library from
sources during the GCC-build doesn't sound sane...  The reasons one
could like to do this can be that the math-parts can be optimized
for Athlon, Pentium-4 or something, from the RedHat-provided 'i686'-
code for Pentium-II or something... Maybe the 'i686' code in the
RedHat-provided libraries don't work with your target 'i386', 'i486'
or 'i586' hardware, this could be a very good reason... I remember
someone claiming that the Cygwin-release binaries didn't wotk on
AMD's K6-2 based hardware (on the NG 'gnu.gcc.help'...)

 What was your reason for recompiling the Cygwin C-libraries?

 My advice would be that you take all the same prebuilt C-libraries
the 'native' distribution has, then build GCC with/against these,
then use the toolchain for a while with producing apps... Only then
you could consider rebuilding the C-libraries, 'optimized' for your
own local target hardware in use...

Cheers, Kai


------
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