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

stephan.yichao.zhao via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 27 17:30:06 PDT 2021


stephan.yichao.zhao added a comment.

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;


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

https://reviews.llvm.org/D112297



More information about the llvm-commits mailing list