Boost logo

Boost :

Subject: Re: [boost] [config] GCC symbol visibility across shared libraries
From: Jürgen Hunold (juergen.hunold_at_[hidden])
Date: 2010-05-06 12:42:35


Hi Beman,

On Wednesday, 5. May 2010 15:44:27 you wrote:
> There are several outstanding tickets (2114, 2309, 3697) dealing with
> GCC symbol visibility across shared libraries (DSO's on UNIX-like
> systems, DLL's on Windows-like systems).
>
> A particular problem that is affecting several Boost libraries
> (system, filesystem, threads, etc) is that with compiler switch
> -fvisibility=hidden an exception thrown in one library cannot be
> caught in another library or in the main program.
>
> For more background, see http://gcc.gnu.org/wiki/Visibility
>
> Ticket 2114 provided patches to fix the problem, and work started on
> getting them ready for trunk. But that work seems to have stalled. See
> http://svn.boost.org/trac/boost/ticket/2114
>
> What needs to be done to restart this effort?

Well, your mail ;-))

I've got a working patch set lying around. Please find it attached.
Real life got in the way (as usual)...

The patch introduces two Boost.Config macros
- BOOST_SYMBOL_EXPORT
- BOOST_SYMBOL_IMPORT

for Windows and gcc > 4.
Those lack the needed test cases at the moment (lack of time on my side).
The patch replaces
__declspec(dllexport) with BOOST_SYMBOL_EXPORT
__declspec(dllimport) with BOOST_SYMBOL_IMPORT
and removes visibility declarations from forward declarations in order to
eliminate gcc warnings. msvc does not care, but does only need visibility
information when the class in declared.
Tested with
- gcc-4.3, 4.4, 4.5
- msvc 9.0

I can do a msvc 10.0 run if needed.

> It would be better is discussion could occur on this list, rather than
> as comments attached to the ticket. That will ensure more eyeballs
> look at this.

Yes, please take a careful look at the patch.

Yours,

Jürgen

-- 
* Dipl.-Math. Jürgen Hunold       ! Ingenieurgesellschaft für 
* voice: ++49 511 262926 57       ! Verkehrs- und Eisenbahnwesen mbH  
* fax  : ++49 511 262926 99       ! Lister Straße 15
* juergen.hunold_at_[hidden]        ! www.ivembh.de
* 
* Geschäftsführer:                ! Sitz des Unternehmens: Hannover
* Prof. Dr.-Ing. Thomas Siefer    ! Amtsgericht Hannover, HRB 56965
* PD Dr.-Ing. Alfons Radtke       !



Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk