Exporting templates on Windows (Re: [Libreoffice-commits] .: 7 commits - clucene/patches clucene/source configure.in cppuhelper/inc hwpfilter/source sal/inc solenv/gbuild vbahelper/inc)

Lubos Lunak l.lunak at suse.cz
Mon Mar 12 11:24:15 PDT 2012

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

 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 at suse.cz

More information about the LibreOffice mailing list