Boost logo

Boost-Build :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2003-07-30 01:40:20

Hi Christopher,
> Ok, now that I have my usage-dependencies cascading properly, all my
> libraries are building like I expect. However, I'm now encountering a
> problem where the libraries aren't being ordered properly on the link
> line.


> Here we have an application that uses a central manager library, that
> depends on two helper libraries, that both depend on some common code
> library. All the libs build fine, but the linker is given something like
> the following (paths removed for clarity):
> CC -g -o app main.o libmanager.a libcommon.a libsub1.a libsub2.a

Agh... that issue. The
story is this. Once, Ali wrote a patch to close this issue. However, he did
not posted it, because in his opinion, it will not work in some

In fact, I'm not sure about it. There are several scenarios involing
dependency of one library on another:

lib a : a.cpp b ;
lib a : a.cpp : <library>b ;
lib a : a.cpp : <dependency>b ;

The first two cases are equvivalent, and should imply specific order of "a"
and "b" on the command line.

There's a question about the third one. The <dependency> feature is "weak"
dependency --- it does not specify how 'b' is to be used by 'a' and in this
case, it's not even used: only usage requirements are propageted.

So, we can either introduce new feature <uses-symbol-from> which grabs usage
requirements and also implies link line order, or make <dependency> imply
link line order. The second solution is better, IMO, since for users,
<uses-symbols-from> is a bit cryptic.

But, this is the only hard question. Once we decided that, say, <dependency>
implied link order, everything should be workable (though maybe some
technical work is needed).

If you have two 'virtual-target' instances, it's possible to figure out
properties of both of them, and detect dependencies.

That's the story. As you can see, the issue is scheduled for Milestone 9,
which is not very soon. But maybe, Ali can send still his patch? After all,
it would make situation simply better that it is now. Ali, what do you think?

- Volodya


Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at