Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 28 Apr 2000 16:29:43 -0500
From:      "Pedro F. Giffuni" <giffunip@asme.org>
To:        Robert Withrow <bwithrow@nortelnetworks.com>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Cross building freebsd?
Message-ID:  <390A02C7.D0EFF6BB@asme.org>
References:  <200004282017.QAA14661@pobox.engeast.BayNetworks.COM>

next in thread | previous in thread | raw e-mail | index | archive | help


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<whatevers>, 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?390A02C7.D0EFF6BB>