[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
Wed Mar 10 07:44:19 PST 2021


zero9178 updated this revision to Diff 329651.
zero9178 added a comment.
Herald added a subscriber: mgorny.

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.

One thing I definitely need feedback on: 
Where should the function be called and how should it be supplied to lit? I currently do so in config-ix.cmake but this eg. does not get installed with LLVM and I feel like is almost definitely wrong.
Should it be maybe be called and passed by each project to the configure_lit_site_cfg?


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

https://reviews.llvm.org/D98278

Files:
  clang/test/lit.site.cfg.py.in
  lld/test/lit.site.cfg.py.in
  llvm/cmake/config-ix.cmake
  llvm/cmake/modules/GetErrcMessages.cmake
  llvm/test/lit.site.cfg.py.in
  llvm/utils/lit/lit/llvm/config.py

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D98278.329651.patch
Type: text/x-patch
Size: 5694 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210310/8f8701d3/attachment.bin>


More information about the llvm-commits mailing list