[PATCH] D98278: [test] Only use hardcoded errno messages when compiling with an MSVC implementation

Markus Böck via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 11 01:51:12 PST 2021


zero9178 added a comment.

In D98278#2616932 <https://reviews.llvm.org/D98278#2616932>, @mstorsjo wrote:

> In D98278#2616916 <https://reviews.llvm.org/D98278#2616916>, @zero9178 wrote:
>
>> Add GetErrcMessages.cmake, which contains a cmake function to automatically get the error messages of various posix error codes needed by lit by running a small C++ program.
>> Currently ENOENT, EISDIR, EINVAL and EACCES are supplied. 
>> These error messages are then currently supplied to clang, llvm and lld as the errc_messages config parameter.
>>
>> Regarding Cross compiling: the function uses try_run which when cross compiling may use the CMAKE_CROSSCOMPILING_EMULATOR to run the code.
>
> How does it behave if such a thing isn't hooked up? Ideally it'd fall back silently and these parts of tests would just fail, but not block things overall.

It will fall back to using Python's strerror, potentially failing if pythons strerror would not return the same strings (only the case for MSVC I believe).


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

https://reviews.llvm.org/D98278



More information about the llvm-commits mailing list