[PATCH] D36202: [Driver] Disable static C++ library support on Fuchsia

Petr Hosek via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 1 17:52:00 PDT 2017


phosek added inline comments.


================
Comment at: lib/Driver/ToolChains/Fuchsia.cpp:112
         ToolChain.AddCXXStdlibLibArgs(Args, CmdArgs);
-        if (OnlyLibstdcxxStatic)
-          CmdArgs.push_back("-Bdynamic");
-      }
       CmdArgs.push_back("-lm");
     }
----------------
mcgrathr wrote:
> Shouldn't -lm be conditionalized on ShouldLinkCXXStdlib too?
> It's only there to satisfy references from libc++, right?
> 
> OTOH, -lm is a no-op on Fuchsia so perhaps we should just drop it.  On the third hand, we might separate libm from libc in the future so perhaps it's better to leave it.
I looked at all the other drivers and they all add -lm unconditionally, I'm not sure if it's just a copypasta or if there's some other reason behind it.

I also thought about removing it altogether but arrived to the same conclusion as you did.


Repository:
  rL LLVM

https://reviews.llvm.org/D36202





More information about the cfe-commits mailing list