Add support for -s, -pthread and -pthreads. Thanks to Hans Wennborg and
Cosmin Truta for reporting it.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118826 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp
index eb5c8ab..1addf47 100644
--- a/lib/Driver/Tools.cpp
+++ b/lib/Driver/Tools.cpp
@@ -3211,6 +3211,9 @@
if (Args.hasArg(options::OPT_rdynamic))
CmdArgs.push_back("-export-dynamic");
+ if (Args.hasArg(options::OPT_s))
+ CmdArgs.push_back("-s");
+
for (std::vector<std::string>::const_iterator i = ToolChain.ExtraOpts.begin(),
e = ToolChain.ExtraOpts.end();
i != e; ++i)
@@ -3307,6 +3310,9 @@
else if (!Args.hasArg(options::OPT_shared) && D.CCCIsCXX)
CmdArgs.push_back("-lgcc");
+ if (Args.hasArg(options::OPT_pthread) || Args.hasArg(options::OPT_pthreads))
+ CmdArgs.push_back("-lpthread");
+
CmdArgs.push_back("-lc");
if (Args.hasArg(options::OPT_static))