[PATCH] D112297: [LTO] Fix assertion failed when flushing bitcode incrementally for LTO output.

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 27 21:31:53 PDT 2021


MaskRay added a comment.

In D112297#3092088 <https://reviews.llvm.org/D112297#3092088>, @stephan.yichao.zhao wrote:

> In D112297#3092055 <https://reviews.llvm.org/D112297#3092055>, @MaskRay wrote:
>
>> Thanks for the pointer. Do you have suggestion on how/where to fix the issue leveraging `SupportsSeeking`?
>
> The spec of lseek <https://pubs.opengroup.org/onlinepubs/009695399/functions/lseek.html> says
>
>> The behavior of lseek() on devices which are incapable of seeking is implementation-defined. The value of the file offset associated with such a device is undefined.
>
> Is /dev/null a device-like file? If so, using lseek is not a stable approach.
>
> Maybe using the following for both WIN32 and non-WIN32 is better
>
>   SupportsSeeking = !EC && Status.type() == sys::fs::file_type::regular_file;

Agreed. Does this change address this patch's issue (`ld.lld --plugin-opt=emit-llvm -mllvm -bitcode-flush-threshold=0 -o /dev/null %t.o`)?

Can you post a patch?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D112297/new/

https://reviews.llvm.org/D112297



More information about the llvm-commits mailing list