From owner-freebsd-current Mon Feb 21 20:42:26 2000 Delivered-To: freebsd-current@freebsd.org Received: from wall.polstra.com (rtrwan160.accessone.com [206.213.115.74]) by hub.freebsd.org (Postfix) with ESMTP id 3F25637B61B for ; Mon, 21 Feb 2000 20:42:23 -0800 (PST) (envelope-from jdp@polstra.com) Received: from vashon.polstra.com (vashon.polstra.com [206.213.73.13]) by wall.polstra.com (8.9.3/8.9.3) with ESMTP id UAA17982 for ; Mon, 21 Feb 2000 20:42:19 -0800 (PST) (envelope-from jdp@polstra.com) From: John Polstra Received: (from jdp@localhost) by vashon.polstra.com (8.9.3/8.9.1) id UAA35349; Mon, 21 Feb 2000 20:42:19 -0800 (PST) (envelope-from jdp@polstra.com) Date: Mon, 21 Feb 2000 20:42:19 -0800 (PST) Message-Id: <200002220442.UAA35349@vashon.polstra.com> To: current@freebsd.org Subject: Re: "Interesting" failure mode for static linking with shared libs. In-Reply-To: <32351.951188747@zippy.cdrom.com> References: <32351.951188747@zippy.cdrom.com> Organization: Polstra & Co., Seattle, WA Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In article <32351.951188747@zippy.cdrom.com>, Jordan K. Hubbard wrote: > > I ran across this as part of my continuing efforts to make the openssl > library pull in the rsaref code at runtime, something which now works > just peachy in the dynamic linking case but does not work in the > static linking case. That is to say that if I want to link ssh > static, for whatever reason, and I compile it up in the following ways > (the names used for the libs aren't exactly correct, I'm just > illustrating a point): > > 1. cc -static ${SSHOBJS} -o ssh -lrsaref -lrsaglue -lssl > > 2. cc -static ${SSHOBJS} -o ssh -lrsaglue -lssl > > Then in case #2 the expected happens, e.g. ssh bitches about needing > the rsa code and aborts since dlopen() is not available to the rsaglue > stub functions I wrote and I'd consider that correct. > > However, case #1 also causes the very same behavior, and that just > mystifies me since I'd have expected the "strong" symbols in librsaref > to have been bound to in preference to the weak ones in librsaglue. > I've also tried referencing the .a file directly in the link line > (cc -static ${SSHOBJS} -o ssh /usr/local/lib/librsaref.a -lrsaglue -lssl) > in hopes that this would somehow get it preferred just on that > basis alone, but no deal. Urk! Any ideas? A simple test case that I built does the right thing. I'll look into your specific example and figure out why it's not working. John -- John Polstra jdp@polstra.com John D. Polstra & Co., Inc. Seattle, Washington USA "Disappointment is a good sign of basic intelligence." -- Chögyam Trungpa To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message