Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 07 Feb 2002 22:30:47 -0800
From:      Terry Lambert <tlambert2@mindspring.com>
To:        Maxim Sobolev <sobomax@FreeBSD.org>
Cc:        jdp@FreeBSD.org, deischen@FreeBSD.org, jasone@FreeBSD.org, hackers@FreeBSD.org, jlemon@FreeBSD.org
Subject:   Re: Linking libc before libc_r into application causes weird problems
Message-ID:  <3C637097.13B8C35A@mindspring.com>
References:  <1013147180.73417.2.camel@notebook>

next in thread | previous in thread | raw e-mail | index | archive | help
Maxim Sobolev wrote:
> $ cc test.c -o test -lc -lc_r
> 
> When either of -lc or -lc_r is omitted, or their order is reversed the
> problem disappears. The problem doesn't exist on 4-STABLE.
> 
> Any ideas, comments and suggestions are welcome.

Symbols are resolved from libraries in the order in which
they are specified to the linker.

So the fix is obvious: specify them in the right order.

Linux doesn't see this because libc_r is just there for
the reentrant calls, and their threading uses processes,
instead of a user space ("quantum conservation") scheduler.

-- Terry

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3C637097.13B8C35A>