From owner-freebsd-hackers Fri Apr 28 14:29:11 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from bachue.usc.unal.edu.co (bachue.usc.unal.edu.co [168.176.3.20]) by hub.freebsd.org (Postfix) with ESMTP id 1149937BA72 for ; Fri, 28 Apr 2000 14:29:02 -0700 (PDT) (envelope-from giffunip@asme.org) Received: from asme.org ([216.252.137.48]) by bachue.usc.unal.edu.co (Netscape Messaging Server 3.6) with ESMTP id AAA70BB; Fri, 28 Apr 2000 16:27:39 -0400 Message-ID: <390A02C7.D0EFF6BB@asme.org> Date: Fri, 28 Apr 2000 16:29:43 -0500 From: "Pedro F. Giffuni" Organization: Universidad Nacional de Colombia X-Mailer: Mozilla 4.5 [en]C-CCK-MCD {Sony} (Win98; U) X-Accept-Language: en,pdf MIME-Version: 1.0 To: Robert Withrow Cc: freebsd-hackers@freebsd.org Subject: Re: Cross building freebsd? References: <200004282017.QAA14661@pobox.engeast.BayNetworks.COM> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Robert Withrow wrote: > > I've searched through the mailing list archives and otherwise > searched around, but haven't found any real solid information, > so... > BEWARE: I have never done this, but I probably have a reasonable guess since I wrote the basic "crosskit" ports we carry. > > Specifically, I need to know: > > 1. Exactly what FreeBSD-specific things need to be done to a > GCC-2.95.2 compilation system to get cross builds to work? > Take a look at Jerry Hicks' crossm68k ports, there is everything you need to start with a cross binutils and a crossgcc. You should only have to change the TARGET, but it would be good to check the crossgcc FAQ at cygnus, JIC there is something special about the powerpc crosscompiler. > a. What headers should be used? (Not newlib, right?) > b. What as and ld should be used. > c. What kind of abi options are necessary? Like stack > frames, -f, etc... > d. etc.... > WRT (b) the crossbinutils will produce the as and ld you need. There are two possible paths: 1) building FreeBSD from the start (probably the hardest). - Since you are building for an embedded system you don't need any OS on your target. Something like powerpc-elf should work (look in the crossgcc FAQ for the supported targets). - You should then start porting FreeBSD's libc with this compiler; newlib is probably a good reference. - The rest of the userland has to be built, but I wouldn't bet on the resulting kernel booting due to problems while crossbuilding from 32 to 64 bits. 2) Using another target (probably the path used by FreeBSD-Alpha) -If you have access to the platform in question but just want the crossutils to help, you could use the equivalent NetBSD target (powerpc-netbsd-elf ?). -In this case you can also use NetBSD's headers and libraries while you get started, and get the FreeBSD userland (booter, etc) ported. - Eventually you can get a working kernel and some drivers. All more easily said than done... cheers, Pedro. > I've scanned through the GCC and Binutils stuff and I have a rough > idea, but I'd appreciate advice from someone who's actually been > there and done that! (Maybe one of the original Alpha porters?) > > 2. What are the mechanical steps needed to insert a new port? > > a. I plan to scan for "[Aa]lpha" in the entire source tree and > do what they did, but perhaps there is an easier way? Like, where > are architecture-specific things hiding? > > 3. How do you actually cross-build FreeBSD? Is there a FAQ? > > a. Again, I plan on scanning for alpha, but a cookbook would > be easier. > > Thanks! > > -- > Robert Withrow -- (+1 978 288 8256) > BWithrow@BayNetworks.com > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-hackers" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message