From owner-freebsd-hackers Fri Feb 8 6:51:38 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from alcatraz.iptelecom.net.ua (alcatraz.iptelecom.net.ua [212.9.224.15]) by hub.freebsd.org (Postfix) with ESMTP id C220C37B41E; Fri, 8 Feb 2002 06:51:25 -0800 (PST) Received: from ipcard.iptcom.net (ipcard.iptcom.net [212.9.224.5]) by alcatraz.iptelecom.net.ua (8.9.3/8.9.3) with ESMTP id QAA85404; Fri, 8 Feb 2002 16:51:20 +0200 (EET) (envelope-from sobomax@FreeBSD.org) Received: from vega.vega.com (h71.228.dialup.iptcom.net [212.9.228.71]) by ipcard.iptcom.net (8.9.3/8.9.3) with ESMTP id QAA19646; Fri, 8 Feb 2002 16:51:14 +0200 (EET) (envelope-from sobomax@FreeBSD.org) Received: from FreeBSD.org (big_brother.vega.com [192.168.1.1]) by vega.vega.com (8.11.6/8.11.3) with ESMTP id g18Eogd69154; Fri, 8 Feb 2002 16:50:42 +0200 (EET) (envelope-from sobomax@FreeBSD.org) Message-ID: <3C63E5D1.1E423698@FreeBSD.org> Date: Fri, 08 Feb 2002 16:50:57 +0200 From: Maxim Sobolev Organization: Vega International Capital X-Mailer: Mozilla 4.79 [en] (Windows NT 5.0; U) X-Accept-Language: en,uk,ru MIME-Version: 1.0 To: Ruslan Ermilov Cc: Terry Lambert , Jason Evans , 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> <20020207234233.D23162@canonware.com> <3C639A8C.6D100326@FreeBSD.org> <3C63A62D.3E4A4FC4@mindspring.com> <3C63AD02.79BA5AF5@FreeBSD.org> <20020208164132.D78163@sunbay.com> Content-Type: text/plain; charset=x-user-defined 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 Ruslan Ermilov wrote: > > On Fri, Feb 08, 2002 at 12:48:34PM +0200, Maxim Sobolev wrote: > > Terry Lambert wrote: > > > > > > Maxim Sobolev wrote: > > > > That would be nice, but we have a real problem at hand. As I said, I > > > > think that ld(1) should be smart enough to reorder libc/libc_r so that > > > > libc_r is always linked before libc. This is clearly not the case > > > > right now. Unfortunately there is no easy way to reproduce this, but > > > > if you have some spare CPU cycles try to remore explicit -pthread from > > > > ports/mail/evolution/Makefile, build the port on -current and do `ldd > > > > /usr/X11R6/bin/evolution'. You will see that libc.so.X precedes > > > > libc_r.so.X, even though -lc wasn't supplied to a linker, while -lc_r > > > > was. > > > > When you say ld(1), are you perhaps mean rtld-elf.so.1 (aka rtld(1))? > ld(1) only _links_ when static linkage was requested (which is not the > case here), or writes dynamic dependencies on shared objects. No, I meant ld(1). The problem here is that in the case when libc is recorded before libc_r in dynamic dependencies list the resulting executable may not work correctly (see my testcase). -Maxim To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message