You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@celix.apache.org by Alexander Broekhuis <a....@gmail.com> on 2014/10/02 09:25:35 UTC

Symbol visibility

Hi all,

In the past I have done some work for symbol visibility, this has never
been enabled properly (or has been disabled for some reason). I'd like to
enable this now in the build.

I did some local testing, and I don't see any problems with it. Besides
setting visibility in the framework and the utils, something has to be
setup for use in private/exported/imported libraries as well. I can add
something for this.

What is a problem however, is the fw_log function which is now used in some
bundles as well. The fw_log function is specifically for the framework
itself, and not for others, so it should not be exported.
In places where logging is needed, the log_service should be used. Bjoern
already proposed to write some helper code to easily get a logger and use
it. I'd like to see this as well.

Besides the fw_log I assume several other (framework private) functions are
now exported as well, this will need to be addressed later on as well.

What do you all think?

-- 
Met vriendelijke groet,

Alexander Broekhuis

Re: Symbol visibility

Posted by Alexander Broekhuis <a....@gmail.com>.
2014-10-02 21:49 GMT+02:00 Pepijn Noltes <pe...@gmail.com>:

>
>
> +1
>
> Sounds like a good idea, I assume that if a compiler/linker does not
> support this you can easily turn if off ?
>

The macros for visibility are defined in a header per compiler, if a
compiler does not support it, the macro is defined without any value. So
there should be no problem with unsupported compilers.

I'll do a last check, and then commit the changes. For now I have made the
fw_log function exported as well, I'd like to change this sooner then
later.. So will look into that one somewhere in the coming weeks.


-- 
Met vriendelijke groet,

Alexander Broekhuis

Re: Symbol visibility

Posted by Pepijn Noltes <pe...@gmail.com>.
Hi,



On Thu, Oct 2, 2014 at 9:25 AM, Alexander Broekhuis
<a....@gmail.com> wrote:
> Hi all,
>
> In the past I have done some work for symbol visibility, this has never
> been enabled properly (or has been disabled for some reason). I'd like to
> enable this now in the build.
>
> I did some local testing, and I don't see any problems with it. Besides
> setting visibility in the framework and the utils, something has to be
> setup for use in private/exported/imported libraries as well. I can add
> something for this.
>
> What is a problem however, is the fw_log function which is now used in some
> bundles as well. The fw_log function is specifically for the framework
> itself, and not for others, so it should not be exported.
> In places where logging is needed, the log_service should be used. Bjoern
> already proposed to write some helper code to easily get a logger and use
> it. I'd like to see this as well.
>
> Besides the fw_log I assume several other (framework private) functions are
> now exported as well, this will need to be addressed later on as well.
>
> What do you all think?

+1

Sounds like a good idea, I assume that if a compiler/linker does not
support this you can easily turn if off ?

Greetings,
Pepijn