From owner-freebsd-hackers Thu Jul 31 09:15:12 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id JAA17784 for hackers-outgoing; Thu, 31 Jul 1997 09:15:12 -0700 (PDT) Received: from plunger.gdeb.com (plunger.gdeb.com [153.11.11.3]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id JAA17735 for ; Thu, 31 Jul 1997 09:14:22 -0700 (PDT) Received: from clcrtr.clc.gdeb.com ([153.11.109.11]) by plunger.gdeb.com with SMTP (1.37.109.16/CSC-E_1.6) id AA292415146; Thu, 31 Jul 1997 12:05:46 -0400 Message-Id: <33E0B900.41C67EA6@iworks.InterWorks.org> Date: Thu, 31 Jul 1997 12:11:01 -0400 From: "Daniel M. Eischen" X-Mailer: Mozilla 3.0Gold (X11; I; FreeBSD 2.1.5-RELEASE i386) Mime-Version: 1.0 To: A.J.Smith@nortel.co.uk Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: Cross compiling for FreeBSD 3.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > Is there more info in the bin utils about doing this? I've never built > binutils or gcc myself, having previously relied on the installed > binaries. Yes, but John Polstras Elfkit describes what you need to do. Something like: Extract binutils-2.7 (or 2.8) Apply (probably have to hand apply since they are based on binutils-2.6) the 2 binutils patches. The patches are very small. cd binutils-2.7 # or binutils-2.8 # Configure should correctly determine your host system as linux, # but you could additionally specify --host=i486-unknown-linux(elf|aout) configure --prefix=/usr/local/cross --target=i386-unknown-freebsdelf (cd bfd; make headers) make CC=cc CFLAGS=-O su make CC=cc CFLAGS=-O install > > Get the include files from a 3.0 FreeBSd system > > and install them in /i386-unknown-freebsdelf/include. > > Do I need to take everything in /usr/include and below? I would (and did). John gives you directions on how to easily do this (I've silently thanked John more than a few times :) su cd /usr find -d include | cpio -pdmv /usr/local/cross/i386-unknown-freebsdelf > > Grab > > the necessary libraries from a 3.0 FreeBSD system and place them in > > /i386-unknown-freebsdelf/lib. (I am assuming you're configuring > > binutils/gcc for i386-unknown-freebsdelf). > > Yes. Again, is this everything from /usr/lib? I have a feeling this will > be a somewhat massive set of files... No, just what you are going to link with and the crt* objects. Usually, libc should be enough. Hmm, these have to be elf-built. It would be easier if you could build Johns Elfkit on a 3.0 box to get these libraries. I don't have my 3.0-current elf-built libs around anymore, but I do have 2.2 elf-libs. Perhaps someone with 3.0 elf libs can make you a tarball so you don't have to do it yourself. > > Configure gcc-2.7.2 for i386-unknown-freebsdelf and your chosen prefix. > > Build and install gcc. > > I believe I've seen gcc documentation on this: Setting up gcc as a cross > compiler, the gcc --target etc., is this the right stuff? Really, all you need to do is in Johns README: configure --prefix=/usr/local/elf --target=i386-unknown-freebsdelf make CC=cc CFLAGS=-O LIBGCC1=libgcc1.a OLDCC="./xgcc -B./" \ FLOAT_H=/usr/include/float.h LANGUAGES=c su make CC=cc CFLAGS=-O LIBGCC1=libgcc1.a OLDCC="./xgcc -B./" \ FLOAT_H=/usr/include/float.h LANGUAGES=c install I believe the elf-built libraries are going to be your only hurdle. Dan Eischen deischen@iworks.InterWorks.org