On 11/17/2015 06:51 PM, Roger Leigh wrote:
> completely breaks the case where there is no direct symbol usage but the 
> library is still required for correct functioning of the library or 
> program, e.g. as a side-effect of ELF constructors for C++ static 
> initialisation and destruction.

You should not rely on just having linked to a shared library to have
its static initialization and destruction executed.  Some systems use
lazy initialization and won't perform static initialization of any
data in a translation unit until just before the first actual call
to a symbol in that unit at run time.

In order to reliably cause a library to be initialized one must call
into it explicitly.  I'm not familiar with boost_log_setup but they
should have some way to do this.  Otherwise there would be no way
to make it work for statically linked binaries.

-Brad

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

Reply via email to