Hardware Reference
In-Depth Information
Building the Tool Chain
Now you're all done with the configuration tool. Use the Tab key to select “Exit” from the bottom menu. Make sure
you select “Yes” to save your new configuration, otherwise you will be redoing all your settings again. Next up it's time
to build your cross compiled tool chain. There are fun times ahead and a lot of waiting. Use the following command to
start the build process:
# ct-ng build
At this point in time it's a good idea to walk away and go get some food or a beer or two. You're going to need
your energy when it's done. The tool has a lot of work to do. It must download all the sources for the tools and their
libraries. It then must build a working copy of these tools using the host's build tools. This is called the first pass; once
crosstool-NG has a working set of tools it will then use the tools it has just built to rebuild the exact same version for
your target architecture. This is called the second pass. After this you should have a working cross compile tool chain.
Now if you think about that in detail that's a lot of compile time (maybe you should grab two beers).
You may come back to find that your build failed. In my case I expected it to fail as computers have a habit of
not working for me or maybe that's computers in general. Take a look at Figure 6-13 . crosstool-NG has pretty good
error screens.
Figure 6-13. The build has failed!
It gives you a lot of information and even a file to read about common errors. More importantly, it has a build
log file. This file is called build.log and this can be found in the working directory that you created. Taking a look at
this log shows me that for some reason crosstool-NG cannot download the strace tarball. This is a simple fix. All you
need to do if you get this type of error is find where to download the tarball and place it into the .build/tarballs
directory in your working directory. In the case of the strace example you can download the strace file from
http://sourceforge.net/projects/strace/files/strace/ . Once you have this downloaded, copy it into the
.build/tarballs directory that you had extracted the initial crosstool-NG build into (in my case, this is
/home/brendan/ct/rpi/.build/tarballs ). Once you have placed any missing tarballs into the sources directory you can
resume the build and wait for more errors. crosstool-NG will log what it's doing to your currently running terminal
(standard out). Once it's done you should see a “finishing installation” message. You can see in Figure 6-14 an
example of this.
 
Search WWH ::




Custom Search