Boost logo

Boost-Build :

From: David Abrahams (dave_at_[hidden])
Date: 2002-09-03 10:34:33


From: "Thomas Witt" <witt_at_[hidden]>

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
>
> Dave,
>
> On Tuesday 03 September 2002 16:56, David Abrahams wrote:
> > I don't understand the question. Can you please be more specific?
> >
>
> Sorry I try.
>
> Given the following lib target and msvc-tools
>
> lib A : a.cpp b.cpp ;
>
> On the first run (i.e. after clean) the corresponding archive command
will be
> (simplified)
>
> link /lib /out:libA.lib a.o b.o
>
> Change b.cpp and recompile the archive command is
>
> link /lib /out:libA.lib libA.lib a.o b.o
>
> i.e. the existing libA.lib is used as an input file for the new libA.lib.
I
> think this is unneccessary as _all_ object files, not only the newly
> compiled, are used as input for the new archive.

Not if there are enough of them. Remember, this is a piecemeal action.
Also, note the 'updated' attribute, which means that only changed files
will go in the command line. Of course, since we're now using command
files, this is irrelevant.

> IIUC the archive would be
> complete without the old lib. Furthermore the redundant input seems to
cause
> problems. With Intel6 and VC.NET it looks as if sometimes old code from
> libA.lib is preferred over new code from the object files.

That *is* a problem.

> As a result the
> lib and the sources are out of sync. I do not think this is an intel
problem
> as the MS linker gets used.
>
> In my copy I changed the archive action from
>
> actions updated together piecemeal vc-Archive
> {
> $(VC_SETUP)
> if exist "$(<)" set _$(<:B)_="$(<)"
> "$(VC_TOOL_PATH)$(VC_LINKER)" /lib $(ARFLAGS)
> $(PDB_LINKFLAG)"$(VC_PDB_FILE)" /out:"$(<)" %_$(<:B)_% @"$(>)"
> }
>
> to
>
> actions updated together piecemeal vc-Archive
> {
> $(VC_SETUP)
> "$(VC_TOOL_PATH)$(VC_LINKER)" /lib $(ARFLAGS)
> $(PDB_LINKFLAG)"$(VC_PDB_FILE)" /out:"$(<)" @"$(>)"
> }
>
> and everything worked fine.

This logic was taken directly from the Perforce Jambase:

actions updated together piecemeal Archive
{
if exist $(<) set _$(<:B)_=$(<)
$(AR) /out:$(<) %_$(<:B)_% $(>)
}

Is it a good idea? I'm not convinced that it is. I suppose that since we
now use command-files, we can do something more reliable by simply
rebuilding the archive each time. I don't think the speed savings are
significant enough to outweigh the correctness cost.

If you have CVS access, you're welcome to make the change.

-Dave

-----------------------------------------------------------
David Abrahams * Boost Consulting
dave_at_[hidden] * http://www.boost-consulting.com

 


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