[PATCH] D13209: [ELF2] Add --sysroot command line switch

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 28 06:37:52 PDT 2015


ruiu added inline comments.

================
Comment at: ELF/Config.h:23
@@ -22,2 +22,3 @@
   std::vector<llvm::StringRef> InputSearchPaths;
+  llvm::StringRef SysRoot;
   bool Shared = false;
----------------
In the GNU ld manual, sysroot is used as a single word, so I'd name it Sysroot.

================
Comment at: ELF/Driver.cpp:66-67
@@ +65,4 @@
+// which can be set with --sysroot command line switch.
+static void buildSysRootedPath(SmallString<128> &Path, StringRef Dir,
+                               StringRef File) {
+  if (Dir.startswith("=")) {
----------------
I'm generally not happy about the use of SmallString in sys::path. It seems to be able to be replaced by std::string without noticeable performance penalty. At least we don't need any speed here. Can you return std::string from this function to make this function functional?


http://reviews.llvm.org/D13209





More information about the llvm-commits mailing list