D35780 has introduced the new -nostdlib++ flag that disables linking
of C++ standard library, but it still leaves -lm on the link line.
AFAIK the reason why -lm was on the link line in the first place is
because C++ standard libraries like libc++ and libstdc++ depend on -lm
and that dependency is needed when statically linking C++ standard
Nico's argument on D35780 was that -nostdlib++ should only disable C++
standard library and nothing else, and that -lm is there not just for
the C++ standard library. Is that the case? Would C++ compiler ever
generate references directly against libm?
If not, then I'd argue that -nostdlib++ should drop -lm as well. If
users opt to provide their own C++ library which depends on -lm, it
should be their responsibility to include that link dependency. I have
implemented this change in D54681, reviews are welcome.
cfe-dev mailing list
[hidden email] http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev