From d6728add42d43d98fc52498092192895ed5308ef Mon Sep 17 00:00:00 2001 From: Ed Maste Date: Sun, 9 Mar 2014 18:48:45 +0000 Subject: Work around FreeBSD rtld rpath $ORIGIN limitation FreeBSD's rtld requires the DF_ORIGIN flag set in order to process $ORIGIN in rpath. FreeBSD bug http://bugs.freebsd.org/187114 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203419 91177308-0d34-0410-b5e6-96231b3b80d8 --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index f3a09dd9f5..7c315cbe4b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -445,6 +445,9 @@ if (APPLE) else(UNIX) if(NOT DEFINED CMAKE_INSTALL_RPATH) set(CMAKE_INSTALL_RPATH "\$ORIGIN/../lib") + if (${CMAKE_SYSTEM_NAME} MATCHES FreeBSD) + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-z,origin") + endif() endif(NOT DEFINED CMAKE_INSTALL_RPATH) endif() -- cgit v1.2.3