public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: gcc 2.95.2 and pthreads on FreeBSD 3.4
@ 2000-03-20 14:42 Loren James Rittle
  0 siblings, 0 replies; 2+ messages in thread
From: Loren James Rittle @ 2000-03-20 14:42 UTC (permalink / raw)
  To: jwilkins; +Cc: gcc

> I just installed gcc 2.95.2 through the ports system on a FreeBSD 3.4
> machine.  I then changed the Makefile for an application I am working on
> to refer to gcc295 instead of gcc.

> When I try to build the app, it compiles fine, but complains at the link
> phase as follows:

> gcc295 -g -pg -pthread -O  [FILES].o -lpcap -o [TARGET]
> utils.o: In function `my_read':
> /home/jwilkins/[app]/utils.c:288: undefined reference to
[...]

> If I remove the -pthread option and use -lpthread instead, everything
> resolves, but I get a bus error on execution... 

> It seems to be some sort of naming problem, as pthread_create is found.. 

If you can send me a small testcase that displays the problem, then I
would be happy to look at the problem.

Also, exactly which port from /usr/port did you install?  What options
did you give make?  And what is the exact CVS version number of the
Makefile (found with: grep '$FreeBSD' /usr/ports/lang/egcs/Makefile)?

Regards,
Loren

^ permalink raw reply	[flat|nested] 2+ messages in thread

* gcc 2.95.2 and pthreads on FreeBSD 3.4
@ 2000-03-18 20:43 Jonathan Wilkins
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Wilkins @ 2000-03-18 20:43 UTC (permalink / raw)
  To: gcc

I just installed gcc 2.95.2 through the ports system on a FreeBSD 3.4
machine.  I then changed the Makefile for an application I am working on
to refer to gcc295 instead of gcc.

When I try to build the app, it compiles fine, but complains at the link
phase as follows:

gcc295 -g -pg -pthread -O  [FILES].o -lpcap -o [TARGET]
utils.o: In function `my_read':
/home/jwilkins/[app]/utils.c:288: undefined reference to
`__pthread_read'
utils.o: In function `writen':
/home/jwilkins/[app]/utils.c:346: undefined reference to
`__pthread_write'
utils.o: In function `readn':
/home/jwilkins/[app]/utils.c:376: undefined reference to
`__pthread_read'
jwsniff.o: In function `main':
/home/jwilkins/[app]/jw.c:87: undefined reference to `__pthread_accept'
collect2: ld returned 1 exit status
*** Error code 1

If I remove the -pthread option and use -lpthread instead, everything
resolves, but I get a bus error on execution... 

It seems to be some sort of naming problem, as pthread_create is found.. 

Suggestions would be much appreciated.. 

Thanks
  Jonathan

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2000-03-20 14:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-03-20 14:42 gcc 2.95.2 and pthreads on FreeBSD 3.4 Loren James Rittle
  -- strict thread matches above, loose matches on Subject: below --
2000-03-18 20:43 Jonathan Wilkins

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).