https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68808
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Yes because the specs are setup with the specific --sysroot option supplied. The code sets up the sysroot spec only if the --sysroot is supplied: /* Pass the --sysroot option to the linker, if it supports that. If there is a sysroot_suffix_spec, it has already been processed by this point, so target_system_root really is the system root we should be using. */ if (target_system_root) { obstack_grow (&obstack, "%(sysroot_spec) ", strlen ("%(sysroot_spec) ")); obstack_grow0 (&obstack, link_spec, strlen (link_spec)); set_spec ("link", XOBFINISH (&obstack, const char *), false); }