Browse Source

llvm-5.0.1-2

git-svn-id: http://trac.vinelinux.org/repos/projects/specs@11308 ec354946-7b23-47d6-9f5a-488ba84defc7
tomop 6 years ago
parent
commit
8b38ffaa9e
1 changed files with 114 additions and 32 deletions
  1. 114 32
      l/llvm/llvm-vl.spec

+ 114 - 32
l/llvm/llvm-vl.spec

@@ -1,5 +1,7 @@
 %define build_compat32 %{?_with_compat32:1}%{!?_with_compat32:0}
 
+%define _unpackaged_files_terminate_build 1
+
 # Build options:
 # Components skipped by default:
 %bcond_with doxygen
@@ -12,8 +14,8 @@
 %define _unpackaged_files_terminate_build 1
 
 Name:           llvm
-Version:        3.8.1
-Release:        1%{?_dist_release}
+Version:        5.0.1
+Release:        2%{?_dist_release}
 Summary:        The Low Level Virtual Machine
 Summary(ja):    LLVM - 低レベルバーチャルマシン
 
@@ -31,9 +33,16 @@ Source11:        clang-config.h
 
 # patches
 
-# added acc5-abi support
-Patch1: 0001-GCC-PR23529-Sema-part-of-attrbute-abi_tag-support.patch
-Patch2: 0002-GCC-PR23529-Mangler-part-of-attrbute-abi_tag-support.patch
+# recognize s390 as SystemZ when configuring build
+Patch0:         llvm-3.7.1-cmake-s390.patch
+Patch3:         0001-CMake-Split-static-library-exports-into-their-own-ex.patch
+# FIXME: Symbol versioning breaks some unittests when statically linking
+# libstdc++, so we disable it for now.
+Patch4:         0001-Revert-Add-a-linker-script-to-version-LLVM-symbols.patch
+Patch5:         0001-PowerPC-Don-t-use-xscvdpspn-on-the-P7.patch
+
+Patch100:        0001-lit.cfg-Remove-substitutions-for-clang-llvm-tools.patch
+Patch200:        0001-Fix-AArch64-build-with-glibc-2.26.patch
 
 # Vine Patch
 Patch1000: clang-3.8.1-driver-ld.gold.patch
@@ -89,7 +98,6 @@ Group:          Development/Libraries
 Requires:       %{name} = %{version}-%{release}
 Requires:       libstdc++-devel
 Requires:       libffi-devel
-Provides:       llvm-static = %{version}-%{release}
 
 %description devel
 This package contains library and header files needed to develop new
@@ -120,6 +128,18 @@ Shared libraries for the LLVM compiler infrastructure.
 %description libs -l ja
 LLVM コンパイラ基盤の共有ライブラリです.
 
+%package static
+Summary:        LLVM static libraries
+Summary(ja):    LLVM 静的ライブラリ
+Requires:       llvm-devel = %{version}-%{release}
+
+%description static
+Static libraries for the LLVM compiler infrastructure.
+
+%description static -l ja
+LLVM コンパイラ基盤の静的ライブラリです.
+
+
 %package -n clang
 Summary:        A C language family front-end for LLVM
 Summary(ja):    LLVM の C 言語フロントエンド
@@ -180,6 +200,14 @@ framework and a standalone tool that finds bugs in C and Objective-C
 programs. The standalone tool is invoked from the command-line, and is
 intended to run in tandem with a build of a project or code base.
 
+%package -n python-clang
+Summary: Python bindings for clang
+Requires: %{name}-libs%{?_isa} = %{version}-%{release}
+Requires: python
+%description -n python-clang
+Python bindings for clang
+
+
 #%package -n clang-doc
 #Summary:        Documentation for Clang
 #Summary(ja):    Clang のドキュメント
@@ -233,6 +261,17 @@ BuildArch:      noarch
 API documentation for the Clang compiler.
 %endif
 
+
+%package -n python-lldb
+Summary:        Python module for LLDB
+Summary(ja):    LLDB用Pythonモジュール
+BuildRequires:  python-devel
+Requires:       python-six
+
+%description -n python-lldb
+The package contains the LLDB Python module.
+
+
 %if %{with ocaml}
 %package        ocaml
 Summary:        OCaml binding for LLVM
@@ -283,16 +322,23 @@ Shared libraries for the LLVM compiler infrastructure.
 
 %prep
 %setup -q -a1 -a2 -a3 -n llvm-%{version}.src 
+
+%patch0 -p1
+%patch3 -p1
+%patch4 -p1
+%patch5 -p1
+
 rm -rf tools/clang tools/lldb projects/compiler-rt
 mv cfe-%{version}.src tools/clang
 mv compiler-rt-%{version}.src projects/compiler-rt
 mv lldb-%{version}.src tools/lldb
 
-# clang
-
 pushd tools/clang
-%patch1 -p1 -b .gcc_abi-1
-%patch2 -p1 -b .gcc_abi-2
+%patch100 -p1
+popd
+
+pushd projects/compiler-rt
+%patch200 -p1
 popd
 
 # Vine Linux
@@ -301,7 +347,10 @@ pushd tools/clang
 %patch1000 -p1 -b .driver-ld.gold
 popd
 %endif
-%patch1002 -p1 -b .driver-vine
+#%patch1002 -p1 -b .driver-vine
+
+sed -i -e 's/"i686-linux-gnu",/"i686-linux-gnu","i686-vine-linux",/' tools/clang/lib/Driver/ToolChains/Gnu.cpp
+sed -i -e 's/"x86_64-linux-gnu",/"x86_64-linux-gnu","x86_64-vine-linux",/' tools/clang/lib/Driver/ToolChains/Gnu.cpp
 
 sed -i -e 's/"ld"/"ld.gold"/' tools/clang/include/clang/Driver/ToolChain.h
 
@@ -311,7 +360,8 @@ cd build
 
 CFLAGS="%{optflags} -fno-strict-aliasing -Wno-error=format-security -fPIC"
 CXXFLAGS="%{optflags} -fno-strict-aliasing -Wno-error=format-security -fPIC -std=c++11"
-LDFLAGS="%{?__global_ldflags} -lpthread -ldl"
+TMP_PWD=$(pwd)
+LDFLAGS="%{?__global_ldflags} -L$TMP_PWD/%{_lib} -lpthread -ldl"
 
 %cmake .. \
         -DBUILD_SHARED_LIBS:BOOL=OFF \
@@ -322,7 +372,7 @@ LDFLAGS="%{?__global_ldflags} -lpthread -ldl"
 %else
         -DLLVM_LIBDIR_SUFFIX= \
 %endif
-        -DLLVM_TARGETS_TO_BUILD="X86;AMDGPU;PowerPC;NVPTX;SystemZ;AArch64;ARM;BPF;CppBackend" \
+        -DLLVM_TARGETS_TO_BUILD="X86;AMDGPU;PowerPC;NVPTX;SystemZ;AArch64;ARM;BPF" \
         -DLLVM_ENABLE_LIBCXX:BOOL=OFF \
         -DLLVM_ENABLE_ZLIB:BOOL=ON \
         -DLLVM_ENABLE_FFI:BOOL=ON \
@@ -345,7 +395,6 @@ LDFLAGS="%{?__global_ldflags} -lpthread -ldl"
         -DLLVM_ENABLE_DOXYGEN:BOOL=OFF \
 %endif
         -DLLVM_BUILD_LLVM_DYLIB:BOOL=ON \
-        -DLLVM_DYLIB_EXPORT_ALL:BOOL=ON \
         -DLLVM_LINK_LLVM_DYLIB:BOOL=ON \
         -DLLVM_BUILD_EXTERNAL_COMPILER_RT:BOOL=ON \
         -DLLVM_INSTALL_TOOLCHAIN_ONLY:BOOL=OFF \
@@ -359,9 +408,6 @@ LDFLAGS="%{?__global_ldflags} -lpthread -ldl"
         -DCLANG_BUILD_EXAMPLES:BOOL=OFF \
         -DLIB_SUFFIX= \
         \
-        -DLLDB_PATH_TO_LLVM_BUILD=%{_prefix} \
-        -DLLDB_PATH_TO_CLANG_BUILD=%{_prefix} \
-        \
         -DLLDB_DISABLE_CURSES:BOOL=OFF \
         -DLLDB_DISABLE_LIBEDIT:BOOL=OFF \
         -DLLDB_DISABLE_PYTHON:BOOL=OFF \
@@ -372,9 +418,9 @@ LDFLAGS="%{?__global_ldflags} -lpthread -ldl"
         -DCOMPILER_RT_INCLUDE_TESTS:BOOL=OFF # could be on?
 
 # workaround for all-in-one build
-TMP_PWD=$(pwd)
-LD_LIBRARY_PATH="$TMP_PWD/%{_lib}" make %{?_smp_mflags}
-
+#TMP_PWD=$(pwd)
+#LD_LIBRARY_PATH="$TMP_PWD/%{_lib}" make %{?_smp_mflags}
+make %{?_smp_mflags}
 
 %install
 rm -rf %{buildroot}
@@ -388,12 +434,19 @@ install -m755 ./bin/lli-child-target %{buildroot}%{_bindir}/lli-child-target
 
 # fix multi-lib
 mv -v %{buildroot}%{_bindir}/llvm-config{,-%{__isa_bits}}
+ln -sf llvm-config-%{__isa_bits} %{buildroot}%{_bindir}/llvm-config
 mv -v %{buildroot}%{_includedir}/llvm/Config/llvm-config{,-%{__isa_bits}}.h
 install -m 0644 %{SOURCE10} %{buildroot}%{_includedir}/llvm/Config/llvm-config.h
 
-
 # clang
 
+# remove static libraries
+rm -fv %{buildroot}%{_libdir}/libclang*.a
+
+# install clang python bindings
+mkdir -p %{buildroot}%{python_sitelib}/clang/
+install -p -m644 ../tools/clang/bindings/python/clang/* %{buildroot}%{python_sitelib}/clang/
+
 mv -v %{buildroot}%{_includedir}/clang/Config/config{,-%{__isa_bits}}.h
 install -m 0644 %{SOURCE11} %{buildroot}%{_includedir}/clang/Config/config.h
 
@@ -411,7 +464,7 @@ rm -vf %{buildroot}%{_datadir}/clang/clang-format-diff.py*
 # lldb
 
 # remove static libraries
-#rm -fv %{buildroot}%{_libdir}/*.a
+rm -fv %{buildroot}%{_libdir}/liblldb*.a
 
 # python: fix binary libraries location
 liblldb=$(basename $(readlink -e %{buildroot}%{_libdir}/liblldb.so))
@@ -421,6 +474,11 @@ mv -v %{buildroot}%{python_sitearch}/readline.so %{buildroot}%{python_sitearch}/
 # remove bundled six.py
 rm -f %{buildroot}%{python_sitearch}/six.*
 
+# Move this plugin to libdir.
+# FIXME: I have no idea why this is installed to bindir.  Moving it to libdir
+# may break it, but I don't know how to test this.
+mv -v %{buildroot}{%{_bindir},%{_libdir}}/liblldb-intel-mpxtable.so
+
 
 # compiler-rt
 
@@ -439,8 +497,11 @@ done
 #        ln -s ../$i linux/$i
 #done
 
-rm -rf %{buildroot}%{_libdir}/python*
+#rm -rf %{buildroot}%{_libdir}/python*
 
+rm -f %{buildroot}%{_datadir}/clang/bash-autocomplete.sh
+rm -f %{buildroot}%{_datadir}/clang/clang-rename.el
+rm -f %{buildroot}%{_datadir}/clang/clang-rename.py
 
 %check
 # the || : is wrong, i know, but the git snaps fail to make check due to
@@ -491,24 +552,27 @@ exit 0
 %{_bindir}/lli-child-target
 %{_bindir}/obj2yaml
 %{_bindir}/sancov
+%{_bindir}/sanstats
 %{_bindir}/verify-uselistorder
 %{_bindir}/yaml2obj
+%exclude %{_bindir}/llvm-config
 %exclude %{_bindir}/llvm-config-%{__isa_bits}
 %{_bindir}/llvm*
 %{_bindir}/opt
-%dir %{_datadir}/llvm
 %exclude %{_mandir}/man1/scan-build.1.*
 %doc %{_mandir}/man1/*.1.*
+%{_datadir}/opt-viewer
 
 %files devel
 %defattr(-,root,root,-)
 #doc %{llvmdocdir %{name}-devel}/
+%{_bindir}/llvm-config
 %{_bindir}/llvm-config-%{__isa_bits}
 %{_includedir}/%{name}
 %{_includedir}/%{name}-c
-%{_libdir}/*.a
 %{_libdir}/libLLVM.so
-%{_datadir}/%{name}/cmake
+%{_libdir}/cmake/llvm
+%exclude %{_libdir}/cmake/llvm/LLVMStaticExports.cmake
 
 %files libs
 %defattr(-,root,root,-)
@@ -517,10 +581,14 @@ exit 0
 #dir %{_libdir}/%{name}
 %{_libdir}/BugpointPasses.so
 %{_libdir}/libLLVM-*.so
-%{_libdir}/libLTO.so
+%{_libdir}/libLTO.so*
 %{_libdir}/LLVMgold.so
 %exclude %{_libdir}/LLVMHello.so
 
+%files static
+%{_libdir}/*.a
+%{_libdir}/cmake/llvm/LLVMStaticExports.cmake
+
 %files -n clang
 %defattr(-,root,root,-)
 #doc %{llvmdocdir clang}/
@@ -539,7 +607,7 @@ exit 0
 %{_includedir}/clang
 %{_includedir}/clang-c
 %dir %{_datadir}/clang/
-%{_datadir}/clang/cmake
+%{_libdir}/cmake/*
 
 %files -n clang-analyzer
 %defattr(-,root,root,-)
@@ -551,20 +619,23 @@ exit 0
 %{_datadir}/scan-build
 %{_mandir}/man1/scan-build.1.*
 
+%files -n python-clang
+%{python_sitelib}/clang/
+
 %files -n lldb
 %defattr(-,root,root,-)
 #doc %{llvmdocdir lldb}/
-%{_bindir}/lldb
-%{_bindir}/lldb-*
+%{_bindir}/lldb*
 %{_libdir}/liblldb.so.*
+%{_libdir}/liblldb-intel-mpxtable.so
 
 %files -n lldb-devel
 %defattr(-,root,root,-)
 %{_includedir}/lldb
 %{_libdir}/liblldb.so
 
-#python-lldb
-#{python_sitearch}/*
+%files -n python-lldb
+%{python_sitearch}/lldb
 
 %files doc
 %defattr(-,root,root,-)
@@ -607,11 +678,22 @@ exit 0
 #config(noreplace) %{_sysconfdir}/ld.so.conf.d/llvm-%{_arch}.conf
 %exclude %{_libdir}/libclang.so
 %exclude %{_libdir}/liblldb.so
+%exclude %{_libdir}/liblldb-intel-mpxtable.so
 %exclude %{_libdir}/LLVMHello.so
 %{_libdir}/*.so
+%{_libdir}/libLTO.so.*
 %endif
 
 %changelog
+* Tue Jan 02 2018 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 5.0.1-2
+- added subpackages "llvm-static", "python-lldb" and "python-clang".
+
+* Mon Jan 01 2018 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 5.0.1-1
+- new upstream release.
+- dropped Patch1 and 2: fixed in upstream.
+- imported Patch0, 3-5, 100 and 200 from rawhide.
+- disabled Patch1002: no longer needed?
+
 * Fri Aug  5 2016 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.8.1-1
 - new upstream release.
 - switched to cmake.