[PATCH][RESEND] ld: -rpath must search under sysroot
Jörg Krause
joerg.krause@embedded.rocks
Tue Mar 14 09:11:00 GMT 2017
Hi Alan,
On Sat, 2017-03-11 at 23:49 +1030, Alan Modra wrote:
> The last patch makes adding the sysroot for -rpath simple.
>
> diff --git a/ld/ChangeLog b/ld/ChangeLog
> index f4baea8..86d9378 100644
> --- a/ld/ChangeLog
> +++ b/ld/ChangeLog
> @@ -1,5 +1,10 @@
>  2017-03-11  Alan Modra  <amodra@gmail.com>
> Â
> + * emultempl/elf32.em (gld${EMULATION_NAME}_after_open): Add
> + sysroot for -rpath search.
> +
> +2017-03-11  Alan Modra  <amodra@gmail.com>
> +
> Â * emultempl/elf32.em (gld${EMULATION_NAME}_add_sysroot):
> Rewrite.
>  Only prefix absolute paths with sysroot.  Handle DOS paths.
> Â (gld${EMULATION_NAME}_check_ld_elf_hints): Constify
> variable.
> diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em
> index 16220d5..d4837d0 100644
> --- a/ld/emultempl/elf32.em
> +++ b/ld/emultempl/elf32.em
> @@ -1446,7 +1446,9 @@ fragment <<EOF
> Â Â Â path = command_line.rpath;
> Â Â Â if (path)
> Â Â Â Â Â {
> + Â Â Â Â Â Â path = gld${EMULATION_NAME}_add_sysroot (path);
> Â Â Â Â Â Â Â found = gld${EMULATION_NAME}_search_needed (path, &n,
> force);
> + Â Â Â Â Â Â free ((char *) path);
> Â Â Â Â Â Â Â if (found)
> Â break;
> Â Â Â Â Â }
>
Wow, that went fast! Many thanks for taking care of this issue! This
will help to reduce build issues when cross-compiling.
Best regards,
Jörg Krause
More information about the Binutils
mailing list