Boost logo

Boost-Build :

Subject: [Boost-build] vacpp.jam
From: Jim Hague (jim.hague_at_[hidden])
Date: 2009-03-13 13:48:49

I just updated an elderly BBv2 install to the current Subversion, and I'm
having a couple of problems with vacpp.jam.

1. Including a external pre-built static library gives me

Error: ambiguity found when searching for best transformation
Trying to produce type 'LIB' from:
Generators that succeeded:
 - builtin.prebuilt
 - vacpp.prebuilt
First generator produced:
 - { /usr/local/lib/liblog4cplus.a.STATIC_LIB }
Second generator produced:
 - { /usr/local/lib/liblog4cplus.a.STATIC_LIB }

Blundering about somewhat at random, I found that the following patch allowed
compilation to proceed. But I must admit I have no real understanding of what
is going on here; I'm hoping some who knows the code can explain.

diff -r 5b628f6ec088 boost-build/tools/vacpp.jam
--- a/boost-build/tools/vacpp.jam Fri Mar 13 16:42:46 2009 +0000
+++ b/boost-build/tools/vacpp.jam Fri Mar 13 17:30:22 2009 +0000
@@ -16,7 +16,8 @@
 feature.extend toolset : vacpp ;
 toolset.inherit vacpp : unix ;
-generators.override vacpp.prebuilt : builtin.lib-generator ;
+generators.override vacpp.prebuilt : builtin.prebuilt ;
 generators.override vacpp.searched-lib-generator : searched-lib-generator ;
 # Configure the vacpp toolset

2. My project fails to build properly because a build tool built during the
build, which links against some component libraries, apparently has some of
those components removed.

The offender is the '-qtwolink' link option. The docs at
describe this option; in brief, it causes the linker to attempt to 'minimize
the number of static constructors included from libraries and object files.
[...] All static constructors in .o files and object files are invoked. This
generates larger executable files, but ensures that placing a .o file in a
library does not change the behavior of a program.'

I suggest that this should only be applied by vacpp.jam as an option; I think
it too aggressive for a universal link option.

Jim Hague - jim.hague_at_[hidden]          Never trust a computer you can't lift.

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