Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 30 Jan 2017 01:36:45 +0800
From:      Julian Elischer <julian@freebsd.org>
To:        freebsd-current <freebsd-current@freebsd.org>, FreeBSD Stable <freebsd-stable@FreeBSD.org>
Subject:   Re: [IGNORE] ldd linker script /usr/lib/libc.so fail [IGNORE]
Message-ID:  <4439daf4-4173-110d-bd15-d144fed91ceb@freebsd.org>
In-Reply-To: <5278922c-a736-26ec-17a8-d9a1a684439e@freebsd.org>
References:  <5278922c-a736-26ec-17a8-d9a1a684439e@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Tracked this down to a rogue copy of libc.so in an unexpected place 
which was being found earlier than the real one.


On 30/1/17 1:13 am, Julian Elischer wrote:
> Hi
>
> the linker script /usr/lib/libc.so 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/libc.so
> /* $FreeBSD$ */
> GROUP ( /lib/libc.so.7 /usr/lib/libc_nonshared.a 
> /usr/lib/libssp_nonshared.a )
>
> but I'd like to do something like:
>
> GROUP ( ${sysroot}/lib/libc.so.7 ${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 :
>
> https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/4/html/Using_ld_the_GNU_Linker/simple-commands.html 
>
>
> ================================================
> 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
>    option.
>
>    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/
> <https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/4/html/Using_ld_the_GNU_Linker/invocation.html#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.
>
>    =========================================
>
>
> _______________________________________________
> freebsd-current@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to 
> "freebsd-current-unsubscribe@freebsd.org"
>
>




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4439daf4-4173-110d-bd15-d144fed91ceb>