[lld] r322041 - Do not use parallelForEach to call maybeCompress().

Hans Wennborg via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 17 05:14:30 PST 2018


Merged to 6.0 in r322647.

On Tue, Jan 9, 2018 at 12:12 AM, Rui Ueyama via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
> Author: ruiu
> Date: Mon Jan  8 15:12:42 2018
> New Revision: 322041
>
> URL: http://llvm.org/viewvc/llvm-project?rev=322041&view=rev
> Log:
> Do not use parallelForEach to call maybeCompress().
>
> Currently LLVM's paralellForEach has a problem with reentracy.
> That caused https://bugs.llvm.org/show_bug.cgi?id=35788 (lld somtimes
> hangs while linking Ruby 2.4) because maybeCompress calls writeTo which
> uses paralellForEach.
>
> This patch is to avoid using paralellForEach to call maybeCompress
> to workaround the issue.
>
> Modified:
>     lld/trunk/ELF/Writer.cpp
>
> Modified: lld/trunk/ELF/Writer.cpp
> URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Writer.cpp?rev=322041&r1=322040&r2=322041&view=diff
> ==============================================================================
> --- lld/trunk/ELF/Writer.cpp (original)
> +++ lld/trunk/ELF/Writer.cpp Mon Jan  8 15:12:42 2018
> @@ -432,8 +432,8 @@ template <class ELFT> void Writer<ELFT>:
>    // If -compressed-debug-sections is specified, we need to compress
>    // .debug_* sections. Do it right now because it changes the size of
>    // output sections.
> -  parallelForEach(OutputSections,
> -                  [](OutputSection *Sec) { Sec->maybeCompress<ELFT>(); });
> +  for (OutputSection *Sec : OutputSections)
> +    Sec->maybeCompress<ELFT>();
>
>    Script->allocateHeaders(Phdrs);
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits


More information about the llvm-commits mailing list