diff options
author | adam <adam@pkgsrc.org> | 2017-03-19 19:01:48 +0000 |
---|---|---|
committer | adam <adam@pkgsrc.org> | 2017-03-19 19:01:48 +0000 |
commit | 4c62737b021541c5b3f95b00150606718b28315b (patch) | |
tree | 4d624b60a9ce40858d5e652b23fd39c2330d8327 /lang/llvm | |
parent | 300ac2515ecfec1c39e9f5fb3931b4789648921f (diff) | |
download | pkgsrc-4c62737b021541c5b3f95b00150606718b28315b.tar.gz |
Create and use shared library libLLVM; fix install_name for shared object on Darwin.
Diffstat (limited to 'lang/llvm')
-rw-r--r-- | lang/llvm/Makefile | 16 | ||||
-rw-r--r-- | lang/llvm/PLIST | 5 | ||||
-rw-r--r-- | lang/llvm/distinfo | 6 | ||||
-rw-r--r-- | lang/llvm/patches/patch-cmake_modules_AddLLVM.cmake | 16 | ||||
-rw-r--r-- | lang/llvm/patches/patch-cmake_modules_HandleLLVMOptions.cmake | 14 | ||||
-rw-r--r-- | lang/llvm/patches/patch-tools_llvm-shlib_CMakeLists.txt | 23 |
6 files changed, 63 insertions, 17 deletions
diff --git a/lang/llvm/Makefile b/lang/llvm/Makefile index 8fa0125d769..6ebab1e8258 100644 --- a/lang/llvm/Makefile +++ b/lang/llvm/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.15 2017/03/17 22:38:17 adam Exp $ +# $NetBSD: Makefile,v 1.16 2017/03/19 19:01:48 adam Exp $ # # when updating this, please also update: # devel/include-what-you-use @@ -11,6 +11,7 @@ DISTNAME= llvm-4.0.0.src PKGNAME= ${DISTNAME:S/.src//} +PKGREVISION= 1 CATEGORIES= lang devel MASTER_SITES= http://llvm.org/releases/${PKGVERSION_NOREV}/ EXTRACT_SUFX= .tar.xz @@ -31,7 +32,10 @@ CMAKE_ARG_PATH= ${WRKSRC} CMAKE_ARGS+= -DCMAKE_BUILD_TYPE=Release CMAKE_ARGS+= -DCMAKE_C_COMPILER=gcc CMAKE_ARGS+= -DCMAKE_CXX_COMPILER=g++ +CMAKE_ARGS+= -DLLVM_BUILD_LLVM_DYLIB=ON +CMAKE_ARGS+= -DLLVM_INCLUDE_TESTS=OFF CMAKE_ARGS+= -DLLVM_INSTALL_UTILS=ON +CMAKE_ARGS+= -DLLVM_LINK_LLVM_DYLIB=ON CMAKE_ARGS.Darwin+= -DCMAKE_LIBTOOL=/usr/bin/libtool @@ -100,16 +104,6 @@ CXXFLAGS+= -std=c++11 CXXFLAGS+= -march=i586 .endif -.if ${OPSYS} == "Darwin" -.PHONY: fix-darwin-install-name -post-install: fix-darwin-install-name -fix-darwin-install-name: -. for lib in BugpointPasses LLVMHello libLTO - install_name_tool -id ${PREFIX}/lib/${lib}.${SOEXT} \ - ${DESTDIR}${PREFIX}/lib/${lib}.${SOEXT} -. endfor -.endif - .include "options.mk" # replacing config.guess is required even for cmake. diff --git a/lang/llvm/PLIST b/lang/llvm/PLIST index 2e46a5f7d60..a0e29963985 100644 --- a/lang/llvm/PLIST +++ b/lang/llvm/PLIST @@ -1,4 +1,4 @@ -@comment $NetBSD: PLIST,v 1.4 2017/03/17 22:38:17 adam Exp $ +@comment $NetBSD: PLIST,v 1.5 2017/03/19 19:01:48 adam Exp $ bin/FileCheck bin/bugpoint bin/count @@ -1236,6 +1236,9 @@ ${PLIST.XCore}lib/libLLVMXCoreDisassembler.a ${PLIST.XCore}lib/libLLVMXCoreInfo.a lib/libLLVMXRay.a lib/libLLVMipo.a +lib/libLLVM.${SOEXT} +${PLIST.notdylib}lib/libLLVM-4.0.${SOEXT} +${PLIST.notdylib}lib/libLLVM-${PKGVERSION}.${SOEXT} lib/libLTO.${SOEXT} ${PLIST.notdylib}lib/libLTO.${SOEXT}.4 ${PLIST.notdylib}lib/libLTO.${SOEXT}.${PKGVERSION} diff --git a/lang/llvm/distinfo b/lang/llvm/distinfo index 448fde922a3..e032ea5e9c9 100644 --- a/lang/llvm/distinfo +++ b/lang/llvm/distinfo @@ -1,8 +1,10 @@ -$NetBSD: distinfo,v 1.6 2017/03/17 22:38:17 adam Exp $ +$NetBSD: distinfo,v 1.7 2017/03/19 19:01:48 adam Exp $ SHA1 (llvm-4.0.0.src.tar.xz) = aee4524e2407f9fe5afc6f70c753180b907011d0 RMD160 (llvm-4.0.0.src.tar.xz) = 468ae2502ba523b35c5e8340724ddaa50b31ccb5 SHA512 (llvm-4.0.0.src.tar.xz) = cf681f0626ef6d568d951cdc3e143471a1d7715a0ba11e52aa273cf5d8d421e1357ef2645cc85879eaefcd577e99e74d07b01566825b3d0461171ef2cbfc7704 Size (llvm-4.0.0.src.tar.xz) = 21016340 bytes -SHA1 (patch-cmake_modules_AddLLVM.cmake) = 73725f49c7814f54f9286afe796bc2a466ee9611 +SHA1 (patch-cmake_modules_AddLLVM.cmake) = 4bfb98c5d99797155d0fb13a43352d31f6cfe783 +SHA1 (patch-cmake_modules_HandleLLVMOptions.cmake) = 271e6f5a8cebf8162c4e3b758e96f451b434269b SHA1 (patch-include_llvm_Support_Host.h) = a4e19a72714084b211b0182c04ccc51bd606e150 +SHA1 (patch-tools_llvm-shlib_CMakeLists.txt) = 18e6ec7b8895e55ecdf93c9d4781e92052a6fcb1 diff --git a/lang/llvm/patches/patch-cmake_modules_AddLLVM.cmake b/lang/llvm/patches/patch-cmake_modules_AddLLVM.cmake index 7954e8cafd5..bcb0a5f2e99 100644 --- a/lang/llvm/patches/patch-cmake_modules_AddLLVM.cmake +++ b/lang/llvm/patches/patch-cmake_modules_AddLLVM.cmake @@ -1,10 +1,11 @@ -$NetBSD: patch-cmake_modules_AddLLVM.cmake,v 1.2 2017/03/17 22:38:17 adam Exp $ +$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 2016-02-12 17:52:29.000000000 +0000 +--- cmake/modules/AddLLVM.cmake.orig 2017-01-17 21:47:58.000000000 +0000 +++ cmake/modules/AddLLVM.cmake -@@ -174,9 +174,6 @@ function(add_link_opts target_name) +@@ -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") @@ -14,3 +15,12 @@ Don't use non-portable -z discard-unused on SunOS. 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}) diff --git a/lang/llvm/patches/patch-cmake_modules_HandleLLVMOptions.cmake b/lang/llvm/patches/patch-cmake_modules_HandleLLVMOptions.cmake new file mode 100644 index 00000000000..c36ab0c0abf --- /dev/null +++ b/lang/llvm/patches/patch-cmake_modules_HandleLLVMOptions.cmake @@ -0,0 +1,14 @@ +$NetBSD: patch-cmake_modules_HandleLLVMOptions.cmake,v 1.1 2017/03/19 19:01:48 adam Exp $ + +DragonflyBSD support + +--- cmake/modules/HandleLLVMOptions.cmake.orig 2016-01-06 19:05:19.000000000 +0000 ++++ cmake/modules/HandleLLVMOptions.cmake +@@ -132,6 +132,7 @@ endif() + # Pass -Wl,-z,defs. This makes sure all symbols are defined. Otherwise a DSO + # build might work on ELF but fail on MachO/COFF. + if(NOT (${CMAKE_SYSTEM_NAME} MATCHES "Darwin" OR WIN32 OR CYGWIN OR ++ ${CMAKE_SYSTEM_NAME} MATCHES "DragonFly" OR + ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD" OR + ${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD") AND + NOT LLVM_USE_SANITIZER) diff --git a/lang/llvm/patches/patch-tools_llvm-shlib_CMakeLists.txt b/lang/llvm/patches/patch-tools_llvm-shlib_CMakeLists.txt new file mode 100644 index 00000000000..e196c535502 --- /dev/null +++ b/lang/llvm/patches/patch-tools_llvm-shlib_CMakeLists.txt @@ -0,0 +1,23 @@ +$NetBSD: patch-tools_llvm-shlib_CMakeLists.txt,v 1.1 2017/03/19 19:01:48 adam Exp $ + +Use the Linux style linking everywhere except Darwin and SunOS. + +--- tools/llvm-shlib/CMakeLists.txt.orig 2016-05-26 04:35:35.000000000 +0000 ++++ tools/llvm-shlib/CMakeLists.txt +@@ -37,11 +37,12 @@ endif() + add_llvm_library(LLVM SHARED DISABLE_LLVM_LINK_LLVM_DYLIB SONAME ${SOURCES}) + + list(REMOVE_DUPLICATES LIB_NAMES) +-if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" OR MINGW) # FIXME: It should be "GNU ld for elf" +- # GNU ld doesn't resolve symbols in the version script. +- set(LIB_NAMES -Wl,--whole-archive ${LIB_NAMES} -Wl,--no-whole-archive) +-elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin") ++if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin") + set(LIB_NAMES -Wl,-all_load ${LIB_NAMES}) ++elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "SunOS") ++ set(LIB_NAMES -Wl,-Bsymbolic -Wl,-z -Wl,allextract ${LIB_NAMES} -Wl,-z -Wl,defaultextract) ++else() ++ set(LIB_NAMES -Wl,--whole-archive ${LIB_NAMES} -Wl,--no-whole-archive) + endif() + + target_link_libraries(LLVM PRIVATE ${LIB_NAMES}) |