How do I install CodeSourcery's versions of the run-time libraries on my target system?

Question

How do I install CodeSourcery's versions of the run-time libraries on my target system?

Answer

If you are modifying an existing system, rather than creating a new system from scratch, you should place the files in a new directory, rather than in the root directory of your target system.

Warning

If you choose to overwrite your existing C library, you may not be able to boot your system. You should back up your existing system before overwriting the C library, and ensure that you can restore the backup even with your system offline.

The CodeSourcery run-time library files are stored in sysroot-specific subdirectories in the target/libc directory of your installation, where target is the target name. If you are building a GNU/Linux system from scratch (and thus do not need to worry about overwriting your existing files), you can just copy that entire directory into the root of your target file system:

> (cd target/libc && tar cf - .) | \
  (cd /path/to/target_root && tar xf -)

In some cases, you do not need all of the files. For example, the usr/include subdirectory contains files that are only needed if you will actually be running the compiler on your target system. As none of CodeSourcery's toolchains run on target hardware, you probably do not need these files. You also do not need any .o or .a files; these are used by the compiler when linking programs, but are not needed to run programs. You should definitely copy all .so files and the executable files in usr/bin and sbin.

Refer to the Getting Started guide included with Sourcery CodeBench for more information on identifying and installing the proper sysroot on your target system.

Note for Windows Host Users

The run-time libraries and files provided in Windows host packages for Sourcery CodeBench are not directly usable on the Linux target because of differences between the Windows and Linux file systems. Some files that are hard links, or copies, in the sysroot as installed on the Windows file system should be symbolic links on the Linux target. Additionally, some files in the sysroot which should be marked executable on the Linux target are not marked executable on Windows.

If you intend to use the sysroot provided with Sourcery CodeBench on a Windows host system as the basis for your Linux target filesystem, you must correct these issues after copying the sysroot to the target. If you are a Professional or Standard Edition customer and need assistance with these modifications, please contact CodeSourcery's support team.


This entry was last updated on 8 March 2013.