From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11363 invoked by alias); 29 Jan 2008 09:58:39 -0000 Received: (qmail 11352 invoked by uid 22791); 29 Jan 2008 09:58:38 -0000 X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 29 Jan 2008 09:58:20 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id m0T9wHMp029208; Tue, 29 Jan 2008 04:58:18 -0500 Received: from [10.11.14.4] (vpn-14-4.rdu.redhat.com [10.11.14.4]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m0T9wGSj014537; Tue, 29 Jan 2008 04:58:16 -0500 Message-ID: <479EF8B8.1070603@redhat.com> Date: Tue, 29 Jan 2008 19:04:00 -0000 From: Andrew Haley User-Agent: Thunderbird 1.5.0.12 (X11/20071019) MIME-Version: 1.0 To: "Wenton L. Davis" CC: gcc-help@gcc.gnu.org Subject: Re: Building a cross-compiler References: <479E4EEA.9050101@ieee.org> In-Reply-To: <479E4EEA.9050101@ieee.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2008-01/txt/msg00317.txt.bz2 Wenton L. Davis wrote: > I am finally going to admit defeat and come ask for help on this. I am > trying to build a cross-compiler to run on an x86 machine for several > targets: ARM, MIPS, AVR, and m681x. I would like a single compiler to > handle those 4 architectures in addition to the x86, eventually. > However, for now, I am just trying to get the individual targets able to > compile. > > I can get the binutils to compile/install/run just fine. The compiler > build, however, is not cooperating, and I am almost certain I am > overlooking something remarkably simple, but I just don't see it. I > have my source tree installed in /mnt/tmp/gcc-4.1.2 and I am building in > /mnt/tmp/objdir. (I found one recommendation to always build in a > seperate directory.) I configure it with the following (as run from in > objdir): > > ../gcc-4.1.2/configure --prefix=/mnt/tmp --program-prefix=mips-elf- \ > --target=mips-elf --enable-threads=posix --enable-shared \ > --enable-languages=c --disable-checking --with-gnu-ld --verbose > > > This should, as I understand it, build the MIPS's compiler and after > running "make install"put it in the /mnt/tmp/bin directory, prefixing > each executable with "mips-elf-" right? > > After configure runs, I just type 'make' to build the compiler. > > Everything goes OK (now that I figured out the --enable-threads=posix > thing), until I get to this (I apologize about the formatting, but I > wanted to send exactly what I see): > > from ../../gcc-4.1.2/gcc/unwind-dw2.c:42: > ../../gcc-4.1.2/gcc/gthr-posix.h:43:21: error: pthread.h: No such file > or directory OK, take a step backawards. You're building a cross-compiler for MIPS, but what operating system / C library do you intend to target? gcc doesn't contain a C library, and you are going to need one. gcc also needs to know what OS your target is going to run. You can use newlib as a minimal target C library, but I'm not sure if that's what you want. Andrew.