On Fri, 11 Jan 2019, Martin Liška wrote:
> +/* Same as add_prefix, but prepending target_sysroot_hdrs_suffix to prefix.
> */
Actually, it should be prepending target_system_root, but followed by
target_sysroot_hdrs_suffix rather than target_sysroot_suffix. That is,
this function should be following add_sysrooted_prefix more closely.
> + if (target_sysroot_hdrs_suffix)
So this should be "if (target_system_root)" - it needs to be sysrooted
even if there is no sysroot headers suffix.
> + {
> + char *sysroot_no_trailing_dir_separator
> + = xstrdup (target_sysroot_hdrs_suffix);
> + size_t sysroot_len = strlen (target_sysroot_hdrs_suffix);
And again this would use target_system_root.
> + if (sysroot_len > 0
> + && target_sysroot_hdrs_suffix[sysroot_len - 1] == DIR_SEPARATOR)
> + sysroot_no_trailing_dir_separator[sysroot_len - 1] = '\0';
Likewise.
> + if (target_sysroot_suffix)
> + prefix = concat (sysroot_no_trailing_dir_separator,
> + target_sysroot_suffix, prefix, NULL);
While this would use target_sysroot_hdrs_suffix.
--
Joseph S. Myers
[email protected]