From e78323aa2566e68c8004c38abd78210fc6f9efa4 Mon Sep 17 00:00:00 2001 From: Brooks Davis Date: Sat, 3 Sep 2016 00:20:05 +0000 Subject: [PATCH] Upgrade to 3.9.0 release. Improve support for -fopenmp with a hack inspired by a submission from Johannes Dieterich . Implement a number of improvments submitted by lightside@gmx.com: - Add license information - Use VAR option helper for _USES_PYTHON variable - Add libxml2 to USE_GNOME for CLANG option - Sort variables for options (e.g. GOLD_*) Add USES=execinfo for LLDB. PR: 203223, 212334 --- devel/llvm39/Makefile | 33 +++++++++++++-------- devel/llvm39/distinfo | 30 +++++++++---------- devel/llvm39/files/clang-patch-fopenmp.diff | 28 +++++++++++++++++ 3 files changed, 64 insertions(+), 27 deletions(-) create mode 100644 devel/llvm39/files/clang-patch-fopenmp.diff diff --git a/devel/llvm39/Makefile b/devel/llvm39/Makefile index 81b143aca13c..db3ced2b7dc4 100644 --- a/devel/llvm39/Makefile +++ b/devel/llvm39/Makefile @@ -1,8 +1,7 @@ # $FreeBSD$ PORTNAME= llvm -DISTVERSION= 3.9.0rc3 -PORTREVISION= 1 +DISTVERSION= 3.9.0 CATEGORIES= devel lang MASTER_SITES= http://llvm.org/${PRE_}releases/${LLVM_RELEASE}/${RCDIR} DISTNAME= ${PORTNAME}-${DISTVERSION}.src @@ -12,6 +11,11 @@ PKGNAMESUFFIX= ${LLVM_SUFFIX} MAINTAINER= brooks@FreeBSD.org COMMENT= LLVM and Clang +LICENSE= LLVM +LICENSE_NAME= LLVM Release License +LICENSE_FILE= ${WRKSRC}/LICENSE.TXT +LICENSE_PERMS= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept + BROKEN_powerpc64= Does not build LLVM_RELEASE= ${DISTVERSION:C/rc.*//} @@ -25,6 +29,8 @@ DOCSDIR= ${PREFIX}/share/doc/${PORTNAME}${LLVM_SUFFIX} DATADIR= ${PREFIX}/share/${PORTNAME}${LLVM_SUFFIX} USES= cmake:outsource compiler:c++11-lib libedit ninja perl5 tar:xz +_USES_PYTHON?= python:build +USES+= ${_USES_PYTHON} USE_LDCONFIG= ${LLVM_PREFIX}/lib SUB_FILES= llvm-wrapper.sh @@ -46,6 +52,7 @@ PLIST_FILES= CLANG_DESC= Build clang CLANG_EXTRA_PATCHES= \ ${PATCHDIR}/clang-patch-fformat_extensions.diff \ + ${PATCHDIR}/clang-patch-fopenmp.diff \ ${PATCHDIR}/clang-patch-tools_clang_lib_Headers_CMakeLists.txt \ ${PATCHDIR}/clang-patch-tools_clang_tools_clang-format_clang-format.py \ ${PATCHDIR}/clang-patch-tools_clang_tools_scan-build_libexec_ccc-analyzer @@ -53,9 +60,11 @@ CLANG_CONFLICTS_INSTALL= clang-devel-3.[1234567]* CLANG_DISTFILES= cfe-${DISTVERSION}.src${EXTRACT_SUFX} CLANG_CMAKE_ON= -DCLANG_DEFAULT_OPENMP_RUNTIME=libomp CLANG_PORTDOCS= clang +CLANG_USE= GNOME=libxml2 COMPILER_RT_DESC= Sanitizer libraries COMPILER_RT_DISTFILES= compiler-rt-${DISTVERSION}.src${EXTRACT_SUFX} COMPILER_RT_PLIST_FILES=${_COMPILER_RT_LIBS:S|^|${_CRTLIBDIR}/|} +DOCS_BUILD_DEPENDS= sphinx-build:textproc/py-sphinx DOCS_PORTDOCS= llvm DOCS_CMAKE_ON= -DLLVM_ENABLE_SPHINX=ON \ -DSPHINX_WARNINGS_AS_ERRORS=OFF \ @@ -64,17 +73,20 @@ DOCS_PLIST_FILES= ${MAN1SRCS:S|^|man/man1/|:S|.1$|${LLVM_SUFFIX}.1.gz|} EXTRAS_DESC= Extra clang tools EXTRAS_IMPLIES= CLANG EXTRAS_DISTFILES= clang-tools-extra-${DISTVERSION}.src${EXTRACT_SUFX} +GOLD_DESC= Build the LLVM Gold plugin for LTO +GOLD_CMAKE_ON= -DLLVM_BINUTILS_INCDIR=${LOCALBASE}/include +GOLD_BUILD_DEPENDS= ld.gold:devel/binutils LIT_DESC= Install lit and FileCheck test tools +LIT_VARS= _USES_PYTHON=python LLD_DESC= Install lld, the LLVM linker LLD_DISTFILES= lld-${DISTVERSION}.src${EXTRACT_SUFX} LLDB_DESC= Install lldb, the LLVM debugger (ignored on 9.x) LLDB_BUILD_DEPENDS= swig:devel/swig13 LLDB_DISTFILES= lldb-${DISTVERSION}.src${EXTRACT_SUFX} +LLDB_USES= execinfo +LLDB_VARS= _USES_PYTHON=python OPENMP_DESC= Install libomp, the LLVM OpenMP runtime library OPENMP_DISTFILES= openmp-${DISTVERSION}.src${EXTRACT_SUFX} -GOLD_DESC= Build the LLVM Gold plugin for LTO -GOLD_CMAKE_ON= -DLLVM_BINUTILS_INCDIR=${LOCALBASE}/include -GOLD_BUILD_DEPENDS= ld.gold:devel/binutils # Emulate USE_GITHUB's ${WRKSRC_tag} to reduce diffs to ../llvm-devel .for option in CLANG COMPILER_RT EXTRAS LLD LLDB OPENMP @@ -83,8 +95,6 @@ WRKSRC_${option:tl}= ${WRKDIR}/${${option}_DISTFILES:S/${EXTRACT_SUFX}//} OPTIONS_SUB= yes -DOCS_BUILD_DEPENDS= sphinx-build:textproc/py-sphinx - PLIST_SUB+= LLVM_RELEASE=${LLVM_RELEASE} LLVM_MAJOR=${LLVM_MAJOR} COMMANDS= bugpoint \ @@ -171,7 +181,6 @@ COMPILER_RT_PATTERN= (asan_blacklist.txt|sanitizer|xray) .if ${PORT_OPTIONS:MLIT} MAN1SRCS+= lit.1 FileCheck.1 -_USES_PYTHON= python LIT_COMMANDS= lit llvm-lit FileCheck .endif @@ -180,7 +189,6 @@ COMMANDS+= argdumper \ lldb \ lldb-mi \ lldb-server -_USES_PYTHON= python .endif .if ! ${OPTIONS_DEFINE:MCOMPILER_RT} @@ -201,9 +209,6 @@ PLIST_SUB+= OPENMP="@comment " .else .endif -_USES_PYTHON?= python:build -USES+= ${_USES_PYTHON} - MAN1SRCS+= bugpoint.1 llc.1 lli.1 llvm-ar.1 llvm-as.1 \ llvm-bcanalyzer.1 llvm-build.1 llvm-config.1 llvm-cov.1 \ llvm-diff.1 llvm-dis.1 llvm-dwarfdump.1 \ @@ -302,6 +307,10 @@ post-patch: -e 's|lit\.|lit${LLVM_SUFFIX}.|' \ ${WRKSRC}/utils/lit/lit.py ${WRKSRC}/utils/lit/lit/*.py +post-patch-CLANG-on: + ${REINPLACE_CMD} -e 's|%%LLVM_PREFIX%%|${LLVM_PREFIX}|' \ + ${PATCH_WRKSRC}/tools/clang/lib/Driver/Tools.cpp + post-build-COMPILER_RT-on: ${MKDIR} ${WRKDIR}/compiler-rt-build cd ${WRKDIR}/compiler-rt-build && \ diff --git a/devel/llvm39/distinfo b/devel/llvm39/distinfo index 44cd88cfc028..532a1aa77b28 100644 --- a/devel/llvm39/distinfo +++ b/devel/llvm39/distinfo @@ -1,15 +1,15 @@ -TIMESTAMP = 1472516405 -SHA256 (llvm-3.9.0rc3.src.tar.xz) = b52ed8390a9b7c30ab88cd679f890b5cac17ec52f7fe10bfc305b4d7254e3f82 -SIZE (llvm-3.9.0rc3.src.tar.xz) = 18235444 -SHA256 (cfe-3.9.0rc3.src.tar.xz) = cb06bb2403cc13bd2bc561222a9854d1aa52d96cf48b4a24d9e4b0b6832c96ec -SIZE (cfe-3.9.0rc3.src.tar.xz) = 10390412 -SHA256 (compiler-rt-3.9.0rc3.src.tar.xz) = 2ae30412681098d7632f09c524b00049faccd3e802ec6fd2171fe8c6e47c9202 -SIZE (compiler-rt-3.9.0rc3.src.tar.xz) = 1377852 -SHA256 (clang-tools-extra-3.9.0rc3.src.tar.xz) = adac980fb7aef0c57bc0e7468e2fb3d328ec9417ff7997b7390b8ef4902b6cdb -SIZE (clang-tools-extra-3.9.0rc3.src.tar.xz) = 455376 -SHA256 (lld-3.9.0rc3.src.tar.xz) = 9532dc6940516785a3186571378dc0d94484722cfc17396583dfbe16246c2494 -SIZE (lld-3.9.0rc3.src.tar.xz) = 499820 -SHA256 (lldb-3.9.0rc3.src.tar.xz) = de5057b75adf87f17af3bf667adb0638cb504b0049647946ab93af45dba311e6 -SIZE (lldb-3.9.0rc3.src.tar.xz) = 13754856 -SHA256 (openmp-3.9.0rc3.src.tar.xz) = 3696508f0cf4ff911bf50ef2c9da2147ebab361b29d042f5abd952778c259b6d -SIZE (openmp-3.9.0rc3.src.tar.xz) = 2257084 +TIMESTAMP = 1472853484 +SHA256 (llvm-3.9.0.src.tar.xz) = 66c73179da42cee1386371641241f79ded250e117a79f571bbd69e56daa48948 +SIZE (llvm-3.9.0.src.tar.xz) = 18235716 +SHA256 (cfe-3.9.0.src.tar.xz) = 7596a7c7d9376d0c89e60028fe1ceb4d3e535e8ea8b89e0eb094e0dcb3183d28 +SIZE (cfe-3.9.0.src.tar.xz) = 10390440 +SHA256 (compiler-rt-3.9.0.src.tar.xz) = e0e5224fcd5740b61e416c549dd3dcda92f10c524216c1edb5e979e42078a59a +SIZE (compiler-rt-3.9.0.src.tar.xz) = 1379960 +SHA256 (clang-tools-extra-3.9.0.src.tar.xz) = 5b7aec46ec8e999ec683c87ad744082e1133781ee4b01905b4bdae5d20785f14 +SIZE (clang-tools-extra-3.9.0.src.tar.xz) = 455144 +SHA256 (lld-3.9.0.src.tar.xz) = 986e8150ec5f457469a20666628bf634a5ca992a53e157f3b69dbc35056b32d9 +SIZE (lld-3.9.0.src.tar.xz) = 499816 +SHA256 (lldb-3.9.0.src.tar.xz) = 61280e07411e3f2b4cca0067412b39c16b0a9edd19d304d3fc90249899d12384 +SIZE (lldb-3.9.0.src.tar.xz) = 13754516 +SHA256 (openmp-3.9.0.src.tar.xz) = df88f90d7e5b5e9525a35fa2e2b93cbbb83c4882f91df494e87ee3ceddacac91 +SIZE (openmp-3.9.0.src.tar.xz) = 2257596 diff --git a/devel/llvm39/files/clang-patch-fopenmp.diff b/devel/llvm39/files/clang-patch-fopenmp.diff new file mode 100644 index 000000000000..5216a420e710 --- /dev/null +++ b/devel/llvm39/files/clang-patch-fopenmp.diff @@ -0,0 +1,28 @@ +--- tools/clang/lib/Driver/Tools.cpp.orig 2016-09-02 19:55:01.000873648 +0000 ++++ tools/clang/lib/Driver/Tools.cpp 2016-09-02 19:54:32.001875868 +0000 +@@ -2733,13 +2733,22 @@ + + switch (getOpenMPRuntime(TC, Args)) { + case OMPRT_OMP: +- CmdArgs.push_back("-lomp"); ++ if (TC.getTriple().getOS() != llvm::Triple::FreeBSD || TC.isCrossCompiling() || !llvm::sys::fs::exists("%%LLVM_PREFIX%%/lib/libomp.so")) ++ CmdArgs.push_back("-lomp"); ++ else ++ CmdArgs.push_back("%%LLVM_PREFIX%%/lib/libomp.so"); + break; + case OMPRT_GOMP: +- CmdArgs.push_back("-lgomp"); ++ if (TC.getTriple().getOS() != llvm::Triple::FreeBSD || TC.isCrossCompiling() || !llvm::sys::fs::exists("%%LLVM_PREFIX%%/lib/libomp.so")) ++ CmdArgs.push_back("-lgomp"); ++ else ++ CmdArgs.push_back("%%LLVM_PREFIX%%/lib/libgomp.so"); + break; + case OMPRT_IOMP5: +- CmdArgs.push_back("-liomp5"); ++ if (TC.getTriple().getOS() != llvm::Triple::FreeBSD || TC.isCrossCompiling() || !llvm::sys::fs::exists("%%LLVM_PREFIX%%/lib/libomp.so")) ++ CmdArgs.push_back("-liomp5"); ++ else ++ CmdArgs.push_back("%%LLVM_PREFIX%%/lib/libiomp5.so"); + break; + case OMPRT_Unknown: + // Already diagnosed.