From owner-freebsd-questions@FreeBSD.ORG Sun Mar 30 22:41:56 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E4E5C1065677 for ; Sun, 30 Mar 2008 22:41:56 +0000 (UTC) (envelope-from LukeD@pobox.com) Received: from sasl.smtp.pobox.com (a-sasl-fastnet.sasl.smtp.pobox.com [207.106.133.19]) by mx1.freebsd.org (Postfix) with ESMTP id A56A48FC16 for ; Sun, 30 Mar 2008 22:41:56 +0000 (UTC) (envelope-from LukeD@pobox.com) Received: from localhost.localdomain (localhost [127.0.0.1]) by a-sasl-fastnet.sasl.smtp.pobox.com (Postfix) with ESMTP id 6241B3DE5 for ; Sun, 30 Mar 2008 18:41:55 -0400 (EDT) Received: from lukas.is-a-geek.org (pool-71-113-78-181.sttlwa.dsl-w.verizon.net [71.113.78.181]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-sasl-fastnet.sasl.smtp.pobox.com (Postfix) with ESMTP id A9C523DE4 for ; Sun, 30 Mar 2008 18:41:52 -0400 (EDT) Date: Sun, 30 Mar 2008 15:41:45 -0700 (PDT) From: Luke Dean X-X-Sender: lukas@border.lukas.is-a-geek.org To: freebsd-questions@freebsd.org In-Reply-To: <20080330140722.Q30396@border.lukas.is-a-geek.org> Message-ID: <20080330153646.D30487@border.lukas.is-a-geek.org> References: <20080330140722.Q30396@border.lukas.is-a-geek.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Subject: Re: How to replace libpthread correctly on 7.0? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Luke Dean List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Mar 2008 22:41:57 -0000 On Sun, 30 Mar 2008, Luke Dean wrote: > This weekend I upgraded a desktop system from 6.2 to 7-STABLE using source. > I removed and rebuilt all my ports using the ports system, and so far I > haven't noticed any problems with them. > > When I attempted to rebuild some software outside the ports system, I ran > into problems. I like to use the Code::Blocks IDE. It's in the FreeBSD > ports system, but it's lagging about three years behind what's current, so > I've been tracking the current code from the project's subversion system. It > was working on FreeBSD 6.2. > > When I attempted to rebuild Code::Blocks, the build failed with an error > relating to libpthread.so.2. I didn't get rid of old libraries when I > upgraded to 7, so I still had this old libpthread.so.2 that hadn't been > rebuilt. I know. Bad. I searched the web a bit and discovered that > libpthread had fallen out of favor in 7 and was being replaced by something > else. Ok, fine, so I got rid of my old broken libpthread.so.2. > > I tried to rebuild Code::Blocks again, and found that it was still attempting > to link to libpthread. I threw away all the code and configurations, fetched > the latest code, ran "bootstrap", "configure", and "make" and it's STILL > running g++ with the -pthread switch and complaining about a missing > libpthread.so.2. It finally dies with an "undefined reference to > `system@LIBTHREAD_1_0' > > So... > Should I expect the new standard threading library ("libthr" I think?) to be > a drop-in replacement for libpthread? If so, do you have any ideas where I > need to look to convince this code to use it? > For my personal projects, is the -pthread switch any good anymore, or is > there a different switch I should be using now? > Is libpthread even an option at all anymore? If so, how do I build it? > I'm just not sure what direction I should start troubleshooting in now. Never mind. It was my stupid mistake. I thought that "make" was making all new executables and libraries, but in fact it was pulling in an old library that was linked to libpthread. Silly me. If this had been in the ports system I would've run "make deinstall" first and avoided this problem. I removed the old library, which forced "make" to rebuild it and all was fine. The Porter's Handbook answered my question about the -pthread switch, I think. I have to go through this every now and then just to remind myself why I like the ports system so much.