This is the mail archive of the cygwin mailing list for the Cygwin project.

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: building a cross compiler for linux

2006/12/12, Vin Shelton <>:
Hi Domen,

Domen Vrankar wrote:
> I'm using this tutorila:
> for building a cygwin cross compiler for linux.
> I built binutils sucessfully but when trying to build gcc I get:
> configure: error: cannot run C compiled programs.
> If you meant to cross compile, use `--host'.
> See `config.log' for more details.
> This happens even though I use --host=i686-pc-linux.
> Has annyone an idea why this is happening?
> I'm using Debian etch, server with two 32 bit pentium processors

I would strongly recommend the use of crosstool for this.  See for details.

Here is some advice from

Crosstool, and probably gcc and glibc's configure scripts, assume that
directory names do not contain any spaces. This is often violated on
Windows. Please take care to not use directory names with spaces in them
when running crosstool. It might work, but if it doesn't, you've been
warned. (Same goes for Mac OS X.)

crosstool creates some really deeply nested directories while building, so
filenames are quite long. This has two consequences:

First, on some versions of Windows, filenames (including directory) can't be
longer than 240 chars. To avoid exceeding this limit, don't run crosstool in
a directory with a long name.

Second, the maximum length of commandlines is extremely short. Since
crosstool uses commandlines that include multiple filenames, they can exceed
the limit very quickly. You can avoid this problem by using the "mount"
command's options. e.g. mount /bin and /usr/bin with -X or "-o cygexec" (see
the cygwin faq, and/or mount the crosstool directory with "-o managed" (see
the cygwin doc for "mount").

It's easy to run afoul of either of these two.

   Vin Shelton

I think I wrote what I want to do the wrong way.

I want to build a cross compiler on linux that would output Cygwin
executables ( Linux host -> Cygwin target).

I tryed crosstool and while building on linux with script  I get:

i686-pc-cygwin-ranlib libmingwex.a
make[3]: Leaving directory
i686-pc-cygwin-dlltool --as i686-pc-cygwin-as --output-def
mingwthrd.def mthr.o mthr_init.o
i686-pc-cygwin-gcc -Wl,--base-file=mingwthrd.base -B./ -mdll
-mno-cygwin -Wl,--image-base,0x6FBC0000
-Wl,--entry,_DllMainCRTStartup@12 mthr.o mthr_init.o -Lmingwex \
       -o mingwthrd_dummy.exe
cannot find -luser32
collect2: ld returned 1 exit status
make[2]: *** [mingwthrd.def] Error 1
make[2]: Leaving directory
make[1]: *** [mingw] Error 1
make[1]: Leaving directory
make: *** [all-target-winsup] Error 2

I downloaded w32api-3.8-1-src.tar.bz2 package but now I don't know what to do with it.

Anny suggestions?

r. Domen

Unsubscribe info:
Problem reports:

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