Re: [Boost-bugs] [Boost C++ Libraries] #2114: Patch for export symbols from shared library

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #2114: Patch for export symbols from shared library
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-10-12 16:59:06


#2114: Patch for export symbols from shared library
----------------------------------------------------------------------------------+
 Reporter: arhip | Owner: johnmaddock
     Type: Patches | Status: new
Milestone: To Be Determined | Component: config
  Version: Boost Development Trunk | Severity: Cosmetic
 Keywords: symbol export shared library gcc exception dynamic shared object dso |
----------------------------------------------------------------------------------+

Comment(by anonymous):

 Boost.Exception should be fixed as well.

 Let me explain: If I make a DSO, say a.so, which throws an exception, say
 my_exception, which is derived from std::exception and boost::exception,
 and use the GCC -fvisibility=hidden flag in building the a.so,
 boost::exception typeinfo is not visible to the application using the
 a.so, since it will be looked for inside the DSO where it's hidden. As a
 consequence, for example, if I try to catch a my_exception thrown from the
 a.so in the application side as a reference to boost::exception, it will
 pass right through and bad things will happen. Hence IMO boost::exception
 should always use default visibility with GCC similar to std::exception.
 In 1.40 it does not.

 Another issue with Boost.Exception is the BOOST_THROW_EXCEPTION macro
 since it seems to throw an instance of
 boost::exception_detail::clone_impl<my_exception>. Since it is a template,
 there is an easy, non-intrusive workaround: I can just declare the
 specialization in my own header file with default visibility attribute.
 Unfortunately this can not be done for boost::exception.

 All in all, IMO boost::exception should always use default visibility.
 Setting it in boost/exception/exception.hpp at least fixed my problems
 with visibility and boost exceptions.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/2114#comment:17>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:01 UTC