<div dir="ltr">I would separate the LLVM_LIBDIR_SUFFIX change out. If we want to go that route, it should be applied both to the install rpath and to the GCC one. It seems unambiguously better for the install rpath, and probably better for the GCC one. But still, separate patch. Adding the GCC rpath seems like a good first step, feel free to commite.</div>
<div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, May 29, 2014 at 11:25 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 patch just prepends the gcc install prefix to the rpath rather than<br>
overriding it. It also uses the LLVM_LIBDIR_SUFFIX under the assumption that if<br>
you want llvm to install to lib{32,64} that you also installed gcc under that<br>
directory.<br>
<br>
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 | 4 ++++<br>
1 file changed, 4 insertions(+)<br>
<br>
diff --git a/CMakeLists.txt b/CMakeLists.txt<br>
index 9ec3e33..70684a7 100644<br>
--- a/CMakeLists.txt<br>
+++ b/CMakeLists.txt<br>
@@ -451,6 +451,10 @@ if (APPLE)<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${LLVM_LIBDIR_SUFFIX}:${CMAKE_INSTALL_RPATH}")<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>
</font></span></blockquote></div><br></div>