From owner-freebsd-chat@FreeBSD.ORG Thu Dec 28 16:38:50 2006 Return-Path: X-Original-To: freebsd-chat@FreeBSD.ORG Delivered-To: freebsd-chat@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B52A516A40F for ; Thu, 28 Dec 2006 16:38:50 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (lurza.secnetix.de [83.120.8.8]) by mx1.freebsd.org (Postfix) with ESMTP id 41A1313C47C for ; Thu, 28 Dec 2006 16:38:50 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (ufwdix@localhost [127.0.0.1]) by lurza.secnetix.de (8.13.4/8.13.4) with ESMTP id kBSG1cPS057092; Thu, 28 Dec 2006 17:01:43 +0100 (CET) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.13.4/8.13.1/Submit) id kBSG1bMi057091; Thu, 28 Dec 2006 17:01:37 +0100 (CET) (envelope-from olli) Date: Thu, 28 Dec 2006 17:01:37 +0100 (CET) Message-Id: <200612281601.kBSG1bMi057091@lurza.secnetix.de> From: Oliver Fromme To: freebsd-chat@FreeBSD.ORG, jcw@highperformance.net In-Reply-To: <4586685C.1030909@highperformance.net> X-Newsgroups: list.freebsd-chat User-Agent: tin/1.8.2-20060425 ("Shillay") (UNIX) (FreeBSD/4.11-STABLE (i386)) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.1.2 (lurza.secnetix.de [127.0.0.1]); Thu, 28 Dec 2006 17:01:43 +0100 (CET) Cc: Subject: Re: Static Link with Shared Object X-BeenThere: freebsd-chat@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-chat@FreeBSD.ORG, jcw@highperformance.net List-Id: Non technical items related to the community List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Dec 2006 16:38:50 -0000 Jason C. Wells wrote: > Does linking to a shared object cause the new object file to be shared also? Yes. As soon as a single shared object is involved, the runtime linker comes into play. To produce a truely static binary -- if that's what you want --, you must use all static libraries (*.a, not *.so), and use the -static flag. Of course you can produce a dynamic executable with some libraries linked statically. For example, it might make sense to link against the shared libc, but with static kerberos libraries. > I am especially curious how the links to /usr/local are being found when > I haven't used -L/usr/local. ldconfig(8). The -L flags tell the compiler and (compile-time) linker ld(1) where to find the libraries. To actually find shared libraries at run-time, the runtime-linker rtld(1) uses the information stored by ldconfig(8). Please refer to the manual pages mentioned above for details. Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing Dienstleistungen mit Schwerpunkt FreeBSD: http://www.secnetix.de/bsd Any opinions expressed in this message may be personal to the author and may not necessarily reflect the opinions of secnetix in any way. I suggested holding a "Python Object Oriented Programming Seminar", but the acronym was unpopular. -- Joseph Strout