1. The c29clang Compiler Toolchain

The TI C29x Compiler Toolchain (c29clang) is Texas Instruments’ compiler for the next-generation C29x processors. You can use the c29clang compiler toolchain to build applications from C or C++ source files to be loaded and run on the C29x processors supported by the toolchain.

1.1. Toolchain Components

The c29clang compiler toolchain consists of many components. A brief description of the major components is provided in the subsections below.

1.1.1. Essential Tools

  • c29clang

The C/C++ compiler, c29clang, is used to compile C and C++ source files. By default, it automatically invokes the TI linker, c29lnk, which combines object files generated by the compiler with object libraries to create an executable program that can be loaded and run on a C29x processor.

The c29clang compiler is derived from the open source Clang compiler and its supporting LLVM infrastructure. You can find more details about Clang and LLVM at The LLVM Compiler Infrastructure site.

  • c29lnk

The linker, c29lnk, is the proprietary linker provided by Texas Instruments. It combines object files that are either compiler-generated or have been archived into one or more object libraries to create executable programs that can be loaded and run on a C29x processor. It is typically invoked from the c29clang command line so that c29clang can implicitly set up the object library search path and implicitly include runtime libraries in the link.

This is the same linker used by the TI C28x code generation tools, so linker command files used for C28x applications are easy to migrate to use for C29x processors.

  • c29ar

The archiver, c29ar, can be used to collect object files together into an object library or archive that can be specified as input to the linker to provide definitions of functions or data objects that are not otherwise available in the compiler generated object files that are input to the link. For example, the standard C runtime library is an example of an object library that collects pre-built object files that contain definitions of C runtime functions that are required by the language standard to be provided with a C compiler toolchain like c29clang.

The archiver also provides a convenient way to collect logically related object files into an object library that can be distributed as a product to provide capability for use in the development of customer C29x applications.

1.1.2. Runtime Libraries

  • libc

The libc library provides an implementation of the C standard runtime features and capabilities that are to be provided as part of a C compiler toolchain.

  • libc++abi and libc++

The libc++ library provides an implementation of the standard C++ library and depends on the libc++abi library to provide implementations of low-level language features.

  • compiler-rt

The compiler-rt runtime library helps to support the code coverage features in the c29clang compiler as well as providing an implementation of low-level target-specific functions that can be used in compiler generated code.

1.1.3. Code Coverage Utilities

  • c29cov

The c29cov tool shows code coverage information for programs that have been instrumented to emit profile data.

  • c29profdata

The profile data tool, c29profdata, is used to merge multiple profile data files generated by profile-guided optimization instrumentation and merges them together into a single indexed profile data file.

1.1.4. Object File Editing and Information Utilities

  • c29dem

The C++ name demangler, c29dem, is a debugging aid that converts names that have been mangled by the compiler back to their original names as declared in the C++ source code. The c29dem tool can be used on a linker-generated map file that contains instances of C++ mangled names.

  • c29libinfo

The c29libinfo command allows you to collect multiple versions of the same object file library, each version built with a different set of command-line options, into a single index library file. This index library file can then be used at link-time as a proxy for the actual object file library.

  • c29nm

The name utility, c29nm, prints the list of symbol names defined and referenced in an object file, executable file, or object library. It also prints the symbol values and an indication of each symbol’s kind.

  • c29objcopy

The object copying and editing tool, c29objcopy, can make a semantic copy of an input object file to an output object file, but command-line options are available that allow parts of the input object file to be edited before writing the result of the edit to the output file. For example, the --strip-debug option can be used to remove all debug sections from the output.

  • c29objdump

The object file dumper utility, c29objdump, can be used to print the contents of an object file. It is commonly used to print out specific parts of the input object file using one of its available options. For example, its -d option disassembles all text sections found in the input object file. For more details about available options use c29objdump’s --help option.

  • c29ofd

Like c29objdump, the object file display utility, c29ofd, can be used to print the contents of object files, executable files, and object libraries. The output can be in text format or in XML. There are also c29ofd options available to alter how text output is displayed and whether DWARF debug information is to be included in the output.

  • c29readelf

The GNU-style ELF object reader, c29readelf, can be used to display low-level format-specific information about one or more object files. Like c29objdump and c29ofd, c29readelf provides command-line options to allow you to display certain pieces of information from an object file like relocation entries or section headers.

  • c29size

The GNU-style size information utility, c29size, prints size information for binary files. The output displayed will show the total size for text sections, for bss sections, and data section as well as a grand total.

  • c29strip

The c29strip tool can be used to strip sections and symbols from object files.

1.2. Software Development Flow

The source code for your application consists of some combination of:

  • C source files (.c extension)

  • C++ source files (.C or .cpp extension)

The compile and link part of your development flow will look something like this:

../_images/c29clang_dev_flow1.png
../_images/blank.png

Figure 1.1 Software Development Flow

Note that:

  • c29clang interprets files with a .c extension as C source, invoking the compiler

  • c29clang interprets files with a .C or .cpp extension as C++ source, invoking the compiler

All of the object files generated (.o extension) are then combined by the linker and linked against any applicable runtime libraries to create an executable output file that can be loaded and run on a TI C29x processor.