I am not sure what is "expected" is here: $ gcc test.o -o test.so -lstdc++ -shared -static-libstdc++ && ldd test.so | grep libst libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007f848e57d000)
$ gcc test.o -o test.so -shared -static-libstdc++ -lstdc++ && ldd test.so | grep libst libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007fc25516d000) On 16 December 2015 at 20:34, Alexey Samsonov <vonos...@gmail.com> wrote: > samsonov created this revision. > samsonov added reviewers: rafael, compnerd. > samsonov added a subscriber: cfe-commits. > > After this change, AddCXXStdlibLibArgs will check the presence of > -static-libstdc++ flag and, if necessary, wrap -lc++/-lstdc++ in > -Bstatic/-Bdynamic to force static linking of C++ standard library. > > It's no longer necessary to copy this code around across toolchains > (unless toolchain is overriding AddCXXStdlibLibArgs). > > This change has an important consequnce: if the user provides "-lstdc++" > manually (i.e. it's not added automatically when we're linking C++ binary), > then "-static-libstdc++" *will* work as expected. > > Other than that, the change attempts to preserve the existing behavior. > > http://reviews.llvm.org/D15598 > > Files: > lib/Driver/CrossWindowsToolChain.cpp > lib/Driver/ToolChain.cpp > lib/Driver/ToolChains.cpp > lib/Driver/Tools.cpp > test/Driver/static-libstdcxx.c > _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits