Issue Details (XML | Word | Printable)

Key: STDCXX-1031
Type: Improvement Improvement
Status: In Progress In Progress
Priority: Major Major
Assignee: Martin Sebor
Reporter: Martin Sebor
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
C++ Standard Library

[gcc 4.0] make use of gcc 4.1 -fvisibility option

Created: 04/Feb/09 04:19 PM   Updated: 15/Feb/09 10:00 PM
Return to search
Component/s: Build and Installation
Affects Version/s: 4.2.1
Fix Version/s: 4.2.2

Time Tracking:
Not Specified

Environment: gcc 4.0 and better on ELF targets

Severity: Inefficiency


 Description  « Hide
The gcc 4.1 -fvisibility option is said to

...very substantially improve linking and load times of shared object libraries, produce more optimized code, provide near-perfect API export and prevent symbol clashes. It is strongly recommended that you use this in any shared objects you distribute.

In order for stdcxx users to benefit as described in the gcc manual we should make use of the -fvisibility=hidden option in conjunction with __attribute__((visibility("default"))) on exported interfaces as the gcc manual recommends.

Besides adding the -fvisibility=hidden option to the command line when building shared libraries with gcc, the implementation involves defining the _RWSTD_EXPORT macro for gcc as follows:

#define _RWSTD_EXPORT __attribute__ ((visibility ("default")))

Note that since gcc requires the __attribute__ decoration only on function declarations and issues a warning when it appears on definitions so the _RWSTD_EXPORT macro must not be used on definitions.



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
No work has yet been logged on this issue.