Boost logo

Boost-Build :

Subject: [Boost-build] Set/reset linker option '-Wl,--whole-archive'
From: Damaschin, Nicolaie (Nicolaie.Damaschin_at_[hidden])
Date: 2012-10-01 03:53:33


Hello everybody!
I'm a new user of Boost.Build (Linux/gcc) and in general it is a good
build tool for C++ projects. But I cannot believe that there
is no good solution for something simple like to surround a lib with some
linker option like:

        ' -Wl,--whole-archive' <static lib> ' -Wl,--no-whole-archive'

I searched the archive and I couldn't find any good solution.

Some posts suggested to turn it into a shared lib, but this not
possible, it's an external prebuilt 'lib..a' which makes used of
static initialization techniques, hence the need for the '-whole-archive'
option. Building an own shared version is what I would like to avoid
since it is not really supported by that lib and it would complicate
deployment.
Other posts suggested to refer to these static objects out of 'main()'
somehow just to have the linker attracting them, but this isn't an option
either since these types/objects aren't part of the public API of that
lib, and even I would now what to refer it could change from one
version to another.

Any ideas how to solve this in an elegant solution/workaround?

Thank you in advance



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