Boost logo

Boost-Build :

Subject: [Boost-build] [Boost][build] Bjam ordering source $(>) list
From: K. Noel Belcourt (kbelco_at_[hidden])
Date: 2009-06-25 18:29:04


Hi,

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).

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?

Any ideas?

Thanks.

-- Noel Belcourt


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