Services and Modeling for Embedded Software Development
Embecosm divider strip
Prev  Next

Chapter 9.  Summary Checklist

This summary can be used as a checklist when creating a new port of newlib. The configuration and build steps are typically encapsulated in a simple shell script, which builds, tests and installs the entire GNU tool chain as well as newlib and libgloss

Throughout this checklist, the new target architecture is referred to as target. It is recommended newlib and libgloss are built as part of a unified source tree including the newlib distribution (see Section 2.1).

  1. Edit newlib/configure.host adding entries for the new target (Section 3.3).

    • Decide whether to implement reentrant or non-reentrant system calls and whether to use namespace clean system call names (Section 3.2).

  2. Add a newlib machine subdirectory for the new target, newlib/libc/machine/target (Section 4.1).

    • Modify configure.in in newlib/libc/machine to configure the new target subdirectory and run autoconf in newlib/libc/machine to regenerate the configure script (Section 4.1.1).

  3. Implement setjmp and longjmp in the target specific machine directory, newlib/libc/machine/target (Section 4.1.2).

    • Copy and modify Makefile.am and configure.in from the fr30 directory and run aclocal, autoconf and automake in newlib/libc/machine/target to regenerate the configure script and Makefile template. (Section 4.1.3).

  4. Modify newlib header files (Section 4.2).

    • Add entries in newlib/libc/include/ieeefp.c (Section 4.2.1)

    • Add entry in in newlib/libc/include/setjmp.c (Section 4.2.2)

    • Add entries in newlib/libc/include/sys/config.h (Section 4.2.3).

    • Optionally add other custom headers in newlib/libc/machine/target/machine (Section 4.2.4).

  5. Add a libgloss platform directory, libgloss/target (Section 5.1).

    • Modify libgloss/configure.in to configure the platform subdirectory and run autoconf in the libgloss directory to regenerate the configure script (Section 5.1.1).

  6. Implement the Board Support Package(s) for the target (Chapter 5).

    • Implement the C Runtime start up, crt0.o for each BSP (Section 5.2).

    • Implement the environment global variable and 18 system call functions for each BSP following the convention namespace and reentrancy conventions specified in newlib/configure.host (Section 5.3 and Section 5.4).

    • Create libgloss/target/Makefile.in and libgloss/target/configure.ac, based on the versions in the libgloss/libnosys directory and run aclocal and autoconf in libgloss/target (Section 5.5).

  7. If necessary update libgloss/libnosys/configure.in to indicate the target is using namespace clean system calls and run autoconf in libgloss/libnosys (Section 5.6).

  8. Modify GCC for newlib (Section 7.2).

    • Optionally add target specific option(s) to specify newlib BSP(s) (Section 7.2.1).

    • Optionally specify the location of newlib headers, the BSP C runtime start up file and the newlib libraries, if they have been moved from their standard locations and/or names (Section 7.2.2)

    • Specify the libgloss BSP library to be linked, ensuring malloc and free are linked in if required (the section called “ Adding a BSP to the link line. ”).

  9. Ensure the linker scripts are suitable for use with newlib (Section 7.3).

  10. Configure and build newlib and libgloss (Chapter 6).

    • Optionally move the newlib header directory, libraries, C start-up and BSP(s) to a custom location (Section 7.1).

    • Rebuild GCC

    • Rebuild ld if any linker scripts have been changed.

  11. Test newlib (Section 8.1).

  12. Install newlib and libgloss (Chapter 6).

    • Reinstall GCC

    • Reinstall ld if any linker scripts have been changed.

You should now have a working newlib implementation integrated within your GNU tool chain.

Embecosm divider strip