Drivers include -lm because standard C++ libraries such as libc++
and libstdc++ depend on libmath and when statically linking C++
library, this dependency is needed. However, when -nostdlib++ is
used, there's no reason to include -lm anymore.
Details
Details
- Reviewers
- None
Diff Detail
Diff Detail
- Repository
- rC Clang
Event Timeline
Comment Actions
-lm is kind of the reason -nostdlib++ exists at all -- if you don't want _any_ stdlibs, you can just -nostdlib, no?
Comment Actions
We still want standard libraries like -lc and compiler builtins, -nostdlib would remove those. Keeping -lm around is assuming that user is going to link against C++ library that needs -lm which is a lot of assumptions that IMHO driver shouldn't be doing.