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 <vshelton@aoainc.com>:
Hi Domen,

Domen Vrankar wrote:
> I'm using this tutorila: http://x.cygwin.com/docs/cg/prog-build-cross.html
> 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
http://www.kegel.com/crosstool/ for details.

Here is some advice from
http://www.kegel.com/crosstool/crosstool-0.42/doc/crosstool-howto.html:

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.


HTH,
   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
demo-cygwin.sh  I get:

i686-pc-cygwin-ranlib libmingwex.a
make[3]: Leaving directory
`/storage/domenv/crosstool/crosstool-0.42/build/i686-pc-cygwin/gcc-3.3.2-/build-cygwin/i686-pc-cygwin/winsup/mingw/mingwex'
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
/storage/domenv/crosstool-cygwin/gcc-3.3.2-/i686-pc-cygwin/lib/gcc-lib/i686-pc-cygwin/3.3.2/../../../../i686-pc-cygwin/bin/ld:
cannot find -luser32
collect2: ld returned 1 exit status
make[2]: *** [mingwthrd.def] Error 1
make[2]: Leaving directory
`/storage/domenv/crosstool/crosstool-0.42/build/i686-pc-cygwin/gcc-3.3.2-/build-cygwin/i686-pc-cygwin/winsup/mingw'
make[1]: *** [mingw] Error 1
make[1]: Leaving directory
`/storage/domenv/crosstool/crosstool-0.42/build/i686-pc-cygwin/gcc-3.3.2-/build-cygwin/i686-pc-cygwin/winsup'
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:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


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