From owner-freebsd-current@freebsd.org Fri Dec 4 03:34:19 2015 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 2A4D2A4008E for ; Fri, 4 Dec 2015 03:34:19 +0000 (UTC) (envelope-from deischen@freebsd.org) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 106E1137A for ; Fri, 4 Dec 2015 03:34:19 +0000 (UTC) (envelope-from deischen@freebsd.org) Received: by mailman.ysv.freebsd.org (Postfix) id 0B737A4008D; Fri, 4 Dec 2015 03:34:19 +0000 (UTC) Delivered-To: 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 E4B27A4008C for ; Fri, 4 Dec 2015 03:34:18 +0000 (UTC) (envelope-from deischen@freebsd.org) Received: from mail.netplex.net (mail.netplex.net [204.213.176.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.netplex.net", Issuer "RapidSSL SHA256 CA - G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A11C51379 for ; Fri, 4 Dec 2015 03:34:18 +0000 (UTC) (envelope-from deischen@freebsd.org) Received: from sea.ntplx.net (sea.ntplx.net [204.213.176.11]) by mail.netplex.net (8.15.1/8.15.1/NETPLEX) with ESMTP id tB43YASo002442; Thu, 3 Dec 2015 22:34:10 -0500 X-Virus-Scanned: by AMaViS and Clam AntiVirus (mail.netplex.net) X-Greylist: Message whitelisted by DRAC access database, not delayed by milter-greylist-4.4.3 (mail.netplex.net [204.213.176.9]); Thu, 03 Dec 2015 22:34:10 -0500 (EST) Date: Thu, 3 Dec 2015 22:34:10 -0500 (EST) From: Daniel Eischen X-X-Sender: eischen@sea.ntplx.net Reply-To: Daniel Eischen To: Konstantin Belousov cc: current@freebsd.org Subject: Re: librt symbol versioning breakage (was Re: Build failure, undefined reference to __mq_oshandle) In-Reply-To: <20151130145518.GK3448@kib.kiev.ua> Message-ID: References: <20151129102903.GD3448@kib.kiev.ua> <20151130145518.GK3448@kib.kiev.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.20 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: Fri, 04 Dec 2015 03:34:19 -0000 On Mon, 30 Nov 2015, Konstantin Belousov wrote: > On Sun, Nov 29, 2015 at 12:27:40PM -0500, Daniel Eischen wrote: >> On Sun, 29 Nov 2015, Konstantin Belousov wrote: >> >>> On Sun, Nov 29, 2015 at 01:23:04AM -0500, Daniel Eischen wrote: >>>> >>>> So I found out that sometime in the last year or so, symbol versioning >>>> for librt was broken and leaking symbols that shouldn't have been >>>> leaked. I've just committed a fix for this. >>>> >>>> Do a 'readelf -sw /usr/lib/librt.so.1 | grep GLOBAL | grep -v UND' >>>> and see the non FBSD_foo symbols that shouldn't be there. >>> >>> I did the following on the librt from the HEAD of about month ago: >>> >>> pooma% ls -l netboot/sandy/usr/lib/librt.so.1 >>> -r--r--r-- 1 root wheel 23704 Oct 24 23:35 netboot/sandy/usr/lib/librt.so.1 >>> >>> pooma% readelf -sw netboot/sandy/usr/lib/librt.so.1 | grep GLOBAL | grep -v UND | grep -v FBSDpriv | grep FBSD >>> 97: 0000000000000000 0 OBJECT GLOBAL DEFAULT ABS FBSD_1.0 >>> >>> But I think that your commit is the good change. >> >> >> Can you check librt.so.1 in your buildworld temporary build >> environment? >> >> $ readelf -sW /usr/obj/usr/FreeBSD/svn/src/tmp/usr/lib/librt.so.1 \ >> grep -v UND | grep GLOBAL >> >> There has to be a reason that tests/sys/mqueue/mqtest[3-4].c build >> without error when they reference __mq_oshandle. That symbol is >> not exported from librt. >> >> Hmm, looks like libc and libthr are also the same (leaky) in the >> temporary build environment (TBE). So something broke when building >> the TBE libraries. >> >> For r277320 on my system Jan 19, 2015, the TBE libraries must have >> been built correctly because mqtests[3-4] failed with unresolved >> references to __mq_oshandle. > > In fact, my command was wrong. I see that there are indeed a lot of symbols > exported which are not versioned (this is where my command was wrong, the > grep FBSD part), even for the installed librt. Arrgh, this bug also seems to have slipped into 10-stable. $ uname -a FreeBSD 10.1-RELEASE-p9 FreeBSD 10.1-RELEASE-p9 #0: Tue Apr 7 01:09:46 UTC 2015 root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC amd64 $ readelf -sW /usr/lib/librt.so.1 | grep -v UND | grep GLOBAL \ | grep -v FBSD 71: 0000000000003ac0 432 FUNC GLOBAL DEFAULT 12 __sigev_alloc ... $ readelf -sW /usr/lib/librt.so.1 | grep -v UND | grep GLOBAL \ | grep -v FBSD | wc -l 22 -- DE