X-Spam-Check-By: sourceware.org To: cygwin AT cygwin DOT com From: Vin Shelton Subject: Re: building a cross compiler for linux Date: Tue, 12 Dec 2006 08:06:36 -0500 Lines: 50 Message-ID: <457EA95C.7010509@aoainc.com> References: <1d9535c10612120154jc775b1ajbc818c41d7f0ab5d AT mail DOT gmail DOT com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit User-Agent: Thunderbird 1.5.0.8 (Windows/20061025) In-Reply-To: <1d9535c10612120154jc775b1ajbc818c41d7f0ab5d@mail.gmail.com> X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT 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 -- 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/