On Wed, 24 Jan 2001, Dan Nelson wrote:
> In the last episode (Jan 24), Daniel Eischen said:
> > On Wed, 24 Jan 2001, Alfred Perlstein wrote:
> > > * Daniel M. Eischen <[EMAIL PROTECTED]> [010124 05:26] wrote:
> > > > As discussed a few days ago, I've just committed the changes to libc
> > > > and libc_r to allow them to be linked together via -lc_r. If you're
> > > > running -current and have any threaded apps built using libc_r.so.5,
> > > > you'll need to rebuild them without the -pthread option using -lc_r.
> > > >
> > > > For porters, the __FreeBSD_version has been bumped to 500016 to
> > > > reflect the above change.
> > >
> > > This is ambiguous, can you provide old/new examples of how to
> > > compile/link a single C source file?
> > What's not clear ;-) Use -lc_r instead of -pthread.
> > gcc -Wall -o foo foo.c -lc_r
> > The old way was:
> > gcc -Wall -D_THREAD_SAFE -o foo foo.c -pthread
> I thought the old way was just -pthread, and it would handle
> everything. I did a quick scan of the devel/ and net/ branches of our
> ports tree, and of 43 thread-using ports, 36 of the ports simply add
> -pthread. Only 7 also add -D_THREAD_SAFE.
> The only usage of _THREAD_SAFE in /usr/include is redefinition of
> feof, ferror, clearerr, and fileno to *_unlocked.
That's if _THREAD_SAFE isn't defined, otherwise the MT-safe
versions of those functions are used. The same for getc(),
putc(), getchar(), putchar().
If the application isn't using those functions, nor calling
anything in libc that uses them, then there shouldn't be a
problem in not defining _THREAD_SAFE. But to be correct,
and if you see gcc(1), -D_THREAD_SAFE is recommended.
This is not the case in -current; -D_THREAD_SAFE is not needed
(but will not be harmful if it is used).
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message