[PATCH] D85540: [llvm-libtool-darwin] Add support for -l and -L

Sameer Arora via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 13 08:53:42 PDT 2020


sameerarora101 marked 14 inline comments as done.
sameerarora101 added inline comments.


================
Comment at: llvm/test/tools/llvm-libtool-darwin/L-and-l.test:100
+
+# NOT-FOUND: error: cannot locate file for '[[FILE]]'
+
----------------
smeenai wrote:
> Can you test this for a name ending with `.a` as well?
Did you mean for a file to which `'.a'` is **appended**, right? (The name itself doesn't end in `'.a'` but since the name doesn't end in `'.o'`, `'lib'` and `'.a'` are added to it)? 

If that is what you meant, added a test for it now. Thanks.


================
Comment at: llvm/test/tools/llvm-libtool-darwin/L-and-l.test:111
+# RUN: llvm-ar cr %t/dirname/libfoo.o.a %t-input1.o
+# RUN: not llvm-libtool-darwin -static -o %t.lib -lfoo.o 2>&1 | \
+# RUN:   FileCheck %s --check-prefix=NOT-FOUND -DFILE=foo.o
----------------
smeenai wrote:
> You need the `-L%t/dirname` as well, right?
yup, added. thanks


================
Comment at: llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp:116
+  return createStringError(std::errc::invalid_argument,
+                           "cannot locate file for '%s'",
+                           FileName.str().c_str());
----------------
smeenai wrote:
> sameerarora101 wrote:
> > jhenderson wrote:
> > > 
> > it is not trying to locate `'%s'` but might add `lib` and `.a` to the string and try locating `lib%s.a`, right? That's what I meant up there. I can change it to what you're suggesting if it doesn't make sense?
> `FileName` will have already had the `lib` and `.a` additions at this point though, right?
ah yes, you are right. Replaced as suggested.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D85540



More information about the llvm-commits mailing list