From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22978 invoked by alias); 2 Feb 2011 01:28:48 -0000 Received: (qmail 22969 invoked by uid 22791); 2 Feb 2011 01:28:47 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-iw0-f175.google.com (HELO mail-iw0-f175.google.com) (209.85.214.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 02 Feb 2011 01:28:43 +0000 Received: by iwn8 with SMTP id 8so7529149iwn.20 for ; Tue, 01 Feb 2011 17:28:41 -0800 (PST) MIME-Version: 1.0 Received: by 10.231.157.205 with SMTP id c13mr9177089ibx.103.1296610121519; Tue, 01 Feb 2011 17:28:41 -0800 (PST) Received: by 10.231.153.130 with HTTP; Tue, 1 Feb 2011 17:28:41 -0800 (PST) In-Reply-To: References: <1295993996.3050.2164.camel@Tak> Date: Wed, 02 Feb 2011 01:28:00 -0000 Message-ID: Subject: Re: Building Relocatable GCC From: Bryan Hundven To: NightStrike Cc: Kyle Girard , gcc-help Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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: 2011-02/txt/msg00027.txt.bz2 On Tue, Feb 1, 2011 at 3:10 PM, NightStrike wrote: > On Tue, Jan 25, 2011 at 5:19 PM, Kyle Girard wrot= e: >> >> I'm trying compile a version of gcc-4.5 on linux x86 for linux x86 which >> is relocatable but I'm having difficulty. >> >> Does anyone have an example of how to build such a relocatable gcc? >> >> I've been building binutils, and gcc-4.5 over and over >> with many different options. =C2=A0After reading the docs I thought the = key >> configure options are the --with-sysroot=3D/my/root and --prefix=3D/my/r= oot >> for both binutils and gcc with those options and it should be >> relocatable but I've had no luck. =C2=A0For most of my attempts I can co= mpile >> binutils fine but gcc compilation fails saying it cannot file system >> headers in /my/root/usr/include.. Am I missing a step somewhere? =C2=A0I= 've >> even tried the bringing in eglibc/libc into the mix and trying to create >> a cross-compiler from linux x86 to linux x86 but that was even worse. >> >> From the googling that I've done it doesn't seem like it's that >> difficult. =C2=A0I think I'm missing some critical step somewhere > > Yes. =C2=A0You have to pre-populate /my/root with an actual sysroot, > including system headers and a crt. =C2=A0You can do this by rolling your > own, copying from /usr/, or any of a few other means. Or, have crosstool-ng help you :) http://ymorin.is-a-geek.org/projects/crosstool hg clone http://ymorin.is-a-geek.org/hg/crosstool-ng/ or wget http://ymorin.is-a-geek.org/download/crosstool-ng/crosstool-ng-1.10.0.= tar.bz2 -Bryan