[all-commits] [llvm/llvm-project] 1709e8: [llvm-windres] Resolve the --preprocessor executab...

Martin Storsjö via All-commits all-commits at lists.llvm.org
Fri Dec 15 10:16:33 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1709e8c656de69f6d823a3ae6773bf815e373909
      https://github.com/llvm/llvm-project/commit/1709e8c656de69f6d823a3ae6773bf815e373909
  Author: Martin Storsjö <martin at martin.st>
  Date:   2023-12-15 (Fri, 15 Dec 2023)

  Changed paths:
    M llvm/test/tools/llvm-rc/windres-preproc.test
    M llvm/tools/llvm-rc/llvm-rc.cpp

  Log Message:
  -----------
  [llvm-windres] Resolve the --preprocessor executable in $PATH (#75390)

The llvm::sys::ExecuteAndWait function doesn't resolve the file to be
executed from $PATH - i.e. it is similar to execv(), not execvp().

Due to this, specifying a --preprocessor argument to llvm-windres only
worked if it specified an absolute path to the preprocessor executable.
This was observed as one of the issues in
https://github.com/msys2/MINGW-packages/pull/19157.

Before d2fa6b694c2052cef1ddd507f6569bc84e3bbe35, this usage of
--preprocessor seemed to work, because the first argument of Args[] was
ignored and llvm-windres just executed the autodetected clang executable
regardless.

Also improve the error messages printed if preprocessing failed. (If the
preprocessor executable was started but itself returned an error, we
don't get any error string.)




More information about the All-commits mailing list