This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: -fvisibility-inlines-hidden not hiding inline methods?
- From: Lassi Tuura <lat at cern dot ch>
- To: Ian Lance Taylor <iant at google dot com>
- Cc: <gcc-help at gcc dot gnu dot org>, Peter Elmer <Peter dot Elmer at cern dot ch>, Giulio Eulisse <Giulio dot Eulisse at cern dot ch>
- Date: Fri, 10 Jul 2009 17:25:01 +0200
- Subject: Re: -fvisibility-inlines-hidden not hiding inline methods?
- References: <E2B47A97-DB38-4A7F-B1DA-9741077CFB85@cern.ch> <m3eiso4mn2.fsf@google.com>
Hi,
-fvisibility-inlines-hidden only affects inline methods. It does not
affect inline functions which are not methods. E.g., your test cases
uses std::sort, but std::sort is not an inline method of any
class. In
general -fvisibility-inlines-hidden does not apply to template
instantiations, since that would break explicit instantiations.
Thanks. We do see this happening for members as well such as
std::vector<T>::_M_insert_aux. Do I understand you correctly the
option only applies to non-template inline member functions? That
would be unfortunate as we have by far more template-generated inline
goo than other origins :-/
Is there any way to override the above restriction to apply to all
inlines - or at least templates and out-of-class free functions
included - and/or would a patch to enable such behaviour be accepted?
Should one expect any major drawbacks for such a change on pretty bog
standard C++ use, such as standard library or boost?
Is different visibility for template specialisations common for those
that use the option? I couldn't think of any construct in our code
that would call for it, and was wondering if there were examples of
how it's used elsewhere so that I don't misunderstand this feature.
Lassi