« Return to Thread: [Boost][build] Bjam ordering source $(>) list

Re: [Boost][build] Bjam ordering source $(>) list

by Steven Watanabe-4 :: Rate this Message:

Reply to Author | View in Thread

AMDG

K. Noel Belcourt wrote:

> In jam/src/make1.c, make1list(), I find this comment
>
> * make1list() - turn a list of targets into a LIST, for $(<) and $(>).
>
> which seems like the place where I could ensure that sources for, say
> a link action $(>) are ordered so that objects occur before archives
> or shared libraries.  Some background.
>
> We're bringing up support for linking Fortran programs and have
> discovered that when linking C programs, the objects in $(>) always
> precede the libraries, which is good since the main is often in an
> object file.  This is an issue if, for example, your linker doesn't
> support start / end group and the library precedes the object
> containing main (you get linker errors).

I'm not quite sure that I follow.  Libraries ought to be in a separate
variable from sources.

> In our case, it seems that our objects always precede any libraries
> when linking with C, but when linking with Fortran, we find the
> libraries precede the objects and, hence, we get linker errors.
>
> Back to make1list().  It seems like this is the place where the list
> of sources and targets for an action are turned into a list for $(<)
> and $(>).  Does anyone know (1) if bjam intentionally sorts objects
> before libraries for $(>) and, if it does as it seems to, (2) where is
> to code in bjam that does this?

The order of the targets ought to be controlled by Boost.Build in
gcc.link for example.

In Christ,
Steven Watanabe

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build

 « Return to Thread: [Boost][build] Bjam ordering source $(>) list