[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [Libevent-users] Something to consider for future



Unfortunately, this won't solve the problem in a portable way as pragma is purely a GCC extension. Many of our users build with Intel and other compilers, so we need a more generalized solution.

I have asked the OMPI developers who did the visibility work if they could either share their generalized solution to this problem, or provide guidance on how to port it to libevent. I'll forward the response as soon as I get it.


On Sep 7, 2010, at 12:14 PM, Springande Ulv wrote:

> 
> On Sep 7, 2010, at 5:35 PM, Nick Mathewson wrote:
> 
>> The remaining non-static symbols are ones
>> shared between modules, and of course C doesn't let you make those
>> static.  The right solution here is probably to manually tell the
>> linker about what symbols to export and what symbols not to export.
>> On windows, this is the dllexport/dllimport stuff stuff.  With gcc4 on
>> other platforms, this is the __attribute__((visibility(...))) stuff.
>> ( http://gcc.gnu.org/wiki/Visibility )
> 
> A third easier option is to use GCC; visibility push and pop:
> 
> #pragma GCC visibility push(hidden)
> 
> protected objects, will be hidden in the ABI, but accessible from other modules
> 
> #pragma GCC visibility pop
> 
> See e.g. this for practical usage, http://code.google.com/p/libzdb/source/browse/trunk/src/db/ResultSet.c***********************************************************************
> To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
> unsubscribe libevent-users    in the body.

***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users    in the body.