Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


On Monday 12 of March 2012, Stephan Bergmann wrote:
On 03/12/2012 03:09 PM, Lubos Lunak wrote:
...

Looks like a misunderstanding whether hidden visibility is intended for
"remove unnecessary entries from dynamic symbol tables (but keeping
certain symbols exported to not violate certain standard requirements)"
or "allow violations of ODR by hiding classes completely from dynamic
symbol tables."  I had naively assumed the former, while compiler
writers apparently use the latter interpretation.

 Yes, I don't remember ever having seen the former interpretation. I've always 
seen hidden visibility as "is never used outside of the .so".

So in general I think templates need to be exported

I guess general reluctance against that insight in LO stems from LO
being cross-platform, and the Windows dllimport/export model being
substantially different from the GCC/ELF visibility model, and not
marking (all-inline) templates for neither dllimport/export nor default
visibility was the only approach that did work across all compilers,
MSVC, GCC, and Sun.  (If only worked sort of, see Michael's link to
<http://web.archive.org/web/20100504161204/http://blogs.sun.com/GullFOSS/en
try/why_some_compilers_suck_more>.)

 I've already pushed the new macro that uses default visibility on ELF and 
nothing elsewhere (not sure about MacOSX, but since it's apparently worked 
well there so far, I've kept it as empty too).

(also look e.g. at STL headers, which export the entire std namespace,

Not sure what you mean here.  At least with Fedora GCC 4.6, (all-inline)
std class templates are not visibility-attributed (so would cause the
problems discussed at <http://llvm.org/bugs/show_bug.cgi?id=11250> if
client code derived from them).

 Almost all STL headers here (4.6) have "namespace std 
_GLIBCXX_VISIBILITY(default) {" somewhere near the top.

-- 
 Lubos Lunak
 l.lunak@suse.cz

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.