Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 14 Nov 1997 20:23:37 -0500 (EST)
From:      Chuck Robey <chuckr@glue.umd.edu>
To:        FreeBSD-current@FreeBSD.org
Subject:   using pthreads
Message-ID:  <Pine.BSF.3.96.971114201807.18833Q-100000@picnic.mat.net>

next in thread | raw e-mail | index | archive | help
In doing a pthreads applicatioin, under current, I'm not sure how to do
the linking part.  My libc_r is up to date and installed, but there are
many functions, that aren't strictly pthread_* functions, that have been
made thread-safe in the libc_r library, so I want that library to link
before libc.  I'm not sure how to do that.

I tried using a linker line of -shared -nostdlib -lc_r -lc, but I got the
error "Exec format error. Binary file not executable" when I tried to run
the file.  If I cut out the -nostdlib and -shared, it tells me there's not
__DYNAMIC, so I guess it wasn't linked shared.  File tells me the file is
a FreeBSD/i386 compact demand paged shared library not stripped, so that
looks ok to me.

Does anyone know the correct way to link a pthread app under FreeBSD?

----------------------------+-----------------------------------------------
Chuck Robey                 | Interests include any kind of voice or data 
chuckr@glue.umd.edu         | communications topic, C programming, and Unix.
213 Lakeside Drive Apt T-1  |
Greenbelt, MD 20770         | I run Journey2 and picnic, both FreeBSD
(301) 220-2114              | version 3.0 current -- and great FUN!
----------------------------+-----------------------------------------------







Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.96.971114201807.18833Q-100000>