Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Dec 2002 12:48:07 +1100
From:      Mark.Andrews@isc.org
To:        Ian Lister <freebsd-lists@lister.dnsalias.net>
Cc:        Emiel Kollof <coolvibe@hackerheaven.org>, freebsd-stable@FreeBSD.ORG
Subject:   Re: pthread woes 
Message-ID:  <200212200148.gBK1m7dv048579@drugs.dv.isc.org>
In-Reply-To: Your message of "Fri, 20 Dec 2002 11:40:27 %2B1000." <Pine.BSF.4.44.0212201138200.44616-100000@sapporo.home> 

next in thread | previous in thread | raw e-mail | index | archive | help

> On Fri, 20 Dec 2002, Emiel Kollof wrote:
> >I have a problem with compiling stuff that uses POSIX threads. I used
> >the following snippet of code to test:
> 
> >% gcc test.c -o test.c
> 
> >It compiles fine when I use -lc_r. This also breaks a lot of ports. What's
> >going on?
> 
> pthread(3) notes that there is is -pthread option to gcc to save you
> needing to link with -lc_r explicitly.
> 
> Ian

	It also sets appropriate defines so that threaded applications
	are built correctly.  You will get undefined results if you
	build threaded applications without using -pthread (or manually
	doing everything it does).
 
	Mark
--
Mark Andrews, Internet Software Consortium
1 Seymour St., Dundas Valley, NSW 2117, Australia
PHONE: +61 2 9871 4742                 INTERNET: Mark.Andrews@isc.org

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200212200148.gBK1m7dv048579>