[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Static linking considered harmful

> E.g. ideally we'd drop libpthread.a, librt.a, libstdc++.a, libgfortran.a,
> libboost*.a, all GUI libs that have also *.so libs, etc.

libstdc++.a must stay in Fedora Core.  libstdc++ is not compatible AT ALL
across versions, and there are _many_.  g++ has not learned or implemented
a stable ABI (application binary interface); the "name mangling" to encode
types is not even stable yet.

In fact, the best advice is that libstdc++ MUST be linked static
for any "portable" program.  The mechnanism for doing so isn't
obvious; '-Wl,-Bstatic -lstdc++ -Wl,-Bdynamic' is not sufficient.
Instead use:
   ln -s `g++ --print-file-name=libstdc++.a` .
   g++ -m386 -L. file.cpp
   rm libstdc++.a


Even libgcc_s has a couple more years before it can be considered stable.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]