[Openmp-commits] [PATCH] D30015: Add arch-specific directory to search path

Reid Kleckner via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Thu Mar 2 09:05:40 PST 2017


rnk added inline comments.


================
Comment at: include/clang/Driver/ToolChain.h:305
+  // as OpenMP) to find arch-specific libraries.
+  const std::string getArchSpecificLibPath() const;
+
----------------
Why const qualify the std::string?


================
Comment at: lib/Driver/Tools.cpp:289
+      CmdArgs.push_back("-rpath");
+      CmdArgs.push_back(Args.MakeArgString(CandidateRPath.c_str()));
+    }
----------------
We shouldn't add rpath to every binary linked by clang. We should only add rpath when we know the user is linking against a shared library provided by clang. See for example the way the darwin toolchain handles this in Toolchains.cpp.

Right now most libraries provided by clang are static, so there hasn't been much need to add rpath, but if we add more shared libraries (xray, sanitizers, profiling, etc), then I think we'll want to do this along with adding an option to suppress the implicit addition of rpath.


https://reviews.llvm.org/D30015





More information about the Openmp-commits mailing list