<div dir="ltr">This looks like it would remove the origin/../lib RPATH which would break finding libraries related to Clang such as libc++?<div><br></div><div>It makes sense to add the GCC install prefix to the RPATH though. I wonder, should we try to do something about the lib vs. lib{32,64} business? I don't know that either of these does the right thing there.</div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, May 29, 2014 at 3:37 PM, Russell Harmon <span dir="ltr"><<a href="mailto:eatnumber1@google.com" target="_blank">eatnumber1@google.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This way, an LLVM compiled after setting GCC_INSTALL_PREFIX will work correctly<br>
if you don't want to install LLVM into the GCC_INSTALL_PREFIX.<br>
---<br>
 CMakeLists.txt | 7 ++++++-<br>
 1 file changed, 6 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/CMakeLists.txt b/CMakeLists.txt<br>
index 9ec3e33..c85a028 100644<br>
--- a/CMakeLists.txt<br>
+++ b/CMakeLists.txt<br>
@@ -450,7 +450,12 @@ if (APPLE)<br>
   set(CMAKE_INSTALL_RPATH "@executable_path/../lib")<br>
 else(UNIX)<br>
   if(NOT DEFINED CMAKE_INSTALL_RPATH)<br>
-    set(CMAKE_INSTALL_RPATH "\$ORIGIN/../lib")<br>
+    if(DEFINED GCC_INSTALL_PREFIX)<br>
+      set(CMAKE_INSTALL_RPATH "${GCC_INSTALL_PREFIX}/lib")<br>
+    else()<br>
+      set(CMAKE_INSTALL_RPATH "\$ORIGIN/../lib")<br>
+    endif()<br>
+<br>
     if (${CMAKE_SYSTEM_NAME} MATCHES FreeBSD)<br>
       set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-z,origin")<br>
     endif()<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.9.1.423.g4596e3a<br>
<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
</font></span></blockquote></div><br></div>