[Bug libstdc++/21405] Template inlines have global visibility
--- Comment #12 from cristipp at excite dot com 2006-03-20 17:07 --- (In reply to comment #11) > There is an one defintion rule in C++ unlike most other languages which have > weak symbols. And if you are working around it by using hidden symbols well > you are asking to run into troubles. I don't believe that C++ has to say (should say) anything that pertains to shared libraries. Moreover, symbol versions were added as workarounds for problems created by the ELF format semantics. This is a platform specific problem, not a pure C++ problem. However, to have the gnu toolchain to properly support C++ on ELF platforms, adding proper versioning for *all* symbols, including template-originated symbols is a must. I'm not sure if this is a task for g++ of for the linker or for both, but someone should eventually acknowledge that there is a problem and start looking for solutions... -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21405
[Bug libstdc++/21405] Template inlines have global visibility
--- Comment #14 from cristipp at excite dot com 2006-03-20 18:32 --- The problem is not how the dynamic linker treats 'weak' symbols. The problem is that template originating functions having no version numbers. It just happen that template originating functions are also marked as weak (if I understand correctly). In other words, if I have a regular C/C++ function, I can attach version strings to it, whereas it I have a C++ template function I cannot attach version strings to it, or more precisely to instances of it. I don't really care whether symbols are 'weak' or 'strong', I only care of proper versioning for *all* C++ symbols. I believe that this situation was clearly described by the original bug reporter 10 months ago. For some reason nobody seems to acknowledge that there is a problem, the main line of reasoning so far being that 'C++ standard says only unique (weak) names are valid'. However, that flies in the face of the whole synmbol versioning mechanism, weak symbols or not. Afterall, versioning for symbols was introduced precisely to allow multiple instances of the same symbol to be valid in a shared object context. Please feel free to correct me on any g++ internal details on which I am no expert. However, the root problem is there and is a show-stopper for any attempt of distributing pre-compiled C++ shared object binaries. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21405
[Bug libstdc++/21405] Template inlines have global visibility
--- Comment #18 from cristipp at excite dot com 2006-03-22 19:10 --- (In reply to comment #17) > see the solution in 24660 I'm not sure I understand correctly: are all C++ template libraries supposed to add 24660-style machinery? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21405