[lld] r287740 - [ELF][MIPS] Turn Config->Threads off for MIPS targets

Simon Atanasyan via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 22 21:25:02 PST 2016


Author: atanasyan
Date: Tue Nov 22 23:25:02 2016
New Revision: 287740

URL: http://llvm.org/viewvc/llvm-project?rev=287740&view=rev
Log:
[ELF][MIPS] Turn Config->Threads off for MIPS targets

For now MipsGotSection class is not ready for concurrent access from
multiple threads. The problem is in the getPageEntryOffset method. It
changes state of MipsGotSection object and might be called from
different threads at the same time. So turn Threads off for this target.

It's a temporary solution. The patch fixes MipsGotSection::getPageEntryOffset
is almost ready.

Differential revision: https://reviews.llvm.org/D27035

Modified:
    lld/trunk/ELF/Driver.cpp

Modified: lld/trunk/ELF/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Driver.cpp?rev=287740&r1=287739&r2=287740&view=diff
==============================================================================
--- lld/trunk/ELF/Driver.cpp (original)
+++ lld/trunk/ELF/Driver.cpp Tue Nov 22 23:25:02 2016
@@ -509,6 +509,12 @@ void LinkerDriver::readConfigs(opt::Inpu
   Config->Verbose = Args.hasArg(OPT_verbose);
   Config->WarnCommon = Args.hasArg(OPT_warn_common);
 
+  if (Config->EMachine == EM_MIPS)
+    // For now MipsGotSection class is not ready for concurent access
+    // from multiple thread. The problem is in the getPageEntryOffset
+    // method. So turn Threads off for this target.
+    Config->Threads = false;
+
   Config->DynamicLinker = getString(Args, OPT_dynamic_linker);
   Config->Entry = getString(Args, OPT_entry);
   Config->Fini = getString(Args, OPT_fini, "_fini");




More information about the llvm-commits mailing list