Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

pthread, 2.2.8 and gcc-2.95.2

2 views
Skip to first unread message

Morten Laursen

unread,
Dec 9, 1999, 3:00:00 AM12/9/99
to
Hi

I am trying to build a program that uses pthread and needs gcc-2.95
(because I use a priority queue) on FreeBSD 2.2.8. So I built gcc-2.95.2,
but it does not recognize option -pthread.
The standard gcc version 2.7.2.1 supports -pthread.

Does anyone know how I get 2.95.2 to support pthreads?

Thanks
Morten

--
Morten Laursen # 9th sem Data Engineering Student # Aalborg University
http://www.cs.auc.dk/~morten/ # mailto:mor...@cs.auc.dk
Home: Scoresbysundvej 3 vaer 39, DK-9210 Aalborg SOe
Phone: (+45) 98149866 - 139 # cell: (+45) 28263529


Bill Moran

unread,
Dec 10, 1999, 3:00:00 AM12/10/99
to
Morten Laursen wrote:
>
> Hi
>
> I am trying to build a program that uses pthread and needs gcc-2.95
> (because I use a priority queue) on FreeBSD 2.2.8. So I built gcc-2.95.2,
> but it does not recognize option -pthread.
> The standard gcc version 2.7.2.1 supports -pthread.
>
> Does anyone know how I get 2.95.2 to support pthreads?

Don't know how to get it. I do know why it doesn't have it. the -pthead
option is added to gcc specifically for FreeBSD when it's ported,
standard gcc relies on the kernel for thread support.

--
Microsoft: Where do you want to go today?
Linux: Where do you want to go tomorrow?
FreeBSD: Are you guys coming or what?

J Wunsch

unread,
Dec 14, 1999, 3:00:00 AM12/14/99
to
Morten Laursen <mor...@cs.auc.dk> wrote:

> Does anyone know how I get 2.95.2 to support pthreads?

-pthread is a FreeBSD invention. It basically means `don't link
against -lc, but link against -lc_p instead'.

--
cheers, J"org

joerg_...@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)

Patrick TJ McPhee

unread,
Dec 17, 1999, 3:00:00 AM12/17/99
to
In article <836fdh$2h...@uriah.heep.sax.de>,
J Wunsch <joerg_...@uriah.heep.sax.de> wrote:
% Morten Laursen <mor...@cs.auc.dk> wrote:
%
% > Does anyone know how I get 2.95.2 to support pthreads?
%
% -pthread is a FreeBSD invention. It basically means `don't link
% against -lc, but link against -lc_p instead'.

That should be -lc_r.
--

Patrick TJ McPhee
East York Canada
pt...@interlog.com

David Schwartz

unread,
Dec 26, 1999, 3:00:00 AM12/26/99
to

Patrick TJ McPhee wrote:
>
> In article <836fdh$2h...@uriah.heep.sax.de>,
> J Wunsch <joerg_...@uriah.heep.sax.de> wrote:
> % Morten Laursen <mor...@cs.auc.dk> wrote:
> %
> % > Does anyone know how I get 2.95.2 to support pthreads?
> %
> % -pthread is a FreeBSD invention. It basically means `don't link
> % against -lc, but link against -lc_p instead'.
>
> That should be -lc_r.

And actually '-pthread' is a standard. It means 'do whatever you need
to do [on this platform] to support POSIX threads'. This usually
includes linking in the pthreads library but may also include defining
certain preprocessor values such as '_REENTRANT' or whatever.

DS

James Hu

unread,
Dec 28, 1999, 3:00:00 AM12/28/99
to

If Morten has not already used the "-V" option on the stock FreeBSD gcc
to see what -pthread does, he should do so, because it is otherwise
not documented (AFAIK). But basically, what I have done in the past is
something like:

-- specify "-D_THREAD_SAFE" while compiling
-- specify "-nostdlib" to /usr/local/bin/gcc when linking
-- put "/usr/lib/crt1.o /usr/lib/crti.o /usr/lib/crtbegin.o" someplace
early in the link line
-- put "-lstdc++ -lm -lgcc -lc_r -lgcc /usr/lib/crtend.o /usr/lib/crtn.o"
last in the link line

--
James C. Hu <j...@cs.wustl.edu> Computer Science Doctoral Candidate
http://www.cs.wustl.edu/~jxh/ Washington University in Saint Louis
>>>>>>>>>>>>> I use *SpamBeGone* <URL:http://www.internz.com/SpamBeGone/>

0 new messages