From owner-svn-src-all@freebsd.org Sat Dec 26 10:05:27 2015 Return-Path: Delivered-To: svn-src-all@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 B1180A52B75; Sat, 26 Dec 2015 10:05:27 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3184D1FF4; Sat, 26 Dec 2015 10:05:27 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id tBQA5KYZ031036 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sat, 26 Dec 2015 12:05:21 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua tBQA5KYZ031036 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id tBQA5Krk031034; Sat, 26 Dec 2015 12:05:20 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 26 Dec 2015 12:05:20 +0200 From: Konstantin Belousov To: Colin Percival Cc: Daniel Eischen , Ed Schouten , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r292723 - in head: lib/libc share/mk Message-ID: <20151226100520.GG3625@kib.kiev.ua> References: <201512251129.tBPBTIZp058825@repo.freebsd.org> <567DE180.3040601@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <567DE180.3040601@freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) 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: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Dec 2015 10:05:27 -0000 On Fri, Dec 25, 2015 at 04:38:24PM -0800, Colin Percival wrote: > On 12/25/15 13:03, Daniel Eischen wrote: > > On Fri, 25 Dec 2015, Ed Schouten wrote: > >> 2015-12-25 12:29 GMT+01:00 Colin Percival : > >>> Make libxnet.so a symlink to libc.so. This makes `-lxnet` a no-op, as > >>> POSIX requires for the c99 compiler. > >> > >> I seem to remember I had some issues in the past where I was linking > >> against libc explicitly. Maybe it had something to do with linking > >> both against -lpthread and -lc, but if you pass in -lc later on the > >> command line, libc overrides the symbols that have to be provided by > >> -lpthread? > > I just did some tests with one of my pthread-using tools, and it passes > all of my tests with -lc added before or after -lpthread. Can you > remember any details of how the problems showed up? Is it possible that > this has been fixed since then? I know there's a lot of tricks to make > sure that the right versions of functions get called. > > >> If that's (still) the case, would it make sense to just provide > >> libxnet in the form of an empty .a file instead? > > > > I think that's a good point. Using -lanything shouldn't introduce an > > unexpected link order. > > Yes, adding a dummy library was my first thought, but kib pointed out > that a symlink was much simpler. Obviously it never occurred to me that > linking to a library which we were going to be linking to anyway would > cause problems... I fixed all issues I was aware of with dlopen("libthr"), see the longer explanation at https://lists.freebsd.org/pipermail/freebsd-threads/2014-December/005636.html If any of the issue which prevents dlopening libthr left, please provide me with the test case. Note that issues which might break runtime due to libc appears in the DT_NEEDED flatten order before libthr should be equially valid for the dlopen().