From 399ac5c3fbe029bf200437fcbbf95189a96adb9f Mon Sep 17 00:00:00 2001 From: Simon Atanasyan Date: Wed, 23 Nov 2016 05:25:02 +0000 Subject: [PATCH] [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 llvm-svn: 287740 --- lld/ELF/Driver.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lld/ELF/Driver.cpp b/lld/ELF/Driver.cpp index 4cff5dcb4d1d..0c6c86a61d84 100644 --- a/lld/ELF/Driver.cpp +++ b/lld/ELF/Driver.cpp @@ -509,6 +509,12 @@ void LinkerDriver::readConfigs(opt::InputArgList &Args) { 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");