From owner-freebsd-chat@FreeBSD.ORG Mon Dec 18 10:07:32 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 210D816A412 for ; Mon, 18 Dec 2006 10:07:32 +0000 (UTC) (envelope-from jcw@highperformance.net) Received: from mx1.highperformance.net (dsl081-163-122.sea1.dsl.speakeasy.net [64.81.163.122]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1938743CA5 for ; Mon, 18 Dec 2006 10:07:30 +0000 (GMT) (envelope-from jcw@highperformance.net) Received: from [192.168.1.16] (w16.stradamotorsports.com [192.168.1.16]) by mx1.highperformance.net (8.13.8/8.13.8) with ESMTP id kBIA7SqE044724 for ; Mon, 18 Dec 2006 02:07:28 -0800 (PST) (envelope-from jcw@highperformance.net) Message-ID: <4586685C.1030909@highperformance.net> Date: Mon, 18 Dec 2006 02:07:24 -0800 From: "Jason C. Wells" User-Agent: Thunderbird 1.5.0.4 (Windows/20060516) MIME-Version: 1.0 To: freebsd-chat@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=2.5 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.1.0 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on s4.stradamotorsports.com Subject: Static Link with Shared Object X-BeenThere: freebsd-chat@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Non technical items related to the community List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Dec 2006 10:07:32 -0000 I was trying to create a static version of MIT's ksu in place of Heimdal ksu so I can avoid having dualing kerberos libraries on my system. (Heimdal ksu is borken IMHO.) Does linking to a shared object cause the new object file to be shared also? Stated another way: Why doesn't this produce a static binary? ld -v -Bstatic -L/lib -L/usr/lib -o foo *.o ../../lib/libkrb5.so ../../lib/libcom_err.so ../../lib/libkrb5support.so ../../lib/libk5crypto.so /usr/lib/crt1.o /usr/lib/crti.o /usr/lib/crtbegin.o /usr/lib/crtend.o /usr/lib/crtn.o -lgcc -lc -lgcc ldd foo foo: ../../lib/libkrb5.so (0x280e3000) ../../lib/libcom_err.so (0x2815e000) ../../lib/libkrb5support.so (0x28164000) ../../lib/libk5crypto.so (0x2816c000) libk5crypto.so => /usr/local/lib/libk5crypto.so (0x2818f000) libcom_err.so => /usr/local/lib/libcom_err.so (0x281b1000) libkrb5support.so => /usr/local/lib/libkrb5support.so (0x281b6000) root@s4 grrr su: grrr: command not found I cannot figure out how the (blankety blank) dynamic links are creeping in. The only thing I can figure is that you're not supposed to link to a *.so and your supposed to "just know" that doing so is noobish. I am especially curious how the links to /usr/local are being found when I haven't used -L/usr/local. Thanks, Jason C. Wells