On Jul 23, 2017 4:51 PM, "Joerg Sonnenberger" <jo...@bec.de> wrote:
On Sun, Jul 23, 2017 at 03:17:32PM -0400, Nico Weber via cfe-commits wrote: > On Sun, Jul 23, 2017 at 3:08 PM, Joerg Sonnenberger via Phabricator via > cfe-commits <cfe-commits@lists.llvm.org> wrote: > > > joerg added a comment. > > > > I don't really like this. > > That's cool, you don't need to use the flag. I'm not talking about the flag, but the implementation. > > The reason why -lm is added explicitly on many targets is because the C++ > > STL typically depends on it and that means for static linking and broken > > ELF linkers, it will be necessary to link against it explicitly. > > > > The driver adds -lm at the end, so it'll work if you add your static libc++ > flag in user flags, and then -lm gets added at the end. But from what I > understand, -lm is also there as a usability thing to make c++ a bit more > accessible than c in this regard, not just for the c++ standard library. > (Also, if you're trying to statically link your c++ lib, it's possible you > have some influence on your linker as well.) I don't think so, it strongly seems to be an implementation detail of the STL interaction. > > There is also the question on whether any platform we have currently uses > > separate STL and ABI libraries and it is not clear whether the flag should > > handle both. > > > > Yes, it should handle both. If you update the comments and documentation accordingly and stop the current passing of -lm If you need this behavior for something, that sounds like something a -nodefaultlibs++ could do. -nostdlib++ is really meant to disable the c++ stdlib and nothing else. , it is fine with me. I don't think the libmath handling should be forced on other STL implementations.
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits