[PATCH] D134309: [llvm-libtool-darwin] Parse and ignore -syslibroot

Keith Smiley via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 20 13:37:43 PDT 2022


keith created this revision.
Herald added a project: All.
keith requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

cctools libtool allows you to link dynamic libraries by passing through
a number of arguments to ld64. Because of this the default arguments
libtool receives in Xcode contains arguments that only matter in that
case. This change ignores this argument, at least until we ever support
that dynamic use case, so that you can use llvm-libtool-darwin as a
drop-in replacement in Xcode for cctools libtool. There are more
arguments we could ignore for this case, but we can probably add those
as the use case comes up.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D134309

Files:
  llvm/test/tools/llvm-libtool-darwin/ignored-options.test
  llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp


Index: llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp
===================================================================
--- llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp
+++ llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp
@@ -101,6 +101,8 @@
                                       cl::cat(LibtoolCategory),
                                       cl::init(false));
 
+static cl::opt<std::string> IgnoredSyslibRoot("syslibroot", cl::Hidden);
+
 static const std::array<std::string, 3> StandardSearchDirs{
     "/lib",
     "/usr/lib",
Index: llvm/test/tools/llvm-libtool-darwin/ignored-options.test
===================================================================
--- /dev/null
+++ llvm/test/tools/llvm-libtool-darwin/ignored-options.test
@@ -0,0 +1,8 @@
+## This tests some flags are correctly parsed even when they're not handled
+
+# RUN: llvm-libtool-darwin -V -syslibroot foo | FileCheck %s
+# RUN: llvm-libtool-darwin -h | FileCheck --check-prefix=HELP %s
+
+# CHECK: Default target:
+
+# HELP-NOT: syslibroot


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D134309.461684.patch
Type: text/x-patch
Size: 1043 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220920/47548056/attachment.bin>


More information about the llvm-commits mailing list