[PATCH] D113130: [llvm-libtool-darwin] Print a warning if object file names are repeated

Shoaib Meenai via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 18 10:28:42 PST 2022


smeenai added a subscriber: mstorsjo.
smeenai added a comment.

The Windows test failure here is pretty annoying :(

For the test where we specify one file via `-l` and the other via its path, the output on Windows looks like

  warning: file 'L-and-l.test.tmp-input1.o' was specified multiple times.
  in: C:\Users\smeenai\llvm-project\build\Release\test\tools\llvm-libtool-darwin\Output\L-and-l.test.tmp/copy/L-and-l.test.tmp-input1.o
  in: C:\Users\smeenai\llvm-project\build\Release\test\tools\llvm-libtool-darwin\Output\L-and-l.test.tmp/copy\L-and-l.test.tmp-input1.o

Note that the last slash is a forward slash in one path and a backslash in the other. The forward slash is coming from our path specification in the test, and the backslash is coming from `sys::path::append` in libtool (to concatenate `-L` directories and `-l` names).

One way to fix this would be to introduce a new `%{sep}` substitution in lit (similar to the existing `%{pathsep}`), so we could use the appropriate slashes for the platform in our test automatically. Another would be to use `sys::path::Style::windows_slash` in our `sys::path::append` call, but that could break with `\\?\` paths, which can't use forward slashes.

@mstorsjo, I believe you have a bunch of experience dealing with slash differences on Windows. Any suggestions on the best way to proceed here?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D113130



More information about the llvm-commits mailing list