From owner-freebsd-hackers Fri Feb 8 10: 4:10 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 47DEB37B436; Fri, 8 Feb 2002 10:03:53 -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 UAA36078; Fri, 8 Feb 2002 20:03:42 +0200 (EET) (envelope-from sobomax@FreeBSD.org) Received: from vega.vega.com (h54.229.dialup.iptcom.net [212.9.229.54]) by ipcard.iptcom.net (8.9.3/8.9.3) with ESMTP id UAA99449; Fri, 8 Feb 2002 20:03:40 +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 g18I38d69646; Fri, 8 Feb 2002 20:03:08 +0200 (EET) (envelope-from sobomax@FreeBSD.org) Message-ID: <3C6412EA.2605CDB@FreeBSD.org> Date: Fri, 08 Feb 2002 20:03:22 +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: Terry Lambert Cc: Ruslan Ermilov , 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> <3C63E5D1.1E423698@FreeBSD.org> <20020208172237.G78163@sunbay.com> <3C640DDE.78417F5C@mindspring.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 Terry Lambert wrote: > > Ruslan Ermilov wrote: > > Sorry, but I don't get it. I can't reproduce it other than specifying > > -lc explicitly. For example, -lssh now depends on -lcrypto and -lz, in > > that order. Attempting to link a program with -lc_r -lssh gives, in > > that order: > > > > libc_r.so.5 => /usr/lib/libc_r.so.5 (0x28065000) > > libssh.so.2 => /usr/lib/libssh.so.2 (0x28083000) > > libc.so.5 => /usr/lib/libc.so.5 (0x280b2000) > > libcrypto.so.2 => /usr/lib/libcrypto.so.2 (0x28168000) > > libz.so.2 => /usr/lib/libz.so.2 (0x28223000) > > > > The primary dependecies come first, then secondaries. I can only > > imagine the situation where libc.so comes before libc_r.so if some > > library has a (bogus) explicit dependency on libc.so. > > Yes, this is exactly the case: the shared library is linked > against libc.so. THis is actually legal, and, in some cases, > desirable. > > In the "Evolution" case, though, it's bogus. As you can see from my log there was no library explicitly linked with libc and no -lc command line option, but resulting executable ended up with libc recorded right before libc_r. Any clues? -Maxim > > > How does ldd(1) output in question looks like, the full version? > > Heh. Same question I asked, with ldd information for the > .so's, too. 8-). > > -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message