From owner-freebsd-hackers Fri Feb 8 7:17: 3 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from mail11.speakeasy.net (mail11.speakeasy.net [216.254.0.211]) by hub.freebsd.org (Postfix) with ESMTP id D380437B423 for ; Fri, 8 Feb 2002 07:16:36 -0800 (PST) Received: (qmail 4456 invoked from network); 8 Feb 2002 15:16:35 -0000 Received: from unknown (HELO laptop.baldwin.cx) ([65.91.155.67]) (envelope-sender ) by mail11.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 8 Feb 2002 15:16:35 -0000 Message-ID: X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <3C639855.DA710095@FreeBSD.org> Date: Fri, 08 Feb 2002 10:16:32 -0500 (EST) From: John Baldwin To: Maxim Sobolev Subject: Re: Linking libc before libc_r into application causes weirdprob Cc: jlemon@FreeBSD.org, hackers@FreeBSD.org, jasone@FreeBSD.org, deischen@FreeBSD.org, jdp@FreeBSD.org, "M. Warner Losh" , Stephen Montgomery-Smith Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 08-Feb-02 Maxim Sobolev wrote: > Stephen Montgomery-Smith wrote: >> >> "M. Warner Losh" wrote: >> > >> > Confirmed. test.c appears to work properly when compiled: >> > >> > cc -o test test.c -pthread >> > ./test >> > >> > Generally speaking, if you want to add -lc_r, you are doing things >> > incorrectly. I've done way to much building... In FreeBSD 3.x you >> > did need to do -lc_r, but that was changed to -pthread in 4.0. >> > >> > Warner >> > >> >> According to the man page for gcc, you are supposed to write >> >> cc -o test test.c -pthread -D_THREAD_SAFE >> >> or am I misunderstanding something? > > In 5.0-CURRENT -pthread was replaced by -lc_r. No, that's just how it is currently implemented. Ultimately it will be -lpthread. And when that happens, you will need to link -lpthread in before -lc just like you would need to now with -lc_r. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message