[LLVMdev] [PATCH] Prepend GCC_INSTALL_PREFIX to rpath if set.

Chandler Carruth chandlerc at google.com
Thu May 29 23:51:45 PDT 2014


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.


On Thu, May 29, 2014 at 11:25 PM, Russell Harmon <eatnumber1 at google.com>
wrote:

> This patch just prepends the gcc install prefix to the rpath rather than
> overriding it. It also uses the LLVM_LIBDIR_SUFFIX under the assumption
> that if
> you want llvm to install to lib{32,64} that you also installed gcc under
> that
> directory.
>
> This way, an LLVM compiled after setting GCC_INSTALL_PREFIX will work
> correctly
> if you don't want to install LLVM into the GCC_INSTALL_PREFIX.
> ---
>  CMakeLists.txt | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/CMakeLists.txt b/CMakeLists.txt
> index 9ec3e33..70684a7 100644
> --- a/CMakeLists.txt
> +++ b/CMakeLists.txt
> @@ -451,6 +451,10 @@ if (APPLE)
>  else(UNIX)
>    if(NOT DEFINED CMAKE_INSTALL_RPATH)
>      set(CMAKE_INSTALL_RPATH "\$ORIGIN/../lib")
> +    if(DEFINED GCC_INSTALL_PREFIX)
> +      set(CMAKE_INSTALL_RPATH
> "${GCC_INSTALL_PREFIX}/lib${LLVM_LIBDIR_SUFFIX}:${CMAKE_INSTALL_RPATH}")
> +    endif()
> +
>      if (${CMAKE_SYSTEM_NAME} MATCHES FreeBSD)
>        set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}
> -Wl,-z,origin")
>      endif()
> --
> 1.9.1.423.g4596e3a
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140529/b8bb31b8/attachment.html>


More information about the llvm-dev mailing list