From owner-freebsd-stable@freebsd.org Sun May 27 15:42:38 2018 Return-Path: Delivered-To: freebsd-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60E52F784D9 for ; Sun, 27 May 2018 15:42: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 D766184489; Sun, 27 May 2018 15:42: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 w4RFgKGQ029796 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 27 May 2018 18:42:23 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w4RFgKGQ029796 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w4RFgJri029795; Sun, 27 May 2018 18:42:19 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 27 May 2018 18:42:19 +0300 From: Konstantin Belousov To: Antoine Brodin Cc: Jonathan Chen , freebsd-stable@freebsd.org Subject: Re: ldconfig(8) oddity on 11.2-BETA3? Message-ID: <20180527154219.GR88128@kib.kiev.ua> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.0 (2018-05-17) X-Spam-Status: No, score=-1.5 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,URI_NOVOWEL 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-stable@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 May 2018 15:42:38 -0000 On Sun, May 27, 2018 at 12:49:12PM +0000, Antoine Brodin wrote: > On Sat, May 26, 2018 at 10:29 PM, Jonathan Chen wrote: > > Hi, > > > > I'm running 11.2-BETA3/amd64 at r334236, and I've noticed that > > "ldconfig -m" doesn't behave as expected (or perhaps it's my > > understanding). > > > > This is what I'm seeing when building security/nss in a chrooted environment: > > > > # ldconfig -r | grep nss > > # ls /usr/local/lib/nss > > libcrmf.a libnss3.so libnssutil3.so > > libssl3.so > > libfreebl3.so libnssckbi.so libsmime3.so > > libfreeblpriv3.so libnssdbm3.so libsoftokn3.so > > # ldconfig -m /usr/local/lib/nss > > # ldconfig -r | grep nss > > search directories: > > /lib:/usr/lib:/usr/local/lib:/usr/local/lib/perl5/5.26/mach/CORE:/usr/local/lib/nss > > # ldconfig -R | grep nss > > # ldconfig -r | grep nss > > search directories: > > /lib:/usr/lib:/usr/local/lib:/usr/local/lib/perl5/5.26/mach/CORE:/usr/local/lib/nss > > # file /usr/local/lib/nss/*.so > > /usr/local/lib/nss/libfreebl3.so: ELF 64-bit LSB shared object, > > x86-64, version 1 (FreeBSD), dynamically linked, stripped > > /usr/local/lib/nss/libfreeblpriv3.so: ELF 64-bit LSB shared object, > > x86-64, version 1 (FreeBSD), dynamically linked, stripped > > /usr/local/lib/nss/libnss3.so: ELF 64-bit LSB shared object, > > x86-64, version 1 (FreeBSD), dynamically linked, stripped > > /usr/local/lib/nss/libnssckbi.so: ELF 64-bit LSB shared object, > > x86-64, version 1 (FreeBSD), dynamically linked, stripped > > /usr/local/lib/nss/libnssdbm3.so: ELF 64-bit LSB shared object, > > x86-64, version 1 (FreeBSD), dynamically linked, stripped > > /usr/local/lib/nss/libnssutil3.so: ELF 64-bit LSB shared object, > > x86-64, version 1 (FreeBSD), dynamically linked, stripped > > /usr/local/lib/nss/libsmime3.so: ELF 64-bit LSB shared object, > > x86-64, version 1 (FreeBSD), dynamically linked, stripped > > /usr/local/lib/nss/libsoftokn3.so: ELF 64-bit LSB shared object, > > x86-64, version 1 (FreeBSD), dynamically linked, stripped > > /usr/local/lib/nss/libssl3.so: ELF 64-bit LSB shared object, > > x86-64, version 1 (FreeBSD), dynamically linked, stripped > > > > Is this correct ldconfig behaviour or has something broken? > > > > Hi, > > This looks normal, from the ldconfig(8) man page: > > Filenames must conform to the lib*.so.[0-9] pattern in order to be > added to the hints file. For ELF executable format, ld-elf.so.hints only contains the configured library path. Dynamic linker reads the directories specified there, for typical loading of the library for normally configured case. ldconfig -r does the same, but additionally filters the output by the lib.*\.so\.[0-9]+ patern. Dynamic linker does not filter and uses the name from DT_NEEDED as is.