From owner-freebsd-current Tue Feb 22 5:19:44 2000 Delivered-To: freebsd-current@freebsd.org Received: from gidora.zeta.org.au (gidora.zeta.org.au [203.26.10.25]) by hub.freebsd.org (Postfix) with SMTP id 5100F37B685 for ; Tue, 22 Feb 2000 05:19:41 -0800 (PST) (envelope-from bde@zeta.org.au) Received: (qmail 12152 invoked from network); 22 Feb 2000 13:19:38 -0000 Received: from bde.zeta.org.au (203.2.228.102) by gidora.zeta.org.au with SMTP; 22 Feb 2000 13:19:38 -0000 Date: Wed, 23 Feb 2000 00:19:34 +1100 (EST) From: Bruce Evans X-Sender: bde@alphplex.bde.org To: "Jordan K. Hubbard" Cc: Martin Cracauer , jdp@FreeBSD.ORG, peter@FreeBSD.ORG, current@FreeBSD.ORG Subject: Re: "Interesting" failure mode for static linking with shared libs. In-Reply-To: <33901.951212465@zippy.cdrom.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Tue, 22 Feb 2000, Jordan K. Hubbard wrote: > > As a workaround for a static binary, you should be able to use > > -Xlinker -Bstatic > > instead of > > -static > > Actually, it appears that just -Xlinker is necessary; it works > fine in conjunction with -static. Thanks for this most helpful > tip! I can see a *lot* of scenarios where I'll be using > -Xlinker in the future. I didn't even know about that flag. :) This is because `-Xlinker -static' is equivalent to `-Xlinker -Bstatic' in the elf case. Passing -static to the linker used to be a common error. The aout linker doesn't understand -static; it has sloppy args checking and misinterprets -static as -s (strip). -Xlinker alone is bogus. -Xlinker is not an option; it modifies the next option by causing it to be passed to the linker instead of interpreted by the compiler. I didn't know about -Xlinker either :-). It is normally spelled `-Wl,'. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message