stdcxx-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Sebor (JIRA)" <>
Subject [jira] Created: (STDCXX-1031) [gcc 4.1] make use of gcc 4.1 -fvisibility option
Date Wed, 04 Feb 2009 16:19:59 GMT
[gcc 4.1] make use of gcc 4.1 -fvisibility option

                 Key: STDCXX-1031
             Project: C++ Standard Library
          Issue Type: Improvement
          Components: Build and Installation
    Affects Versions: 4.2.1
         Environment: gcc 4.1 and better on ELF targets
            Reporter: Martin Sebor
            Assignee: Martin Sebor
             Fix For: 4.2.2

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.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message