]> granicus.if.org Git - clang/commitdiff
Support -pthread in mingw toolchain.
authorYaron Keren <yaron.keren@gmail.com>
Mon, 6 Jul 2015 18:52:19 +0000 (18:52 +0000)
committerYaron Keren <yaron.keren@gmail.com>
Mon, 6 Jul 2015 18:52:19 +0000 (18:52 +0000)
"-pthread" appends -lpthread after the object files list passed to the linker.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@241485 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/Tools.cpp

index 3ea2b36cf52a5793e01d7366705ebd9c4961697b..768781227fb499d93b956c748e27b9fddb8b1c67 100644 (file)
@@ -8972,10 +8972,8 @@ void MinGW::Linker::ConstructJob(Compilation &C, const JobAction &JA,
       if (Args.hasArg(options::OPT_pg))
         CmdArgs.push_back("-lgmon");
 
-      // FIXME: what to do about pthreads library?
-      // Currently required for OpenMP and posix-threading libgcc, 
-      // does not exists in mingw.org.
-      //CmdArgs.push_back("-lpthread");
+      if (Args.hasArg(options::OPT_pthread))
+        CmdArgs.push_back("-lpthread");
 
       // add system libraries
       if (Args.hasArg(options::OPT_mwindows)) {