GNU ld recently gained support for a $SYSROOT token in -L to denote the sysroot prefix (similar to $ORIGIN in rpath), to be more intuitive than the current use of '=' for that purpose: PR ld/21251 Support $SYSROOT in ld -L and INPUT command https://sourceware.org/bugzilla/show_bug.cgi?id=21251 gcc's -I etc. options currently also support '=' for that purpose only, and it seems sensible to allow $SYSROOT here for the same reasons. The following patch implements just that, bootstrapped on i386-pc-solaris2.12 and sparc-sun-solaris2.12, only manually tested since currently there are no --sysroot tests whatsoever in the testsuite. Ok for mainline? Rainer -- ----------------------------------------------------------------------------- Rainer Orth, Center for Biotechnology, Bielefeld University 2017-05-31 Rainer Orth * incpath.c (add_sysroot_to_chain): Allow for $SYSROOT prefix. * doc/cppdiropts.texi (-I @var{dir}): Document it.