Tracked this down to a rogue copy of in an unexpected place which was being found earlier than the real one.

On 30/1/17 1:13 am, Julian Elischer wrote:

the linker script /usr/lib/ fails when you are using the --sysroot options because it

contains absolute paths.

Does anyone know if there is a way to add the sysroot to the script?

currently teh on ein our sysroot looks like:

$ cat /usr/build/buildroot/tools/x86_FBSD1X_gcc4.2.4/usr/lib/
/* $FreeBSD$ */
GROUP ( /lib/ /usr/lib/libc_nonshared.a /usr/lib/libssp_nonshared.a )

but I'd like to do something like:

GROUP ( ${sysroot}/lib/ ${sysroot}/usr/lib/libc_nonshared.a ${sysroot}/usr/lib/libssp_nonshared.a )

but don't think I can do that

from what I see below however it shouldn't be needed.

Is this a bug in our version of ld? or am I misreading it?

I quote from one such source :

INPUT(file, file, …), INPUT(file file …)

   The INPUT command directs the linker to include the named files in
   the link, as though they were named on the command line.

   For example, if you always want to include subr.o any time you do
   a link, but you can't be bothered to put it on every link command
   line, then you can put INPUT (subr.o) in your linker script.

   In fact, if you like, you can list all of your input files in the
   linker script, and then invoke the linker with nothing but a -T

   In case a /sysroot prefix/ is configured, and the filename starts
   with the / character, and the script being processed was located
   inside the /sysroot prefix/, the filename will be looked for in
   the /sysroot prefix/. Otherwise, the linker will try to open the
   file in the current directory. If it is not found, the linker will
   search through the archive library search path. See the
   description of -L in Section 3.1 /Command Line Options/

   If you use INPUT (-lfile), ld will transform the name to
   libfile.a, as with the command line argument -l.

   When you use the INPUT command in an implicit linker script, the
   files will be included in the link at the point at which the
   linker script file is included. This can affect archive searching.

GROUP(file, file, …), GROUP(file file …)

   The GROUP command is like INPUT, except that the named files
   should all be archives, and they are searched repeatedly until no
   new undefined references are created.


_______________________________________________ mailing list
To unsubscribe, send any mail to ""

_______________________________________________ mailing list
To unsubscribe, send any mail to ""

Reply via email to