Re: [Boost-bugs] [Boost C++ Libraries] #4594: Boost exception classes do not have GCC default visibility

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #4594: Boost exception classes do not have GCC default visibility
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-07-08 14:56:16


#4594: Boost exception classes do not have GCC default visibility
------------------------------------------------------------+---------------
  Reporter: Jonathan Jones <jonathan.jones@…> | Owner: emildotchevski
      Type: Patches | Status: closed
 Milestone: To Be Determined | Component: exception
   Version: Boost 1.40.0 | Severity: Showstopper
Resolution: fixed | Keywords:
------------------------------------------------------------+---------------

Comment (by mark.schisler@…):

 This bug is actually causing X-Code 4.01 and LLVM/GCC 4.2 to not link
 Boost 1.46.1 correctly with or without symbols hidden. I ended up with the
 following linker error.
 {{{
 ld: bad codegen, pointer diff in
 boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<std::runtime_error>
>::rethrow() constto global weak symbol vtable for boost::exceptionfor
 architecture i386
 collect2: ld returned 1 exit status
 }}}

 I'm not sure if it's a minimal solution or not, but I was able to resolve
 the problem by applying a fix similar to what was suggested by Jonathan.
 I enclosed exception/exception.hpp and exception/detail/exception_ptr.hpp
 in the following guards:
 {{{
 #if defined(__GNUC__)
 # if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
 # pragma GCC visibility push (default)
 # endif
 #endif

 #if defined(__GNUC__)
 # if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
 # pragma GCC visibility pop
 # endif
 #endif
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/4594#comment:11>
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:06 UTC