Creating New Cross-Compiled Build Target

Oleksandr Tymoshenko gonzo at bluezbox.com
Thu Oct 14 22:30:02 UTC 2010


  On 10/14/2010 1:23 PM, Matthew Schnall wrote:
> I am  a student at CMU taking a OS project course
> (www.cs.cmu.edu/~412). My project is creating a port of freeBSD to the
> new Tilera chips. The chip has a mips like architecture. There is a
> gcc cross compiler from x86 to the tilera assembly.  I was curious if
> someone could help guide me through the steps to create a new
> cross-compiled target within the freeBSD build infrastructure.
         It's relatively easy :)

Rough plan:
- Getting toolchain
- Add architecture name to the KNOWN_ARCHES in Makefile.inc1
- Add architecture entries to share/mk/bsd.cpu.mk and 
share/mk/bsd.endian.mk
- Look for "mips" in bsd.sys.mk and sys.mk and check if those exceptions 
are related to you arch
- In sys/conf add Makefile.$arch, files.$arch, ldscript.$arch, 
options.$arch files (use *.mips as examples)
- Add  sys/$arch subdirectory with layout simmilar to sys/mips or sys/arm
- Start hacking

    Getting toolchain might be a tricky part since version of gcc in base is
4.2 and binutils are quite outdated.  So if you have toolchain as a set of
patches to later versions backporting them would be a major headache.
Easy way would be to build gcc/binutils with your patches applied from
sources and hack proper gcc/binutils binaries' names to makefile. Warner
did some work on out-of-base toolchains support but I'm not sure at what
stage this project is.




More information about the freebsd-embedded mailing list