[PATCH] D54681: [Driver] Avoid including -lm on the link line with -nostdlib++

Petr Hosek via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Nov 18 19:11:22 PST 2018


phosek created this revision.
Herald added a subscriber: cfe-commits.

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.


Repository:
  rC Clang

https://reviews.llvm.org/D54681

Files:
  clang/lib/Driver/ToolChains/DragonFly.cpp
  clang/lib/Driver/ToolChains/Fuchsia.cpp
  clang/lib/Driver/ToolChains/Gnu.cpp
  clang/lib/Driver/ToolChains/Hexagon.cpp
  clang/lib/Driver/ToolChains/Minix.cpp
  clang/lib/Driver/ToolChains/NaCl.cpp
  clang/lib/Driver/ToolChains/NetBSD.cpp
  clang/lib/Driver/ToolChains/OpenBSD.cpp
  clang/lib/Driver/ToolChains/PS4CPU.cpp
  clang/test/Driver/nostdlibxx.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54681.174555.patch
Type: text/x-patch
Size: 8918 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181119/4772da27/attachment.bin>


More information about the cfe-commits mailing list