wiki:Projects/GCCGoRTEMS

Version 8 (modified by Vinutheraj, on Jul 16, 2010 at 8:19:35 PM) (diff)

/* General Build Instructions */

GCCGoRTEMS

Status: Currently, GCC Go has been ported to RTEMS on x86.

Mentors: Ian Lance Taylor and Joel Sherrill?

Introduction: Go is a new concurrent programming language introduced by a very distinguished group of computer scientists working at Google. There is a new front-end in GCC for the Go language.

Goal: Have a functioning port of GCC Go to RTEMS supporting all the architectures.

General Build Instructions

These instructions assume the following strings in the instructions are replaced with values appropriate for you. These may not work if you use these as environment variables, so do so at your own risk.

  • INSTALL_DIR is the prefix (installation directory) for the toolchain installation
  • TARGET is the target code (tested with TARGET=i386-rtems4.11)
  • BSP is the RTEMS BSP (tested with BSP=pc386)

It is critical that you have a recent enough native GCC in your $PATH before beginning.

Please perform each configure/make/make install trio in a separate empty build directory. In the directions below, the versions for RTEMS 4.11 are used. If you are building RTEMS 4.10, update the commands below with the appropriate older versions. Also set PATH=INSTALL_DIR/bin:$PATH.

Source Code and Patches

If you are building from source code, download all of the necessary source code archives, unpackage them, and apply the appropriate patches. More information on this can be found here - Building the GNU Cross Compiler Toolset.

Please use the latest patches available for the tool versions you are using. These should always be in the RTEMS source code at rtems/contrib/crossrpms/patches and at http://www.rtems.org/ftp/pub/rtems/SOURCES/.

Rather than building from source code, you may be able to use the pre-built versions of the code provided for various architectures at http://www.rtems.org/ftp/pub/rtems. However, be aware that problems have been identified if the version of the pre-built binutils has an INSTALL_DIR different from the one you are using for the other tools. More information on how to use the pre-built version can be found here - Prebuilt Toolset Executables.

Building RTEMS

First, get the RTEMS source code. For the latest source, use:

cvs -z3 -d :pserver:anoncvs@www.rtems.com:/usr1/CVS login
cvs -z3 -d :pserver:anoncvs@www.rtems.com:/usr1/CVS co -P rtems

For specific releases like RTEMS 4.10, use:

cvs -z3 -d :pserver:anoncvs@www.rtems.com:/usr1/CVS login
cvs -z3 -d :pserver:anoncvs@www.rtems.com:/usr1/CVS co -r rtems-4-10-branch -P rtems

Git exports of the various modules in the CVS repository can be found at http://www.rtems.org/ftp/private/git/. The RTEMS module can be cloned like this -

git clone http://www.rtems.org/ftp/private/git/rtems.git

Then, build RTEMS. Building RTEMS is to be done in two stages, first a multilibed version, then a non-multilibed version

During the tool build the multilibed version is needed to ensure you get the .h files into a place where the "normal" cross builds will see them without adding to the include path.

But you want the BSPs installed so you can actually (later) link executables, so the non-multilibed version.

cd rtems
./bootstrap
cd ..
mkdir b-rtems-multi
cd b-rtems-multi
../rtems/configure --enable-multilib --disable-cxx --enable-posix \
  --enable-networking --target=TARGET --prefix=INSTALL_DIR
make
make install

cd ..
mkdir b-rtems-nomulti
cd b-rtems-nomulti
../rtems/configure --disable-multilib --disable-cxx --enable-posix \
  --enable-networking --target=TARGET --prefix=INSTALL_DIR \
  --enable-rtemsbsp=BSP
make
make install

References