pkgsrc/lang/llvm/patches/patch-cmake_modules_AddLLVM.cmake

26 lines
1.3 KiB
CMake

$NetBSD: patch-cmake_modules_AddLLVM.cmake,v 1.3 2017/03/19 19:01:48 adam Exp $
Don't use non-portable -z discard-unused on SunOS.
On Darwin, use correct install-name for shared libraries.
--- cmake/modules/AddLLVM.cmake.orig 2017-01-17 21:47:58.000000000 +0000
+++ cmake/modules/AddLLVM.cmake
@@ -182,9 +182,6 @@ function(add_link_opts target_name)
# ld64's implementation of -dead_strip breaks tools that use plugins.
set_property(TARGET ${target_name} APPEND_STRING PROPERTY
LINK_FLAGS " -Wl,-dead_strip")
- elseif(${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
- set_property(TARGET ${target_name} APPEND_STRING PROPERTY
- LINK_FLAGS " -Wl,-z -Wl,discard-unused=sections")
elseif(NOT WIN32 AND NOT LLVM_LINKER_IS_GOLD)
# Object files are compiled with -ffunction-data-sections.
# Versions of bfd ld < 2.23.1 have a bug in --gc-sections that breaks
@@ -1419,7 +1416,7 @@ function(llvm_setup_rpath name)
endif()
if (APPLE)
- set(_install_name_dir INSTALL_NAME_DIR "@rpath")
+ set(_install_name_dir INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib")
set(_install_rpath "@loader_path/../lib" ${extra_libdir})
elseif(UNIX)
set(_install_rpath "\$ORIGIN/../lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir})