From owner-freebsd-current@freebsd.org Wed Jun 7 11:13:38 2017 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 206DDC09BF2 for ; Wed, 7 Jun 2017 11:13:38 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9E4EA6FE1C; Wed, 7 Jun 2017 11:13:37 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id v57BDVtt064656 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 7 Jun 2017 14:13:31 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v57BDVtt064656 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v57BDVOf064655; Wed, 7 Jun 2017 14:13:31 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 7 Jun 2017 14:13:31 +0300 From: Konstantin Belousov To: David Chisnall Cc: blubee blubeeme , FreeBSD current Subject: Re: [libltdl] removal from gnu ports Message-ID: <20170607111331.GJ2088@kib.kiev.ua> References: <224BF120-F91A-4997-9920-90225E55393B@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <224BF120-F91A-4997-9920-90225E55393B@FreeBSD.org> User-Agent: Mutt/1.8.2 (2017-04-18) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Jun 2017 11:13:38 -0000 On Wed, Jun 07, 2017 at 11:33:32AM +0100, David Chisnall wrote: > On 7 Jun 2017, at 10:33, blubee blubeeme 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.