Date: Wed, 7 Jun 2017 14:13:31 +0300 From: Konstantin Belousov <kostikbel@gmail.com> To: David Chisnall <theraven@FreeBSD.org> Cc: blubee blubeeme <gurenchan@gmail.com>, FreeBSD current <freebsd-current@freebsd.org> Subject: Re: [libltdl] removal from gnu ports Message-ID: <20170607111331.GJ2088@kib.kiev.ua> In-Reply-To: <224BF120-F91A-4997-9920-90225E55393B@FreeBSD.org> References: <CALM2mEmwLh_G81nF%2B0GH8MG=sbafKo80peqprTDWQNdpNsm52A@mail.gmail.com> <224BF120-F91A-4997-9920-90225E55393B@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Jun 07, 2017 at 11:33:32AM +0100, David Chisnall wrote: > On 7 Jun 2017, at 10:33, blubee blubeeme <gurenchan@gmail.com> wrote: > > > > Hi > > > > I'm sure I was reading yesterday on a different machine about the linker > > flag -ld which has something to do with gnu dlopen and how it's ok to > > remove those from your Makefile since FreeBSD handles dlopen and a few > > other things from that header in the standard libc. > > > > Is that correct? > > Do you mean -ldl? If so, then yes. On Linux, the dl* symbols are only exported from ld-linux.so if you link against libdl. On FreeBSD, they are exported from rtld regardless. Symbols from the dynamic linker are always exported. Issue is that the dynamic linker is never specified as the library on the static linker (ld) command line. Linux puts stabs for the rtld symbols into libdl.so, while FreeBSD provides weak symbols in the libc.so dynamic symbol table. As result, FreeBSD does not need -ldl for access to dl*(3), and does not provide libdl.so. FreeBSD scheme is problematic because rtld have to prefer non-weak symbols over weak, to have dynamic binaries to use real rtld symbols and not libc stubs. It is non-compliant with the ELF spec. Unfortunately, it is used also in other places, making us stuck with the non-compliant behaviour.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20170607111331.GJ2088>