From owner-freebsd-hackers Thu Feb 7 22:34:10 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from falcon.prod.itd.earthlink.net (falcon.mail.pas.earthlink.net [207.217.120.74]) by hub.freebsd.org (Postfix) with ESMTP id 9935337B41F; Thu, 7 Feb 2002 22:34:05 -0800 (PST) Received: from pool0339.cvx22-bradley.dialup.earthlink.net ([209.179.199.84] helo=mindspring.com) by falcon.prod.itd.earthlink.net with esmtp (Exim 3.33 #1) id 16Z4bj-0002m1-00; Thu, 07 Feb 2002 22:34:03 -0800 Message-ID: <3C637097.13B8C35A@mindspring.com> Date: Thu, 07 Feb 2002 22:30:47 -0800 From: Terry Lambert X-Mailer: Mozilla 4.7 [en]C-CCK-MCD {Sony} (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Maxim Sobolev 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 References: <1013147180.73417.2.camel@notebook> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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