From owner-freebsd-current Tue Apr 13 15:47:44 1999 Delivered-To: freebsd-current@freebsd.org Received: from ns.tar.com (ns.tar.com [204.95.187.2]) by hub.freebsd.org (Postfix) with ESMTP id 24CDD15095 for ; Tue, 13 Apr 1999 15:47:38 -0700 (PDT) (envelope-from dick@ns.tar.com) Received: (from dick@localhost) by ns.tar.com (8.9.3/8.9.3) id RAA16507; Tue, 13 Apr 1999 17:45:08 -0500 (CDT) (envelope-from dick) Date: Tue, 13 Apr 1999 17:45:07 -0500 From: "Richard Seaman, Jr." To: "Kurt D. Zeilenga" Cc: freebsd-current@FreeBSD.ORG Subject: Re: compiler specs for -pthread/-kthread Message-ID: <19990413174507.A440@tar.com> References: <3.0.5.32.19990413151601.009b2100@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.4i In-Reply-To: <3.0.5.32.19990413151601.009b2100@localhost>; from Kurt D. Zeilenga on Tue, Apr 13, 1999 at 03:16:01PM -0700 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Tue, Apr 13, 1999 at 03:16:01PM -0700, Kurt D. Zeilenga wrote: > To facilate auto detection of the local threading environment, > it would be nice if the -?thread options set all the necessary > compiler/linker flags. It is a common practace for such > options to specify both compilation and link options. > > I suggest the EGCS specs be adjusted to: > > -pthread => -D_THREAD_SAFE -D_UTHREADS -lc_r > -kthread => -D_THREAD_SAFE -D_KTHREADS -lpthread A little known and not well documented fact is that FreeBSD also uses _REENTRANT in its header files. Ever wondered why you couldn't find declarations for gamma_r, lgamma_r, gammaf_r, or lgammaf_r? Check math.h. :) Personally I think conditional declarations should just be eliminated from math.h, rather than tell people they might have to add -D_REENTRANT. :) > > If the LinuxThread "port" is targetted to be -kthread: > > -kthread => -D_REENRANT -D_LINUXTHREADS -lpthread In FreeBSD, you should define -D_THREAD_SAFE for linuxthreads if you want the thread safe behaviour in stdio.h. Its a libc thing, not a linuxthreads thing. Adding -D_REENTRANT to linuxthreads doesn't get you anything except the added headers in math.h (same as libc_r). > After modify the specification, the headers/libraries would > be adjusted as needed. I can easily submit diffs if desirable. Nobody has offered to commit the changes to the header files I have requested, and the PR I submitted on Jan 29 has not been acted upon. As a result, I anticipate dropping the -DLINUXTHREADS solution to the header conflict problem in favor of stuffing all the linux threads specific headers into /usr/local/include/pthread/linuxthreads where they go now, and instead of -DLINUXTHREADS, people will have to add -I/usr/local/include/pthread/linuxthreads to their compile options. (This works now too). -- Richard Seaman, Jr. email: dick@tar.com 5182 N. Maple Lane phone: 414-367-5450 Chenequa WI 53058 fax: 414-367-5852 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message