|
|
Log in / Subscribe / Register

libstdc++ licensing

libstdc++ licensing

Posted May 8, 2013 8:46 UTC (Wed) by khim (subscriber, #9252)
In reply to: libstdc++ licensing by mathstuf
Parent article: Stallman: The W3C's Soul at Stake

The ideal solution (which I believe Windows uses, but I'm not 100% sure) is the "only look up in linked libraries".

That's not an ideal solution: this means you can not have few different implementations of the same ABI (think gnutls vs openssl) and switch them at runtime. And Windows still uses only filename to resolve collisions thus problems are still possible.

What you want to do in Linux is to use different version strings for different versions of libraries (especially for the libraries like boost which are changing ABI often), but sadly only few standard libraries do that - everyone else pray to "our distribution makers will just rebuild the whole world to keep everything compatible". Kind of ironic to see that once upon time FSF promoted technologies which are good mostly for "nonfree" programs.

The inline namespace trick introduced in C++11 would help tremendously, but that's years down the line for common usage.

… if you forget the fact that inline namespaces are just a minor improvement over ages-old "using namespace nested;". Sure, "using namespace nested" is problematic if you want to do, e.g., partial specialization of templates but these cases are extremely rare: I've built Gentoo system with thousand of packages after building gcc with --enable-symvers=gnu-versioned-namespace and only had couple of problems in places where things were broken by design (where people forward-declared things in std:: namespace instead of including proper header).

IOW: there are more then enough ways to solve compatibility issues in Linux, but to actually do that you need to think ahead and this is extremely unfashionable nowadays. It's much easier to complain on forums about lack of a "silver bullet" (when new "silver bullet" arrives people quickly find out that it does not solve the problem of careless design too and continue complains with abandon).


to post comments

libstdc++ licensing

Posted May 8, 2013 9:16 UTC (Wed) by khim (subscriber, #9252) [Link]

Sure, "using namespace nested" is problematic if you want to do, e.g., partial specialization of templates but these cases are extremely rare: I've built Gentoo system with thousand of packages after building gcc with --enable-symvers=gnu-versioned-namespace and only had couple of problems in places where things were broken by design (where people forward-declared things in std:: namespace instead of including proper header).

Oh, sorry, I take my words back: in reality it all was based on "inline namespaces", of course - my memory is just fuzzy. As this proposal claims "inline namespaces" functionality was added (under the "using namespace nested __attribute__ ((strong))" guise) more then eight years ago and is now supported on all Linux distributions (including such slow-moving as Debian or RHEL). I've used them in my work about seven years ago. Plain "using namespace nested" approach is even older, of course, but it's less compatible.


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds