Boost logo

Boost-Build :

From: David Abrahams (dave_at_[hidden])
Date: 2002-12-09 11:17:26


Just in case Jason isn't allowed to post...

 --=-=-= Content-Type: message/rfc822
Content-Disposition: inline

X-From-Line: jason_at_[hidden] Mon Dec 09 10:45:28 2002
Return-Path: <jason_at_[hidden]>
Received: from [195.224.55.237] (HELO executor.cambridge.redhat.com)
by stlport.com (CommuniGate Pro SMTP 3.5.9)
with ESMTP id 145421 for dave_at_[hidden]; Mon, 09 Dec 2002
07:45:39 -0800
Received: from prospero.boston.redhat.com (dell-paw-2.cambridge.redhat.com
[195.224.55.226])
by executor.cambridge.redhat.com (Postfix) with ESMTP
id 6E4D1ABB08; Mon, 9 Dec 2002 15:45:36 +0000 (GMT)
Received: by prospero.boston.redhat.com (Postfix, from userid 4046)
id 065E2F7F49; Mon, 9 Dec 2002 15:45:28 +0000 (GMT)
To: David Abrahams <dave_at_[hidden]>
Cc: jamboost_at_[hidden]
Subject: Re: [jamboost] <link> --- tweaks
References: <3DF4687D.5070803_at_[hidden]> <ubs3vi53h.fsf_at_[hidden]>
From: Jason Merrill <jason_at_[hidden]>
In-Reply-To: <ubs3vi53h.fsf_at_[hidden]> (David Abrahams's message
of "Mon, 09 Dec 2002 10:28:50 -0500")
Date: Mon, 09 Dec 2002 10:45:28 -0500
Message-ID: <wvlk7ijfb6v.fsf_at_[hidden]>
User-Agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.2 (i686-pc-linux-gnu)
X-Content-Length: 1482
Lines: 43
Xref: NEFARIOUS mail.misc:13568
MIME-Version: 1.0

On Mon, 09 Dec 2002 10:28:50 -0500, David Abrahams <dave_at_[hidden]> wrote:

> Vladimir Prus <ghost_at_[hidden]> writes:
>
>> Okay, I've nearly done with the <link> feauture and
>> associated support for -l libraries. I do have a couple
>> of questions for gcc gurus.
>>
>> 1. If I have two libraries, "a", and "b", and want to link
>> the first one statically, and the second one dynamically,
>> what should command line contain.
>> If I try
>>
>> -Wl,-Bdynamic -la -Wl,-Bstatic -lb
>>
>> then it works on certain system. On another, this links
>> both libraries statically, and I need
>>
>> -Wl,-Bdynamic -Wl,-la -Wl,-Bstatic -Wl,-lb
>
> Hmm, this looks like some strangeness in the g++ front-end to the
> linker. Jason, do you know anything about this?

The g++ driver moves any explicit -lm and -lc to the end of the command
line so that they come after the implicit -lstdc++. Other libs should be
unaffected.

>> 2. Is it ever possible to link to static runtime if any lib
>> is dynamic? For example, in default setting both "-lm" and "-lc"
>> are linked dynamically. If I say
>>
>> -Wl,-Bdynamic -lz -Wl,Bstatic
>>
>> (here, the last element should affect runtime libs).
>>
>> Then, -lz is linked dynamically (that's right),
>> "-lm" is linked statically (that's right, too),
>
> How did libm get involved? I don't see it in the command-line.

libstdc++ often depends on libm, so it's added implicitly.

Jason
 --=-=-=

-- 
David Abrahams
dave_at_[hidden] * http://www.boost-consulting.com
Boost support, enhancements, training, and commercial distribution
 --=-=-=-- 

Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk