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

llvm-svn: 203419
This commit is contained in:
Ed Maste 2014-03-09 18:48:45 +00:00
parent 39012ccee9
commit 644aef8f84
1 changed files with 3 additions and 0 deletions

View File

@ -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()