[PATCH] [lld] ELF: Support detection of relocation errors during processing

Simon Atanasyan simon at atanasyan.com
Mon Jan 5 05:34:42 PST 2015


On Mon, Jan 5, 2015 at 1:55 PM, Will Newton <will.newton at linaro.org> wrote:
> On 2 January 2015 at 17:32, Simon Atanasyan <simon at atanasyan.com> wrote:
>> ================
>> Comment at: lib/ReaderWriter/ELF/SectionChunks.h:418
>> @@ +417,3 @@
>> +                                                          *ai, *ref)) {
>> +        printError(EC.message(), *ai, *ref);
>> +        success = false;
>> ----------------
>> Now `parallel_for_each` does all tasks in the single thread.
>> But in the future the body of this loop can be parallelized.
>> Does the `printError` ready to be called from multiple threads?
>
> I had that issue on my mental todo list but sort of pushed it to one
> side. Is there a good way to output messages from threads in the
> current infrastructure? I can switch to using e.g. Twine to build the
> error message and output it in one go. errs is unbuffered but it is
> not clear to me (yet) whether this is sufficient to guarantee that
> output is not interleaved.
>
>> http://reviews.llvm.org/D6827

As far as I know other LLVM/Clang tools do not show error messages
from multiple thread. Probably the LLD will be the first tool requires
such functionality. As to me I would use some sort of synchronization
primitives like mutex or critical section. Any other opinions?

-- 
Simon Atanasyan



More information about the llvm-commits mailing list