Skip to Main Content
Programming Embedded Systems, 2nd Edition
book

Programming Embedded Systems, 2nd Edition

by Michael Barr, Anthony Massa
October 2006
Intermediate to advanced content levelIntermediate to advanced
336 pages
9h 13m
English
O'Reilly Media, Inc.
Content preview from Programming Embedded Systems, 2nd Edition

Building the Toolchain

Now you need to compile the tools for your hardware and operating system:

  1. Before attempting to build the tools, ensure that the GNU native compiler tools directory is on the PATH and precedes the current directory.

  2. # PATH=/bin:$PATH ; export PATH
  3. Configure the GNU binary utilities ( binutils):

  4. # mkdir -p /tmp/build/binutils
    # cd /tmp/build/binutils
    # /src/binutils-2.15/configure --target=arm-elf \\
                      --prefix=/opt/gnutools/arm-elf -v 2>&1 | tee configure.out
  5. The resulting output is contained in the file configure.out. If there are any problems configuring the tools, refer to this file.

  6. Build and install the GNU binutils (this step may take an especially long time):

  7. # make -w all install 2>&1 | tee make.out
  8. The resulting output is contained in the file make.out. If there are any problems building the tools, refer to this file.

  9. Ensure that the binutils are at the head of the PATH:

  10. # PATH=/opt/gnutools/arm-elf/bin:$PATH ; export PATH
  11. Configure gcc:

  12. # mkdir -p /tmp/build/gcc
    # cd /tmp/build/gcc
    # /src/gcc-3.4.4/configure --target=arm-elf \\
                      --prefix=/opt/gnutools/arm-elf --enable-languages=c,c++ \\
                      --with-gnu-as --with-gnu-ld --with-newlib \\
                      --with-gxx-include-dir=/opt/gnutools/arm-elf/arm-elf/include \\
                      -v 2>&1 | tee configure.out
  13. Build and install gcc (this step may take an especially long time):

  14. # make -w all install 2>&1 | tee make.out
  15. Configure gdb:

  16. # mkdir -p /tmp/build/gdb
    # cd /tmp/build/gdb
    # /src/gdb-6.3/configure --target=arm-elf \\
                      --prefix=/opt/gnutools/arm-elf --disable-nls ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Programming with STM32: Getting Started with the Nucleo Board and C/C++

Programming with STM32: Getting Started with the Nucleo Board and C/C++

Donald Norris

Publisher Resources

ISBN: 0596009836Supplemental ContentErrata Page