Skip to content

Conversation

@Lastique
Copy link
Member

@Lastique Lastique commented Aug 19, 2018

The new visibility feature can be used to specify default symbol visibility
on compilers and platforms that support it. The default visibility is
hidden, unlike most compilers' defaults. This is intentional so that all
Boost libraries are compiled with hidden visibility by default. Other modes
are: protected and global (the latter is called "default" in gcc documentation).

I've only tested it on Linux, with gcc and clang.

The discussion that led to this PR is here:

http://boost.2283326.n4.nabble.com/all-Request-for-out-of-the-box-visibility-support-tt4704134.html

import feature ;

feature.feature visibility
: hidden protected global
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting the default to be different than the for compilers will affect everyone, not jus boost builds. Please change the default to match the compiler defaults. If boost wants a different kind of build it can set the feature in the appropriate jamfiles.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additionally, this needs to be an optional feature so that the compile option doesn't appear when not specified. I.e. which should be the default.

import feature ;

feature.feature visibility
: hidden protected global
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additionally, this needs to be an optional feature so that the compile option doesn't appear when not specified. I.e. which should be the default.


feature.feature visibility
: global protected hidden
: propagated ;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additionally, this needs to be an optional feature so that the compile option doesn't appear when not specified. I.e. which should be the default.

The new visibility feature can be used to specify default symbol visibility
on compilers and platforms that support it. The default visibility is
global, which matches most compilers' defaults. In gcc documentation it is
called the "default" visibility. Other modes are: protected and hidden.
@Lastique
Copy link
Member Author

I've updated the feature and the docs according the comments, although it sort of defeats the purpose. We could modify library jamfiles before, the point was to make hidden visibility the default so that we don't have to do that. At least the property offers a more portable way to do that.

@swatanabe
Copy link
Contributor

swatanabe commented Aug 19, 2018 via email

@Lastique
Copy link
Member Author

Thanks, Steven, that sounds like a good idea. I'll create a PR for the superproject if this PR is accepted.

@grafikrobot grafikrobot merged commit 898ddfa into boostorg:develop Aug 19, 2018
@Lastique Lastique deleted the add_visibility branch August 19, 2018 19:17
@Lastique
Copy link
Member Author

The related superproject PR is boostorg/boost#190.

@apolukhin
Copy link
Member

Please merge to master. Used that feature in tests, now they fail on master (but do work perfectly on develop)

@grafikrobot
Copy link
Member

Already done in aa73dbc

@github-actions github-actions bot added the transition Transition to bfgroup/b2 label Oct 2, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Oct 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

transition Transition to bfgroup/b2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants