Date: Mon, 21 Feb 2000 20:42:19 -0800 (PST) From: John Polstra <jdp@polstra.com> To: current@freebsd.org Subject: Re: "Interesting" failure mode for static linking with shared libs. Message-ID: <200002220442.UAA35349@vashon.polstra.com> In-Reply-To: <32351.951188747@zippy.cdrom.com> References: <32351.951188747@zippy.cdrom.com>
next in thread | previous in thread | raw e-mail | index | archive | help
In article <32351.951188747@zippy.cdrom.com>, Jordan K. Hubbard <jkh@zippy.cdrom.com> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200002220442.UAA35349>