12.150 --sysroot=path

Enables the linker to treat any absolute paths found in linker scripts to be treated as relative to the specified path.



where path is location that is to be treated as the common sysroot.


GCC and GNU ld are configured against a common sysroot. This means that where ld scripts refer to their subordinate libraries using an absolute path, the path is still relative to sysroot.

Because implicit ld scripts are going to be enabled only in --sysv mode, this only takes effect when targeting ARM Linux. Relative paths must still search the normal userlibpath list for the file.

This option affects the following ld script commands:

  • INPUT.

  • GROUP.


If sysroot is not NULL:

  • Any absolute paths in INPUT, GROUP or SEARCH_DIR commands have sysroot prepended.

  • Any paths beginning with the = character have that character replaced by sysroot, but only for SEARCH_PATH commands.


    The linker removes the = character if no sysroot is configured.

Non-ConfidentialPDF file icon PDF versionARM DUI0474M
Copyright © 2010-2016 ARM Limited or its affiliates. All rights reserved.